From b229582ff1c616ed7c315bcca67b4f9c7d7b1598 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 3 Apr 2008 14:04:13 +0000 Subject: [PATCH] whitespace changes only git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@644321 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/junit/JUnitTaskTest.java | 146 ++++++++++-------- 1 file changed, 82 insertions(+), 64 deletions(-) diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java index a638ea047..6eead3993 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java @@ -101,82 +101,100 @@ public class JUnitTaskTest extends BuildFileTest { // But running the JUnit testcase fails in 4th run. public void testFailureRecorder() { try { - File testDir = new File(getProjectDir(), "out"); - File collectorFile = new File(getProjectDir(), "out/FailedTests.java"); + File testDir = new File(getProjectDir(), "out"); + File collectorFile = new File(getProjectDir(), + "out/FailedTests.java"); - // ensure that there is a clean test environment - assertFalse("Test directory '" + testDir.getAbsolutePath() + "' must not exist before the test preparation.", - testDir.exists()); - assertFalse("The collector file '" + collectorFile.getAbsolutePath() + "'must not exist before the test preparation.", - collectorFile.exists()); + // ensure that there is a clean test environment + assertFalse("Test directory '" + testDir.getAbsolutePath() + + "' must not exist before the test preparation.", + testDir.exists()); + assertFalse("The collector file '" + + collectorFile.getAbsolutePath() + + "'must not exist before the test preparation.", + collectorFile.exists()); - // prepare the test environment - executeTarget("failureRecorder.prepare"); - assertTrue("Test directory '" + testDir.getAbsolutePath() + "' was not created.", testDir.exists()); - assertTrue("There should be one class.", (new File(testDir, "A.class")).exists()); - assertFalse("The collector file '" + collectorFile.getAbsolutePath() - + "' should not exist before the 1st run.", collectorFile.exists()); + // prepare the test environment + executeTarget("failureRecorder.prepare"); + assertTrue("Test directory '" + testDir.getAbsolutePath() + + "' was not created.", testDir.exists()); + assertTrue("There should be one class.", + (new File(testDir, "A.class")).exists()); + assertFalse("The collector file '" + + collectorFile.getAbsolutePath() + + "' should not exist before the 1st run.", + collectorFile.exists()); - // 1st junit run: should do all tests - failing and not failing tests - executeTarget("failureRecorder.runtest"); - assertTrue("The collector file '" + collectorFile.getAbsolutePath() - + "' should exist after the 1st run.", collectorFile.exists()); - // the passing test cases - assertOutputContaining("1st run: should run A.test01", "A.test01"); - assertOutputContaining("1st run: should run B.test05", "B.test05"); - assertOutputContaining("1st run: should run B.test06", "B.test06"); - assertOutputContaining("1st run: should run C.test07", "C.test07"); - assertOutputContaining("1st run: should run C.test08", "C.test08"); - assertOutputContaining("1st run: should run C.test09", "C.test09"); - // the failing test cases - assertOutputContaining("1st run: should run A.test02", "A.test02"); - assertOutputContaining("1st run: should run A.test03", "A.test03"); - assertOutputContaining("1st run: should run B.test04", "B.test04"); - assertOutputContaining("1st run: should run D.test10", "D.test10"); + // 1st junit run: should do all tests - failing and not failing tests + executeTarget("failureRecorder.runtest"); + assertTrue("The collector file '" + collectorFile.getAbsolutePath() + + "' should exist after the 1st run.", + collectorFile.exists()); + // the passing test cases + assertOutputContaining("1st run: should run A.test01", "A.test01"); + assertOutputContaining("1st run: should run B.test05", "B.test05"); + assertOutputContaining("1st run: should run B.test06", "B.test06"); + assertOutputContaining("1st run: should run C.test07", "C.test07"); + assertOutputContaining("1st run: should run C.test08", "C.test08"); + assertOutputContaining("1st run: should run C.test09", "C.test09"); + // the failing test cases + assertOutputContaining("1st run: should run A.test02", "A.test02"); + assertOutputContaining("1st run: should run A.test03", "A.test03"); + assertOutputContaining("1st run: should run B.test04", "B.test04"); + assertOutputContaining("1st run: should run D.test10", "D.test10"); - // 2nd junit run: should do only failing tests - executeTarget("failureRecorder.runtest"); - assertTrue("The collector file '" + collectorFile.getAbsolutePath() - + "' should exist after the 2nd run.", collectorFile.exists()); - // the passing test cases - assertOutputNotContaining("2nd run: should not run A.test01", "A.test01"); - assertOutputNotContaining("2nd run: should not run A.test05", "B.test05"); - assertOutputNotContaining("2nd run: should not run B.test06", "B.test06"); - assertOutputNotContaining("2nd run: should not run C.test07", "C.test07"); - assertOutputNotContaining("2nd run: should not run C.test08", "C.test08"); - assertOutputNotContaining("2nd run: should not run C.test09", "C.test09"); - // the failing test cases - assertOutputContaining("2nd run: should run A.test02", "A.test02"); - assertOutputContaining("2nd run: should run A.test03", "A.test03"); - assertOutputContaining("2nd run: should run B.test04", "B.test04"); - assertOutputContaining("2nd run: should run D.test10", "D.test10"); + // 2nd junit run: should do only failing tests + executeTarget("failureRecorder.runtest"); + assertTrue("The collector file '" + collectorFile.getAbsolutePath() + + "' should exist after the 2nd run.", + collectorFile.exists()); + // the passing test cases + assertOutputNotContaining("2nd run: should not run A.test01", + "A.test01"); + assertOutputNotContaining("2nd run: should not run A.test05", + "B.test05"); + assertOutputNotContaining("2nd run: should not run B.test06", + "B.test06"); + assertOutputNotContaining("2nd run: should not run C.test07", + "C.test07"); + assertOutputNotContaining("2nd run: should not run C.test08", + "C.test08"); + assertOutputNotContaining("2nd run: should not run C.test09", + "C.test09"); + // the failing test cases + assertOutputContaining("2nd run: should run A.test02", "A.test02"); + assertOutputContaining("2nd run: should run A.test03", "A.test03"); + assertOutputContaining("2nd run: should run B.test04", "B.test04"); + assertOutputContaining("2nd run: should run D.test10", "D.test10"); - // "fix" errors in class A - executeTarget("failureRecorder.fixing"); + // "fix" errors in class A + executeTarget("failureRecorder.fixing"); - // 3rd run: four running tests with two errors - executeTarget("failureRecorder.runtest"); - assertTrue("The collector file '" + collectorFile.getAbsolutePath() - + "' should exist after the 3rd run.", collectorFile.exists()); - assertOutputContaining("3rd run: should run A.test02", "A.test02"); - assertOutputContaining("3rd run: should run A.test03", "A.test03"); - assertOutputContaining("3rd run: should run B.test04", "B.test04"); - assertOutputContaining("3rd run: should run D.test10", "D.test10"); + // 3rd run: four running tests with two errors + executeTarget("failureRecorder.runtest"); + assertTrue("The collector file '" + collectorFile.getAbsolutePath() + + "' should exist after the 3rd run.", + collectorFile.exists()); + assertOutputContaining("3rd run: should run A.test02", "A.test02"); + assertOutputContaining("3rd run: should run A.test03", "A.test03"); + assertOutputContaining("3rd run: should run B.test04", "B.test04"); + assertOutputContaining("3rd run: should run D.test10", "D.test10"); - // 4rd run: two running tests with errors - executeTarget("failureRecorder.runtest"); - assertTrue("The collector file '" + collectorFile.getAbsolutePath() - + "' should exist after the 4th run.", collectorFile.exists()); - //TODO: these two statements fail - //assertOutputNotContaining("4th run: should not run A.test02", "A.test02"); - //assertOutputNotContaining("4th run: should not run A.test03", "A.test03"); - assertOutputContaining("4th run: should run B.test04", "B.test04"); - assertOutputContaining("4th run: should run D.test10", "D.test10"); + // 4rd run: two running tests with errors + executeTarget("failureRecorder.runtest"); + assertTrue("The collector file '" + collectorFile.getAbsolutePath() + + "' should exist after the 4th run.", + collectorFile.exists()); + //TODO: these two statements fail + //assertOutputNotContaining("4th run: should not run A.test02", "A.test02"); + //assertOutputNotContaining("4th run: should not run A.test03", "A.test03"); + assertOutputContaining("4th run: should run B.test04", "B.test04"); + assertOutputContaining("4th run: should run D.test10", "D.test10"); } catch (BuildException be) { be.printStackTrace(); System.err.println("nested build's log: " + getLog());