{"id":7355,"date":"2013-12-03T12:00:02","date_gmt":"2013-12-03T10:00:02","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=7355"},"modified":"2019-03-21T12:53:23","modified_gmt":"2019-03-21T10:53:23","slug":"junit-ignore-test-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/","title":{"rendered":"JUnit Ignore Test Example"},"content":{"rendered":"<p>In this example we are going to see how to use <code>@Ignore<\/code> annotation in <a href=\"http:\/\/junit.org\/\">JUnit<\/a> testing framework. Also, we will see how to run the created 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>JUnitIgnore<\/code>. This is the folder where your classes will be located. Using a 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>JUnitIgnore<\/code>), use a text editor and create a java class named <code>JunitIgnoreTest1.java<\/code> which will be our first test case. Below is the code of this class.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitIgnoreTest1.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import static org.junit.Assert.assertArrayEquals;\n\nimport org.junit.Ignore;\nimport org.junit.Test;\n\npublic class JunitIgnoreTest1 {\n\n   FirstDayAtSchool school = new FirstDayAtSchool();\n   String[] bag1 = {\"Books\", \"Notebooks\", \"Pens\"};\n   String[] bag2 = {\"Books\", \"Notebooks\", \"Pens\", \"Pencils\"};\n\n   @Test\n   public void testPrepareMyBag() {\t\n      System.out.println(\"Inside testPrepareMyBag()\");    \n      assertArrayEquals(bag1, school.prepareMyBag());     \n   }\n\n   @Ignore\n   @Test\n   public void testAddPencils() {\t \n      System.out.println(\"Inside testAddPencils()\");    \n      assertArrayEquals(bag2, school.addPencils());     \n   }\n}<\/pre>\n<p>Now, create another java class, named <code>JunitIgnoreTest2.java<\/code> which will be our second test case.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitIgnoreTest2.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import static org.junit.Assert.assertArrayEquals;\n\nimport org.junit.Ignore;\nimport org.junit.Test;\n\n@Ignore\npublic class JunitIgnoreTest2 {\n\n   FirstDayAtSchool school = new FirstDayAtSchool();\n   String[] bag1 = {\"Books\", \"Notebooks\", \"Pens\"};\n   String[] bag2 = {\"Books\", \"Notebooks\", \"Pens\", \"Pencils\"};\n\n   @Test\n   public void testPrepareMyBag() {\t\n      System.out.println(\"Inside testPrepareMyBag()\");    \n      assertArrayEquals(bag1, school.prepareMyBag());     \n   }\n\n   @Test\n   public void testAddPencils() {\t \n      System.out.println(\"Inside testAddPencils()\");    \n      assertArrayEquals(bag2, school.addPencils());     \n   }\n}\n<\/pre>\n<p>We can see that both test cases include the <code>@Ignore<\/code> annotation. Below is a short explanation of this annotation.<\/p>\n<ul>\n<li>\n<h3><code><strong>@Ignore<\/strong><\/code><\/h3>\n<\/li>\n<\/ul>\n<p>The <code>@Ignore<\/code> annotation can be used when you want temporarily disable the execution of a specific test. Every method that is annotated with <code>@Ignore<\/code> won\u2019t be executed.<\/p>\n<p>In the <code>JunitIgnoreTest1.java<\/code>, the<code> @Ignore<\/code> annotates the second method <code>testAddPencils()<\/code> while in the <code>JunitIgnoreTest2.java<\/code>, the <code>@Ignore<\/code> annotates all the class. So, in the first case we expect that only the first method will be executed while in the second case, we expect that both test methods will be ignored. Execution of those test cases will prove if our assumptions are right.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Before moving to the next section, we would like to give a short explanation of the other two JUnit elements that we see in the code,<code> @Test<\/code> annotation and <code>assertArrayEquals<\/code> assertion.<\/p>\n<ul>\n<li>\n<h3><code><strong>@Test<\/strong><\/code><\/h3>\n<\/li>\n<\/ul>\n<p>The <code>@Test<\/code> 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.<\/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. Run your test cases 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>JUnitIgnore<\/code>, use a text editor and create a new Java class named <code>JunitIgnoreTestRunner.java<\/code> with the following code.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JunitIgnoreTestRunner.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 JunitIgnoreTestRunner {\n\n\tpublic static void main(String[] args) {\n\n\t\tResult result = JUnitCore.runClasses(JunitIgnoreTest1.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<p>At first place, we will run only <code>JunitIgnoreTest1.java<\/code>, so the argument of <code>runClasses<\/code> method will be the first test case class.<\/p>\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 JUnitIgnore<\/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><\/p>\n<pre class=\"brush:bash\">C:\\Users\\\n      |\n      ---&gt; konstantina\\  \n            |\n            ---&gt; JUnitIgnore\\\n                  |\n                   ---&gt; com\\\n                         |\n                         ---&gt; javacodegeeks\\\n                               |\n                               ---&gt; core\\\n                                     |\n                                     ---&gt; junit\\\n                                           |\n                                           ---&gt; FirstDayAtSchool.java       \n                                           ---&gt; JunitIgnoreTest1.java \n                                           ---&gt; JunitIgnoreTest2.java     \n                                           ---&gt; JunitIgnoreTestRunner.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 JUnitIgnore\n\nC:\\Users\\konstantina\\JUnitIgnore&gt;cd com\n\nC:\\Users\\konstantina\\JUnitIgnore\\com&gt;cd javacodegeeks\n\nC:\\Users\\konstantina\\JUnitIgnore\\com\\javacodegeeks&gt;cd core\n\nC:\\Users\\konstantina\\JUnitIgnore\\com\\javacodegeeks\\core&gt;cd junit\n\nC:\\Users\\konstantina\\JUnitIgnore\\com\\javacodegeeks\\core\\junit&gt;<\/pre>\n<ul>\n<li>When <code>JUnitIgnore<\/code> is your current directory, compile all the classes in the direcory<\/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>[ulp id=&#8217;ODQaBEw1BIbHApZq&#8217;]<\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitIgnore&gt;javac -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; FirstDayAtSchool.java JunitIgnoreTest1.java JunitIgnoreTest2.java JunitIgnoreTestRunner.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.  <code>junit<\/code> according to the previous example.<\/em><\/p>\n<ul>\n<li>Now run the <code>JunitIgnoreTestRunner<\/code><\/li>\n<\/ul>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitIgnore&gt;java -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; JunitIgnoreTestRunner<\/pre>\n<p><em>Attention: As we mentioned in the previous steps, if your classes are located into a package, for example <code>package com.javacodegeeks.core.junit<\/code>, you should first move up directories so as to find the <code>JUnitIgnore <\/code>directory. Specifically, you should do the following:<\/em><\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitIgnore\\com\\javacodegeeks\\core\\junit&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitIgnore\\com\\javacodegeeks\\core&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitIgnore\\com\\javacodegeeks&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitIgnore\\com&gt;cd ..\n\nC:\\Users\\konstantina\\JUnitIgnore&gt;<\/pre>\n<p><em>Now that <code>JUnitIgnore<\/code> is your current directory, you can run the <code>JunitIgnoreTestRunner<\/code>.<br \/>\n<\/em><\/p>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitIgnore&gt;java -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; com.javacodegeeks.core.junit.JunitIgnoreTestRunner<\/pre>\n<ul>\n<li>Here is the output of the first test case:<\/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]\nAll tests finished successfully...<\/code><\/pre>\n<p>As we see in the output, the only test method which is executed is the first one ( <code>testPrepareMyBag()<\/code>). The second one <code>testAddPencils()<\/code> is not executed, as it&#8217;s annotated with the <code>@Ignore <\/code>annotation. So, the result is exactly what we expected.<\/p>\n<p>Now, we will run the second test case <code>JunitIgnoreTest2.java<\/code>, following the procedure described before.<\/p>\n<ul>\n<li>First of all, we have to update the <code>JunitIgnoreTestRunner.java <\/code> so as to run the second test case.<\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\"><em>JunitIgnoreTestRunner.java (updated)<\/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 JunitIgnoreTestRunner {\n\n\tpublic static void main(String[] args) {\n\n\t\tResult result = JUnitCore.runClasses(JunitIgnoreTest2.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>When <code>JUnitIgnore<\/code> is your current directory, compile again all the classes in the directory<\/li>\n<\/ul>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitIgnore&gt;javac -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; FirstDayAtSchool.java JunitIgnoreTest1.java JunitIgnoreTest2.java JunitIgnoreTestRunner.java<\/pre>\n<ul>\n<li>Now run the <code>JunitIgnoreTestRunner<\/code> so as to verify the new results.<\/li>\n<\/ul>\n<pre class=\"brush:bash\">C:\\Users\\konstantina\\JUnitIgnore&gt;java -classpath \"C:\\Users\\konstantina\\Downloads\\junit-4.11.jar\";\"C:\\Users\\konstantina\\Downloads\\hamcrest-core-1.3.jar\"; JunitIgnoreTestRunner<\/pre>\n<ul>\n<li>Here is the new 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;\">All tests finished successfully...<\/code><\/pre>\n<p>As we see in the output, by adding<code> @Ignore <\/code>annotation at class level, both test methods are ignored, so no test case is tested.<\/p>\n<h2>Download the source code<\/h2>\n<p>This was an example of <code>@Ignore<\/code> annotation in JUnit testing framework.<br \/>\nDownload the source code of this example : <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/12\/JUnitIgnore.zip\">JUnitIgnore.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the command line by using the org.junit.runner.JUnitCore. 1. Create the java class to be tested Create a folder named JUnitIgnore. This is the folder where your &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-7355","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 Ignore Test Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the\" \/>\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-ignore-test-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JUnit Ignore Test Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-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-12-03T10:00:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-21T10:53:23+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=\"7 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-ignore-test-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/\"},\"author\":{\"name\":\"Konstantina Dimtsa\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5fc06d4d50814931c15af68106832a56\"},\"headline\":\"JUnit Ignore Test Example\",\"datePublished\":\"2013-12-03T10:00:02+00:00\",\"dateModified\":\"2019-03-21T10:53:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/\"},\"wordCount\":810,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-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-ignore-test-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/\",\"name\":\"JUnit Ignore Test Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"datePublished\":\"2013-12-03T10:00:02+00:00\",\"dateModified\":\"2019-03-21T10:53:23+00:00\",\"description\":\"In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-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-ignore-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 Ignore 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 Ignore Test Example - Java Code Geeks","description":"In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the","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-ignore-test-example\/","og_locale":"en_US","og_type":"article","og_title":"JUnit Ignore Test Example - Java Code Geeks","og_description":"In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-12-03T10:00:02+00:00","article_modified_time":"2019-03-21T10:53:23+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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/"},"author":{"name":"Konstantina Dimtsa","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5fc06d4d50814931c15af68106832a56"},"headline":"JUnit Ignore Test Example","datePublished":"2013-12-03T10:00:02+00:00","dateModified":"2019-03-21T10:53:23+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/"},"wordCount":810,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-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-ignore-test-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/","name":"JUnit Ignore Test Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","datePublished":"2013-12-03T10:00:02+00:00","dateModified":"2019-03-21T10:53:23+00:00","description":"In this example we are going to see how to use @Ignore annotation in JUnit testing framework. Also, we will see how to run the created test cases from the","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-test-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/junit-ignore-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-ignore-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 Ignore 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\/7355","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=7355"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7355\/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=7355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=7355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=7355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}