{"id":7033,"date":"2013-11-19T12:00:10","date_gmt":"2013-11-19T10:00:10","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=7033"},"modified":"2019-03-21T12:53:56","modified_gmt":"2019-03-21T10:53:56","slug":"junit-suite-test-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/","title":{"rendered":"JUnit Suite Test Example"},"content":{"rendered":"<p>In this example we are going to explain how to use a test suite in <a href=\"http:\/\/junit.org\/\">JUnit<\/a> testing framework. Test suite is a collection of some test cases from different classes that can be run all together using <code>@RunWith<\/code> and <code>@Suite<\/code> annotations. Also, we will see how to run these test cases from the command line by using the <code><a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runner\/JUnitCore.html\">org.junit.runner.JUnitCore<\/a><\/code>.<\/p>\n<h2><strong>1. Create the java class to be tested<br \/>\n<\/strong><\/h2>\n<p>Create a folder named <code>JUnitSuite<\/code>. This is the folder where your classes will be located. Using Notepad or another text editor, create a Java class to be tested named <code>FirstDayAtSchool.java<\/code>. To make sure your file name is <code>FirstDayAtSchool.java<\/code>, (not <code>FirstDayAtSchool.java.txt<\/code>), first choose <em>&#8220;Save as -&gt; Save as type -&gt; All files&#8221;<\/em>, then type in the file name <code>FirstDayAtSchool.java<\/code>.<\/p>\n<p>&nbsp;<br \/>\n<span style=\"text-decoration: underline;\"><em>FirstDayAtSchool.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import java.util.Arrays;\n\npublic class FirstDayAtSchool {\n\n\tpublic String[] prepareMyBag() {\n\t\tString[] schoolbag = {\"Books\", \"Notebooks\", \"Pens\"};\n\t\tSystem.out.println(\"My school bag contains: \"+Arrays.toString(schoolbag));\n\t\treturn schoolbag;\n\t}\n\n\tpublic String[] addPencils() {\n\t\tString[] schoolbag = {\"Books\", \"Notebooks\", \"Pens\", \"Pencils\"};\n\t\tSystem.out.println(\"Now my school bag contains: \"+Arrays.toString(schoolbag));\n\t\treturn schoolbag;\n\t}\n}<\/pre>\n<h2><strong>2. Create JUnit test cases<br \/>\n<\/strong><\/h2>\n<p>In the same directory (<code>JUnitSuite<\/code>), use Notepad or another text editor and create two java classes that will be our test cases. The first class named <code>JunitTest1.java<\/code> has the following code.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitTest1.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import static org.junit.Assert.*;\nimport org.junit.Test;\n\npublic class JunitTest1 {\n\n   FirstDayAtSchool school = new FirstDayAtSchool();\n   String[] bag = {\"Books\", \"Notebooks\", \"Pens\"};\n\n   @Test\n   public void testPrepareMyBag() {\t\n      System.out.println(\"Inside testPrepareMyBag()\");    \n      assertArrayEquals(bag, school.prepareMyBag());     \n   }\n}<\/pre>\n<p>The second class named <code>JunitTest2.java<\/code> will be also used as a test case and has the following code.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitTest2.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import static org.junit.Assert.*;\nimport org.junit.Test;\n\npublic class JunitTest2 {\n\n   FirstDayAtSchool school = new FirstDayAtSchool();\n   String[] bag = {\"Books\", \"Notebooks\", \"Pens\", \"Pencils\"};\n\n   @Test\n   public void testAddPencils() {\t\n      System.out.println(\"Inside testAddPencils()\");    \n      assertArrayEquals(bag, school.addPencils());     \n   }\n}<\/pre>\n<p>In the above test cases we can see the annotation <code>@Test<\/code> and the assert <code>assertArrayEquals<\/code>. Let&#8217;s give a short explanation of those two elements.<\/p>\n<ul>\n<li>\n<h3><code><strong>@Test<\/strong><\/code><\/h3>\n<\/li>\n<\/ul>\n<p>The Test annotation indicates that the public void method to which it is attached can be run as a test case.<\/p>\n<ul>\n<li>\n<h3><code><strong>void assertArrayEquals([String message], expectedArray, resultArray)<\/strong><\/code><\/h3>\n<\/li>\n<\/ul>\n<p>Asserts that the array expected and the resulted array are equal. The type of Array might be int, long, short, char, byte or java.lang.Object.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>For further details related to JUnit Assertions and Annotations, you can have a look at <a href=\"http:\/\/examples.javacodegeeks.com\/core-java\/junit\/junit-using-assertions-and-annotations-example\/\">JUnit using Assertions and Annotations Example<\/a>.<\/p>\n<h2><strong>3. Create JUnit Test suite<br \/>\n<\/strong><\/h2>\n<p>In the same directory (<code>JUnitSuite<\/code>), use Notepad or another text editor and create a java class named <code>JunitTestSuite.java<\/code>. This class is the test suite of the two test cases in the previous section and has the following code.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitTestSuite.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\n@RunWith(Suite.class)\n@Suite.SuiteClasses({\n   JunitTest1.class,\n   JunitTest2.class\n})\npublic class JunitTestSuite {   \n}<\/pre>\n<p>In the test suite, we can see that there are two annotations,<code> @RunWith<\/code> and <code>@Suite.SuiteClasses<\/code>.<br \/>\nLet&#8217;s give a short explanation of them.<\/p>\n<ul>\n<li>\n<h3><code><strong>@RunWith<\/strong><\/code><\/h3>\n<\/li>\n<\/ul>\n<p>When a class is annotated with <code>@RunWith<\/code>, JUnit will invoke the class in which is annotated so as to run the tests, instead of using the runner built into JUnit.<\/p>\n<ul>\n<li>\n<h3><code><strong>@Suite.SuiteClasses<\/strong><\/code><\/h3>\n<\/li>\n<\/ul>\n<p>The <code>SuiteClasses<\/code> annotation specifies the classes to be executed when a class annotated with <code>@RunWith(Suite.class)<\/code> is run.<\/p>\n<h2><strong>4. Run your test from the command line<br \/>\n<\/strong><\/h2>\n<p>You can run your JUnit test outside Eclipse, by using the <code>org.junit.runner.JUnitCore<\/code> class. This class provides the <code>runClasses()<\/code> method which allows you to execute one or several test classes. The return type of <code>runClasses()<\/code> method is an object of the type <code><a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runner\/Result.html\">org.junit.runner.Result<\/a><\/code>. This object can be used to collect information about the tests. Also, in case there is a failed test, you can use the object <code><a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runner\/notification\/Failure.html\">org.junit.runner.notification.Failure<\/a><\/code> which holds description of the failed tests.<\/p>\n<p>The procedure below shows how to run your test outside Eclipse.<\/p>\n<p>In the directory <code>JUnitSuite<\/code>, use Notepad or another editor and create a new Java class named <code>JunitTestSuiteRunner.java<\/code> with the following code.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitTestSuiteRunner.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import org.junit.runner.JUnitCore;\nimport org.junit.runner.Result;\nimport org.junit.runner.notification.Failure;\n\npublic class JunitTestSuiteRunner {\n\n\tpublic static void main(String[] args) {\n\n\t\tResult result = JUnitCore.runClasses(JunitTestSuite.class);\n\t\tfor (Failure fail : result.getFailures()) {\n\t\t\tSystem.out.println(fail.toString());\n\t\t}\n\t\tif (result.wasSuccessful()) {\n\t\t\tSystem.out.println(\"All tests finished successfully...\");\n\t\t}\n\t}\n}<\/pre>\n<ul>\n<li>Open command prompt and move down directories so as to find the directory where your java classes are located:<\/li>\n<\/ul>\n<pre class=\"brush:bash\">C:\\Users\\konstantina&gt;cd JUnitSuite<\/pre>\n<p><em>Attention: If your classes are located inside a package, for example <code>package com.javacodegeeks.core.junit<\/code>, the structure of your classes should look like this: <\/em>[ulp id=&#8217;ODQaBEw1BIbHApZq&#8217;]<\/p>\n<pre class=\"brush:bash\">C:\\Users\\\n      |\n      ---&gt; konstantina\\  \n            |\n            ---&gt; JUnitSuite\\\n                  |\n                   ---&gt; com\\\n                         |\n                         ---&gt; javacodegeeks\\\n                               |\n                               ---&gt; core\\\n                                     |\n                                     ---&gt; junit\\\n                                           |\n                                           ---&gt; FirstDayAtSchool.java       \n                                           ---&gt; JunitTest1.java   \n                                           ---&gt; JunitTest2.java  \n                                           ---&gt; JunitTestSuite.java  \n                                           ---&gt; JunitTestSuiteRunner.java  \n<\/pre>\n<p><em>Thus, you should do the following so as to find the suitable directory for the compilation.<\/em><\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina&gt;cd JUnitSuite\n\nC:\\Users\\konstantina\\JUnitSuite&gt;cd com\n\nC:\\Users\\konstantina\\JUnitSuite\\com&gt;cd javacodegeeks\n\nC:\\Users\\konstantina\\JUnitSuite\\com\\javacodegeeks&gt;cd core\n\nC:\\Users\\konstantina\\JUnitSuite\\com\\javacodegeeks\\core&gt;cd junit\n\nC:\\Users\\konstantina\\JUnitSuite\\com\\javacodegeeks\\core\\junit&gt;<\/pre>\n<ul>\n<li>When <code>JUnitSuite<\/code> is your current directory, compile all the classes in the direcory (the class to be tested, the two Test classes, the Suite class and the Runner class.<\/li>\n<\/ul>\n<p><em>Attention: To run your JUnit tests outside Eclipse properly you need to add the needed JUnit library jars to the classpath of your program. You can find those library jars <a href=\"https:\/\/github.com\/junit-team\/junit\/wiki\/Download-and-Install#plain-old-jar\">here<\/a>.<\/em><\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitSuite&gt;javac -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; FirstDayAtSchool.java JunitTest1.java JunitTest2.java JunitTestSuite.java JunitTestSuiteRunner.java<\/pre>\n<p><em>As we mentioned in the previous step, in case your classes are located in a package, you have to ensure that you are in the correct directory, e.g.&nbsp; <code>junit<\/code> according to the previous example.<\/em><\/p>\n<ul>\n<li>Now run the <code>JunitTestSuiteRunner<\/code><\/li>\n<\/ul>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitAssertions&gt;java -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; JunitTestSuiteRunner<\/pre>\n<p><em>Attention: As we mentioned in the previous steps, if your classes are located into o package, for example <code>package com.javacodegeeks.core.junit<\/code>, you should first move up directories so as to find the <code>JUnitSuite <\/code>directory. Specifically, you should do the following:<\/em><\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitSuite\\com\\javacodegeeks\\core\\junit&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitSuite\\com\\javacodegeeks\\core&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitSuite\\com\\javacodegeeks&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitSuite\\com&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitSuite&gt;<\/pre>\n<p><em>Now that <code>JUnitSuite<\/code> is your current directory, you can run the <code>JunitTestSuiteRunner<\/code>.<br \/>\n<\/em><\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitSuite&gt;java -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; com.javacodegeeks.core.junit.JunitTestSuiteRunner<\/pre>\n<ul>\n<li>Here is the output:<\/li>\n<\/ul>\n<pre style=\"background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;\"><code style=\"color: black; word-wrap: normal;\">Inside testPrepareMyBag()\nMy school bag contains: [Books, Notebooks, Pens]\nInside testAddPencils()\nNow my school bag contains: [Books, Notebooks, Pens, Pencils]\nAll tests finished successfully...<\/code><\/pre>\n<h2>Download the source code<\/h2>\n<p>This was an example of test suite in JUnit testing framework.<br \/>\nDownload the source code of this example : <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/JUnitSuite.zip\">JUnitSuite.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different classes that can be run all together using @RunWith and @Suite annotations. Also, we will see how to run these test cases from the command line &hellip;<\/p>\n","protected":false},"author":9,"featured_media":6678,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-7033","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-junit"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JUnit Suite Test Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JUnit Suite Test Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-19T10:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-21T10:53:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Konstantina Dimtsa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Konstantina Dimtsa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\"},\"author\":{\"name\":\"Konstantina Dimtsa\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5fc06d4d50814931c15af68106832a56\"},\"headline\":\"JUnit Suite Test Example\",\"datePublished\":\"2013-11-19T10:00:10+00:00\",\"dateModified\":\"2019-03-21T10:53:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\"},\"wordCount\":715,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"articleSection\":[\"junit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\",\"name\":\"JUnit Suite Test Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"datePublished\":\"2013-11-19T10:00:10+00:00\",\"dateModified\":\"2019-03-21T10:53:56+00:00\",\"description\":\"In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"junit\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/junit\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"JUnit Suite Test Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5fc06d4d50814931c15af68106832a56\",\"name\":\"Konstantina Dimtsa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Konstantina-Dimtsa-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Konstantina-Dimtsa-96x96.jpg\",\"caption\":\"Konstantina Dimtsa\"},\"description\":\"Konstantina has graduated from the Department of Informatics and Telecommunications in National and Kapodistrian University of Athens (NKUA) and she is currently pursuing M.Sc studies in Advanced Information Systems at the same department. She is also working as a research associate for NKUA in the field of telecommunications. Her main interests lie in software engineering, web applications, databases and telecommunications.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/konstantina-dimtsa\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JUnit Suite Test Example - Java Code Geeks","description":"In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/","og_locale":"en_US","og_type":"article","og_title":"JUnit Suite Test Example - Java Code Geeks","og_description":"In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-11-19T10:00:10+00:00","article_modified_time":"2019-03-21T10:53:56+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","type":"image\/jpeg"}],"author":"Konstantina Dimtsa","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Konstantina Dimtsa","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/"},"author":{"name":"Konstantina Dimtsa","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5fc06d4d50814931c15af68106832a56"},"headline":"JUnit Suite Test Example","datePublished":"2013-11-19T10:00:10+00:00","dateModified":"2019-03-21T10:53:56+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/"},"wordCount":715,"commentCount":1,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","articleSection":["junit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/","name":"JUnit Suite Test Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","datePublished":"2013-11-19T10:00:10+00:00","dateModified":"2019-03-21T10:53:56+00:00","description":"In this example we are going to explain how to use a test suite in JUnit testing framework. Test suite is a collection of some test cases from different","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-suite-test-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"junit","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/junit\/"},{"@type":"ListItem","position":5,"name":"JUnit Suite Test Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5fc06d4d50814931c15af68106832a56","name":"Konstantina Dimtsa","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Konstantina-Dimtsa-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Konstantina-Dimtsa-96x96.jpg","caption":"Konstantina Dimtsa"},"description":"Konstantina has graduated from the Department of Informatics and Telecommunications in National and Kapodistrian University of Athens (NKUA) and she is currently pursuing M.Sc studies in Advanced Information Systems at the same department. She is also working as a research associate for NKUA in the field of telecommunications. Her main interests lie in software engineering, web applications, databases and telecommunications.","sameAs":["http:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/konstantina-dimtsa\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=7033"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7033\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/6678"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=7033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=7033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=7033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}