{"id":25855,"date":"2015-08-07T18:00:28","date_gmt":"2015-08-07T15:00:28","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=25855"},"modified":"2019-03-21T12:31:07","modified_gmt":"2019-03-21T10:31:07","slug":"junit-test-suite-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/","title":{"rendered":"JUnit Test Suite Example"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p>A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several JUnit Test cases that makes up a specific functionality from the integration. The developer uses the <a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runner\/RunWith.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>@RunWith<\/code><\/a> and <a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runners\/Suite.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>@SuiteClasses<\/code><\/a>&nbsp;to run Suite tests for this purposes.<\/p>\n<p>In this example, I&#8217;ll be showing a simple approach on how you&#8217;ll create a Test Suite that will call 3 test cases.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;\n<\/p>\n<h2>2. Sources<\/h2>\n<p>We first prepare our test cases. In this example, we created 3 different test case classes.<\/p>\n<p><span style=\"text-decoration: underline\"><em>JUnitTest1Suite1.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.areyes1.jgc.test.suite;\n\nimport static org.junit.Assert.assertTrue;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\npublic class JUnitTest1Suite1 {\n\t\n\tint totalNumberOfApplicants = 0;\n\tint totalNumberOfAcceptableApplicants = 10;\n\t\n\t@Before\n\tpublic void setData(){\n\t\tthis.totalNumberOfApplicants = 9;\n\t}\n\t\n\t@Test\n\tpublic void testAssertions() {\n\t\tassertTrue((this.totalNumberOfApplicants != this.totalNumberOfAcceptableApplicants));\n\t}\n\t\n\t@Test\n\tpublic void testAssertFalse() {\n\t\tassertTrue((this.totalNumberOfApplicants == this.totalNumberOfAcceptableApplicants));\n\t}\n\t\n\t@Test\n\tpublic void testAssertTrueWithMessage(){\n\t\tassertTrue(\"Is total number of applicants acceptable?\",(this.totalNumberOfApplicants != this.totalNumberOfAcceptableApplicants));\n\t}\n}\n<\/pre>\n<p><span style=\"text-decoration: underline\"><em>JUnitTest2Suite1.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.areyes1.jgc.test.suite;\n\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.CoreMatchers.isA;\nimport static org.junit.Assert.assertThat;\n\nimport java.util.ArrayList;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\npublic class JUnitTest2Suite1 {\n\tint totalNumberOfApplicants = 0;\n\tint totalNumberOfAcceptableApplicants = 10;\n\tArrayList listOfValidStrings = new ArrayList();\n\t\n\t@Before\n\tpublic void setData(){\n\t\tthis.totalNumberOfApplicants = 9;\n\t\tlistOfValidStrings.add(\"object_1\");\n\t\tlistOfValidStrings.add(\"object_2\");\n\t\tlistOfValidStrings.add(\"object_3\");\n\t}\n\t\n\t@Test\n\tpublic void testAssertThatEqual() {\n\t\tassertThat(\"123\",is(\"123\"));\n\t}\n\t\n\t@Test\n\tpublic void testAssertThatNotEqual() {\n\t\tassertThat(totalNumberOfApplicants,is(123));\n\t}\n\t\n\t@Test\n\tpublic void testAssertThatObject() {\n\t\tassertThat(\"123\",isA(String.class));\n\t}\n\t\n\t\n\t@Test\n\tpublic void testAssertThatWMessage(){\n\t\tassertThat(\"They are not equal!\",\"123\",is(\"1234\"));\n\t}\n}\n\n<\/pre>\n<p><span style=\"text-decoration: underline\"><em>JUnitTest3Suite1.java<\/em><\/span><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">package com.areyes1.jgc.test.suite;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertNull;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport com.jgc.areyes1.junit.AccountService;\nimport com.jgc.areyes1.junit.obj.Account;\n\npublic class JUnitTest3Suite1 {\n\t\n\tprivate AccountService accountService = new AccountService();\n\tprivate Account dummyAccount;\n\t\n\t\n\t@Before \/\/ setup()\n\tpublic void before() throws Exception {\n\t\tSystem.out.println(\"Setting it up!\");\n\t\tdummyAccount = accountService.getAccountDetails();\n\t}\n\t\n\t@Test\n\tpublic void testDummyAccount() {\n\t\tSystem.out.println(\"Running: testDummyAccount\");\n\t\tassertNotNull(dummyAccount.getAccountCode());\n\t}\n\t@Test\n\tpublic void testDummyAccountTransactions() {\n\t\tSystem.out.println(\"Running: testDummyAccountTransactions\");\n\t\tassertEquals(dummyAccount.getAccountTransactions().size(),3);\n\t}\n\t\n\t@After \/\/ tearDown()\n\tpublic void after() throws Exception {\n\t\tSystem.out.println(\"Running: tearDown\");\n\t\tdummyAccount = null;\n\t\tassertNull(dummyAccount);\n\t}\n}\n\n<\/pre>\n<p>After creating or identifying our JUnit test cases that we want to include on this suite, we then create our JUnit Test case suite that will call the 3 tests case classes. Take note of the usage of <a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runner\/RunWith.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>@RunWith<\/code><\/a> and<a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runners\/Suite.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>@SuiteClasses<\/code><\/a> as per below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>JUnitSuite1.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.areyes1.jgc.test.suite;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\nimport org.junit.runners.Suite.SuiteClasses;\n\n@RunWith(Suite.class)\n@SuiteClasses({\n\tJUnitTest1Suite1.class,\n\tJUnitTest2Suite1.class,\n\tJUnitTest3Suite1.class\n})\npublic class JUnitSuite1 {\n\n}\n<\/pre>\n<p>The <a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runner\/RunWith.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>@RunWith<\/code><\/a> annotation is used to tag a class that it should run with a specific class. In this example, we are running this class with a Suite.class to tell our runner that we required that class for this run. The <a href=\"http:\/\/junit.sourceforge.net\/javadoc\/org\/junit\/runners\/Suite.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>@SuiteClasses<\/code><\/a> is the annotation that is used to specify the JUnit Test cases that this suite will be composed of. As specified, we called the 3 unit test case class we created.[ulp id=&#8217;ODQaBEw1BIbHApZq&#8217;]<\/p>\n<p>These are all test cases that we want to run in this suite. As we can see, we have different test case scenarios for each. The purpose of us creating a test suite for them is so that we can consolidate their execution and results into one.<\/p>\n<h2>3. Running the JUnit Test Suite<\/h2>\n<p>You can run the test case by:<\/p>\n<ol>\n<li>Eclipse JUnit Test case run<\/li>\n<li>Create a Runner class from your main entry point<\/li>\n<\/ol>\n<h3>3.1 Eclipse JUnit Test case run<\/h3>\n<p>The eclipse way is straight forward, we right click on the <code>JUnitSuite1.java<\/code> &gt; Run As &gt; JUnit Test.<\/p>\n<p><figure id=\"attachment_25893\" aria-describedby=\"caption-attachment-25893\" style=\"width: 513px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-43-47.jpg\"><img decoding=\"async\" class=\"size-full wp-image-25893\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-43-47.jpg\" alt=\"Figure 1.0 JUnit Test Suite Run via Eclipse result\" width=\"513\" height=\"418\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-43-47.jpg 513w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-43-47-300x244.jpg 300w\" sizes=\"(max-width: 513px) 100vw, 513px\" \/><\/a><figcaption id=\"caption-attachment-25893\" class=\"wp-caption-text\">Figure 1.0 JUnit Test Suite Run via Eclipse result<\/figcaption><\/figure><\/p>\n<h3>3.2 Create a Runner class from your main entry point<\/h3>\n<p>We can also run the test case using a Runner class. Code of the runner below<\/p>\n<p><span style=\"text-decoration: underline\"><em>TestRunnerForTestSuite.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.areyes1.jgc.test.suite.runner;\nimport org.junit.runner.JUnitCore;\nimport org.junit.runner.notification.Failure;\nimport com.areyes1.jgc.test.suite.JUnitSuite1;\npublic class TestRunnerForTestSuite {\n\n\tpublic static void main(String[] args) {\n\t\torg.junit.runner.Result result = JUnitCore.runClasses(JUnitSuite1.class);\n\t\tfor (Failure failure : result.getFailures()) {\n\t\t\tSystem.out.println(failure.toString());\n\t\t}\n\t\tSystem.out.println(result.wasSuccessful());\n\t}\n\n}\n<\/pre>\n<p>Result of running the runner below<\/p>\n<p><figure id=\"attachment_25895\" aria-describedby=\"caption-attachment-25895\" style=\"width: 734px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-46-39.jpg\"><img decoding=\"async\" class=\"size-full wp-image-25895\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-46-39.jpg\" alt=\"Figure 2.0 Running the runner class result\" width=\"734\" height=\"338\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-46-39.jpg 734w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Screenshot-at-Aug-07-16-46-39-300x138.jpg 300w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/a><figcaption id=\"caption-attachment-25895\" class=\"wp-caption-text\">Figure 2.0 Running the runner class result<\/figcaption><\/figure><\/p>\n<p>As you might have observe, the test suite runs all the test case class that&#8217;s associated to it. It&#8217;s grouping all of these test case to come up with a unified results of specific scenarios of the system. This is extremely a valuable feature especially if we need to test different scenarios of integrated services for a common functional requirement. A great example would be if there is a separate module\/service for account opening and account cash transfer. With this feature, we can combine the test cases of these two functional requirements and come up with a unified test case of an end to end account opening to cash transfer process.<\/p>\n<h2>4. Download the Eclipse project<\/h2>\n<p>This was an example of JUnit Test Suite.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <strong><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/junit-testsuite-example.zip\">junit-testsuite-example<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several JUnit Test cases that makes up a specific functionality from the integration. The developer uses the @RunWith and @SuiteClasses&nbsp;to run Suite tests for this purposes. In this &hellip;<\/p>\n","protected":false},"author":41,"featured_media":6678,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[1032,1007],"class_list":["post-25855","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-junit","tag-junit","tag-suite"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JUnit Test Suite Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several\" \/>\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-test-suite-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JUnit Test Suite Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-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:author\" content=\"https:\/\/www.facebook.com\/alvinjayreyes\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-07T15:00:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-21T10:31:07+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=\"Alvin Reyes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@alvinjayreyes\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alvin Reyes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 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-test-suite-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/\"},\"author\":{\"name\":\"Alvin Reyes\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/b5bc005030b168a0a95f041b047bf82d\"},\"headline\":\"JUnit Test Suite Example\",\"datePublished\":\"2015-08-07T15:00:28+00:00\",\"dateModified\":\"2019-03-21T10:31:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/\"},\"wordCount\":520,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"keywords\":[\"junit\",\"suite\"],\"articleSection\":[\"junit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/\",\"name\":\"JUnit Test Suite Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"datePublished\":\"2015-08-07T15:00:28+00:00\",\"dateModified\":\"2019-03-21T10:31:07+00:00\",\"description\":\"1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-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-test-suite-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 Test Suite 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\/b5bc005030b168a0a95f041b047bf82d\",\"name\":\"Alvin Reyes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Alvin-Reyes-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Alvin-Reyes-96x96.jpg\",\"caption\":\"Alvin Reyes\"},\"description\":\"Alvin has an Information Technology Degree from Mapua Institute of Technology. During his studies, he was already heavily involved in a number of small to large projects where he primarily contributes by doing programming, analysis design. After graduating, he continued to do side projects on Mobile, Desktop and Web Applications.\",\"sameAs\":[\"http:\/\/www.alvinjayreyes.com\",\"https:\/\/www.facebook.com\/alvinjayreyes\",\"http:\/\/ca.linkedin.com\/in\/alvinpreyes\",\"https:\/\/x.com\/alvinjayreyes\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/alvin-reyes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JUnit Test Suite Example - Java Code Geeks","description":"1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several","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-test-suite-example\/","og_locale":"en_US","og_type":"article","og_title":"JUnit Test Suite Example - Java Code Geeks","og_description":"1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/alvinjayreyes","article_published_time":"2015-08-07T15:00:28+00:00","article_modified_time":"2019-03-21T10:31:07+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":"Alvin Reyes","twitter_card":"summary_large_image","twitter_creator":"@alvinjayreyes","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Alvin Reyes","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/"},"author":{"name":"Alvin Reyes","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/b5bc005030b168a0a95f041b047bf82d"},"headline":"JUnit Test Suite Example","datePublished":"2015-08-07T15:00:28+00:00","dateModified":"2019-03-21T10:31:07+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/"},"wordCount":520,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","keywords":["junit","suite"],"articleSection":["junit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/","name":"JUnit Test Suite Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","datePublished":"2015-08-07T15:00:28+00:00","dateModified":"2019-03-21T10:31:07+00:00","description":"1. Introduction A JUnit Test suite is used to bundle multiple test cases together in a single run. This is usually used if you want to integrated several","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-test-suite-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-test-suite-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 Test Suite 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\/b5bc005030b168a0a95f041b047bf82d","name":"Alvin Reyes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Alvin-Reyes-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/01\/Alvin-Reyes-96x96.jpg","caption":"Alvin Reyes"},"description":"Alvin has an Information Technology Degree from Mapua Institute of Technology. During his studies, he was already heavily involved in a number of small to large projects where he primarily contributes by doing programming, analysis design. After graduating, he continued to do side projects on Mobile, Desktop and Web Applications.","sameAs":["http:\/\/www.alvinjayreyes.com","https:\/\/www.facebook.com\/alvinjayreyes","http:\/\/ca.linkedin.com\/in\/alvinpreyes","https:\/\/x.com\/alvinjayreyes"],"url":"https:\/\/examples.javacodegeeks.com\/author\/alvin-reyes\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/25855","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\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=25855"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/25855\/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=25855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=25855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=25855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}