Statically import string contains assertions Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/cdb0348e Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/cdb0348e Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/cdb0348e
Branch: refs/heads/master Commit: cdb0348e9dbdd4a65673dfc1775995539cff9521 Parents: 4a24281 Author: Gintas Grigelionis <gin...@apache.org> Authored: Wed Apr 4 15:27:06 2018 +0200 Committer: Gintas Grigelionis <gin...@apache.org> Committed: Wed Apr 4 15:27:06 2018 +0200 ---------------------------------------------------------------------- .../tools/ant/taskdefs/AbstractCvsTaskTest.java | 6 +++--- .../org/apache/tools/ant/taskdefs/AntTest.java | 10 ++++----- .../tools/ant/taskdefs/CallTargetTest.java | 6 +++--- .../apache/tools/ant/taskdefs/FixCrLfTest.java | 4 ++-- .../org/apache/tools/ant/taskdefs/GetTest.java | 15 ++++++------- .../tools/ant/taskdefs/RmicAdvancedTest.java | 4 ++-- .../taskdefs/condition/IsFileSelectedTest.java | 6 +++--- .../ant/taskdefs/condition/IsReachableTest.java | 6 +++--- .../ant/taskdefs/condition/TypeFoundTest.java | 6 +++--- .../taskdefs/optional/SchemaValidateTest.java | 12 +++++------ .../ant/taskdefs/optional/image/ImageTest.java | 18 ++++++++-------- .../taskdefs/optional/jdepend/JDependTest.java | 15 ++++++------- .../org/apache/tools/ant/types/AddTypeTest.java | 22 ++++++++++---------- .../org/apache/tools/ant/types/PolyTest.java | 11 +++++----- .../tools/ant/types/RedirectorElementTest.java | 4 ++-- .../types/selectors/ModifiedSelectorTest.java | 4 ++-- 16 files changed, 76 insertions(+), 73 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java index 39aed26..1f5ceea 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java @@ -17,7 +17,6 @@ */ package org.apache.tools.ant.taskdefs; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildFileRule; import org.junit.After; import org.junit.Before; @@ -26,6 +25,7 @@ import org.junit.Test; import java.io.File; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -57,7 +57,7 @@ public class AbstractCvsTaskTest { File f = new File(buildRule.getProject().getProperty("output") + "/src/Makefile"); assertFalse("starting empty", f.exists()); buildRule.executeTarget("package-attribute"); - AntAssert.assertContains("U src/Makefile", buildRule.getLog()); + assertContains("U src/Makefile", buildRule.getLog()); assertTrue("now it is there", f.exists()); } @@ -66,7 +66,7 @@ public class AbstractCvsTaskTest { File f = new File(buildRule.getProject().getProperty("output") + "/src/Makefile"); assertFalse("starting empty", f.exists()); buildRule.executeTarget("tag-attribute"); - AntAssert.assertContains("OPENBSD_5_3", buildRule.getLog()); + assertContains("OPENBSD_5_3", buildRule.getLog()); assertTrue("now it is there", f.exists()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java index 86049f8..9b93c77 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java @@ -22,7 +22,6 @@ import java.io.File; import junit.framework.AssertionFailedError; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; @@ -35,6 +34,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -290,7 +290,7 @@ public class AntTest { buildRule.getProject().setUserProperty("test", "7"); buildRule.executeTarget("test-property-override-inheritall-start"); - AntAssert.assertContains("The value of test is 7", buildRule.getLog()); + assertContains("The value of test is 7", buildRule.getLog()); } @Test @@ -298,20 +298,20 @@ public class AntTest { buildRule.getProject().setUserProperty("test", "7"); buildRule.executeTarget("test-property-override-no-inheritall-start"); - AntAssert.assertContains("The value of test is 7", buildRule.getLog()); + assertContains("The value of test is 7", buildRule.getLog()); } @Test public void testOverrideWinsInheritAll() { buildRule.executeTarget("test-property-override-inheritall-start"); - AntAssert.assertContains("The value of test is 4", buildRule.getLog()); + assertContains("The value of test is 4", buildRule.getLog()); } @Test public void testOverrideWinsNoInheritAll() { buildRule.executeTarget("test-property-override-no-inheritall-start"); - AntAssert.assertContains("The value of test is 4", buildRule.getLog()); + assertContains("The value of test is 4", buildRule.getLog()); } @Test http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/CallTargetTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/CallTargetTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/CallTargetTest.java index 98f041f..6100d06 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/CallTargetTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/CallTargetTest.java @@ -18,7 +18,6 @@ package org.apache.tools.ant.taskdefs; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; @@ -27,6 +26,7 @@ import org.junit.Test; import java.util.Vector; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -47,7 +47,7 @@ public class CallTargetTest { @Test public void testInheritRefFileSet() { buildRule.executeTarget("testinheritreffileset"); - AntAssert.assertContains("calltarget.xml", buildRule.getLog()); + assertContains("calltarget.xml", buildRule.getLog()); } // see bugrep 21724 (references not passing through with antcall) @@ -64,7 +64,7 @@ public class CallTargetTest { v.add("call-multi"); v.add("call-multi"); buildRule.getProject().executeTargets(v); - AntAssert.assertContains("multi is SETmulti is SET", buildRule.getLog()); + assertContains("multi is SETmulti is SET", buildRule.getLog()); } @Test http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java index 7ba5556..48f1fd4 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java @@ -26,13 +26,13 @@ import java.io.InputStream; import junit.framework.AssertionFailedError; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -154,7 +154,7 @@ public class FixCrLfTest { buildRule.executeTarget("testFixFileExclusive"); fail(FixCRLF.ERROR_FILE_AND_SRCDIR); } catch (BuildException ex) { - AntAssert.assertContains(FixCRLF.ERROR_FILE_AND_SRCDIR, ex.getMessage()); + assertContains(FixCRLF.ERROR_FILE_AND_SRCDIR, ex.getMessage()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java index fb78937..f079adb 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java @@ -18,7 +18,6 @@ package org.apache.tools.ant.taskdefs; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.After; @@ -26,6 +25,8 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; +import static org.apache.tools.ant.AntAssert.assertNotContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -105,7 +106,7 @@ public class GetTest { public void test7() { try { buildRule.executeTarget("test7"); - AntAssert.assertNotContains("Adding header", buildRule.getLog()); + assertNotContains("Adding header", buildRule.getLog()); fail("userAgent may not be null or empty"); } catch (BuildException ex) { @@ -127,21 +128,21 @@ public class GetTest { public void testTwoHeadersAreAddedOK() { buildRule.executeTarget("testTwoHeadersAreAddedOK"); String log = buildRule.getLog(); - AntAssert.assertContains("Adding header 'header1'", log); - AntAssert.assertContains("Adding header 'header2'", log); + assertContains("Adding header 'header1'", log); + assertContains("Adding header 'header2'", log); } @Test public void testEmptyHeadersAreNeverAdded() { buildRule.executeTarget("testEmptyHeadersAreNeverAdded"); - AntAssert.assertNotContains("Adding header", buildRule.getLog()); + assertNotContains("Adding header", buildRule.getLog()); } @Test public void testThatWhenMoreThanOneHeaderHaveSameNameOnlyLastOneIsAdded() { buildRule.executeTarget("testThatWhenMoreThanOneHeaderHaveSameNameOnlyLastOneIsAdded"); String log = buildRule.getLog(); - AntAssert.assertContains("Adding header 'header1'", log); + assertContains("Adding header 'header1'", log); int actualHeaderCount = log.split("Adding header ").length - 1; @@ -151,7 +152,7 @@ public class GetTest { @Test public void testHeaderSpaceTrimmed() { buildRule.executeTarget("testHeaderSpaceTrimmed"); - AntAssert.assertContains("Adding header 'header1'", buildRule.getLog()); + assertContains("Adding header 'header1'", buildRule.getLog()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java index 8ce0cbe..490ce9f 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java @@ -19,7 +19,6 @@ package org.apache.tools.ant.taskdefs; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; @@ -31,6 +30,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; @@ -236,7 +236,7 @@ public class RmicAdvancedTest { buildRule.executeTarget("testDefaultBadClass"); } finally { // don't look for much text here as it is vendor and version dependent - AntAssert.assertContains("unimplemented.class", buildRule.getLog()); + assertContains("unimplemented.class", buildRule.getLog()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsFileSelectedTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsFileSelectedTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsFileSelectedTest.java index 84d88a5..10049fc 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsFileSelectedTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsFileSelectedTest.java @@ -18,13 +18,13 @@ package org.apache.tools.ant.taskdefs.condition; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.fail; /** @@ -66,8 +66,8 @@ public class IsFileSelectedTest { try { buildRule.executeTarget("not.selector"); fail("Exception should have been thrown: checking for use as a selector (not allowed)"); - } catch(BuildException ex) { - AntAssert.assertContains("fileset doesn't support the nested \"isfile", + } catch (BuildException ex) { + assertContains("fileset doesn't support the nested \"isfile", ex.getMessage()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java index 6ddf26f..87e3712 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java @@ -17,7 +17,6 @@ */ package org.apache.tools.ant.taskdefs.condition; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; @@ -25,6 +24,7 @@ import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -108,8 +108,8 @@ public class IsReachableTest { try { buildRule.executeTarget("testBadURL"); fail("Build exception expected: error in URL"); - } catch(BuildException ex) { - AntAssert.assertContains(IsReachable.ERROR_BAD_URL, ex.getMessage()); + } catch (BuildException ex) { + assertContains(IsReachable.ERROR_BAD_URL, ex.getMessage()); } } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java index 6c73188..45df9a8 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/TypeFoundTest.java @@ -17,13 +17,13 @@ */ package org.apache.tools.ant.taskdefs.condition; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.junit.Assert.assertNull; @@ -52,8 +52,8 @@ public class TypeFoundTest { try { buildRule.executeTarget("testUndefined"); fail("Build exception expected: left out the name attribute"); - } catch(BuildException ex) { - AntAssert.assertContains("No type specified", ex.getMessage()); + } catch (BuildException ex) { + assertContains("No type specified", ex.getMessage()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java index 12443f9..81215c8 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java @@ -17,13 +17,13 @@ */ package org.apache.tools.ant.taskdefs.optional; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.fail; /** @@ -67,7 +67,7 @@ public class SchemaValidateTest { buildRule.executeTarget("testNoEmptySchemaNamespace"); fail("Empty namespace URI"); } catch (BuildException ex) { - AntAssert.assertContains(SchemaValidate.SchemaLocation.ERROR_NO_URI, ex.getMessage()); + assertContains(SchemaValidate.SchemaLocation.ERROR_NO_URI, ex.getMessage()); } } @@ -77,7 +77,7 @@ public class SchemaValidateTest { buildRule.executeTarget("testNoEmptySchemaLocation"); fail("Empty schema location"); } catch (BuildException ex) { - AntAssert.assertContains(SchemaValidate.SchemaLocation.ERROR_NO_LOCATION, + assertContains(SchemaValidate.SchemaLocation.ERROR_NO_LOCATION, ex.getMessage()); } } @@ -88,7 +88,7 @@ public class SchemaValidateTest { buildRule.executeTarget("testNoFile"); fail("No file at file attribute"); } catch (BuildException ex) { - AntAssert.assertContains(SchemaValidate.SchemaLocation.ERROR_NO_FILE, + assertContains(SchemaValidate.SchemaLocation.ERROR_NO_FILE, ex.getMessage()); } } @@ -99,7 +99,7 @@ public class SchemaValidateTest { buildRule.executeTarget("testNoDoubleSchemaLocation"); fail("Two locations for schemas"); } catch (BuildException ex) { - AntAssert.assertContains(SchemaValidate.SchemaLocation.ERROR_TWO_LOCATIONS, + assertContains(SchemaValidate.SchemaLocation.ERROR_TWO_LOCATIONS, ex.getMessage()); } } @@ -110,7 +110,7 @@ public class SchemaValidateTest { buildRule.executeTarget("testNoDuplicateSchema"); fail("duplicate schemas with different values"); } catch (BuildException ex) { - AntAssert.assertContains(SchemaValidate.ERROR_DUPLICATE_SCHEMA, + assertContains(SchemaValidate.ERROR_DUPLICATE_SCHEMA, ex.getMessage()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java index 7acd062..ac1c27c 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java @@ -18,7 +18,6 @@ package org.apache.tools.ant.taskdefs.optional.image; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.util.FileUtils; import org.apache.tools.ant.util.JavaEnvUtils; @@ -29,6 +28,7 @@ import org.junit.Test; import java.io.File; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeFalse; @@ -60,13 +60,13 @@ public class ImageTest { @Test public void testEchoToLog() { buildRule.executeTarget("testEchoToLog"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); } @Test public void testSimpleScale() { buildRule.executeTarget("testSimpleScale"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); File f = new File(buildRule.getOutputDir(), LARGEIMAGE); assertTrue("Did not create " + f.getAbsolutePath(), f.exists()); @@ -75,13 +75,13 @@ public class ImageTest { @Test public void testOverwriteTrue() { buildRule.executeTarget("testSimpleScale"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); File f = new File(buildRule.getOutputDir(), LARGEIMAGE); assumeTrue("Could not change file modification date", f.setLastModified(f.lastModified() - FILE_UTILS.getFileTimestampGranularity() * 2)); long lastModified = f.lastModified(); buildRule.executeTarget("testOverwriteTrue"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); f = new File(buildRule.getOutputDir(), LARGEIMAGE); long overwrittenLastModified = f.lastModified(); assertTrue("File was not overwritten.", lastModified < overwrittenLastModified); @@ -90,11 +90,11 @@ public class ImageTest { @Test public void testOverwriteFalse() { buildRule.executeTarget("testSimpleScale"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); File f = new File(buildRule.getOutputDir(), LARGEIMAGE); long lastModified = f.lastModified(); buildRule.executeTarget("testOverwriteFalse"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); f = new File(buildRule.getOutputDir(), LARGEIMAGE); long overwrittenLastModified = f.lastModified(); assertEquals("File was overwritten.", lastModified, overwrittenLastModified); @@ -103,7 +103,7 @@ public class ImageTest { @Test public void testSimpleScaleWithMapper() { buildRule.executeTarget("testSimpleScaleWithMapper"); - AntAssert.assertContains("Processing File", buildRule.getLog()); + assertContains("Processing File", buildRule.getLog()); File f = new File(buildRule.getOutputDir(), "scaled-" + LARGEIMAGE); assertTrue("Did not create " + f.getAbsolutePath(), f.exists()); } @@ -113,7 +113,7 @@ public class ImageTest { public void testFailOnError() { try { buildRule.executeTarget("testFailOnError"); - AntAssert.assertContains("Unable to process image stream", buildRule.getLog()); + assertContains("Unable to process image stream", buildRule.getLog()); } catch (RuntimeException re) { assertTrue("Run time exception should say 'Unable to process image stream'. :" + re.toString(), http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java index df4dccd..5728e92 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java @@ -18,12 +18,13 @@ package org.apache.tools.ant.taskdefs.optional.jdepend; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildFileRule; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; + /** * Testcase for the JDepend optional task. * @@ -45,7 +46,7 @@ public class JDependTest { @Test public void testSimple() { buildRule.executeTarget("simple"); - AntAssert.assertContains("Package: org.apache.tools.ant.util.facade", + assertContains("Package: org.apache.tools.ant.util.facade", buildRule.getOutput()); } @@ -55,7 +56,7 @@ public class JDependTest { @Test public void testXml() { buildRule.executeTarget("xml"); - AntAssert.assertContains("<DependsUpon>", buildRule.getOutput()); + assertContains("<DependsUpon>", buildRule.getOutput()); } /** @@ -65,7 +66,7 @@ public class JDependTest { @Test public void testFork() { buildRule.executeTarget("fork"); - AntAssert.assertContains("Package: org.apache.tools.ant.util.facade", buildRule.getLog()); + assertContains("Package: org.apache.tools.ant.util.facade", buildRule.getLog()); } /** @@ -74,7 +75,7 @@ public class JDependTest { @Test public void testForkXml() { buildRule.executeTarget("fork-xml"); - AntAssert.assertContains("<DependsUpon>", buildRule.getLog()); + assertContains("<DependsUpon>", buildRule.getLog()); } /** @@ -83,7 +84,7 @@ public class JDependTest { @Test public void testTimeout() { buildRule.executeTarget("fork-xml"); - AntAssert.assertContains("JDepend FAILED - Timed out", buildRule.getLog()); + assertContains("JDepend FAILED - Timed out", buildRule.getLog()); } @@ -93,7 +94,7 @@ public class JDependTest { @Test public void testTimeoutNot() { buildRule.executeTarget("fork-timeout-not"); - AntAssert.assertContains("Package: org.apache.tools.ant.util.facade", buildRule.getLog()); + assertContains("Package: org.apache.tools.ant.util.facade", buildRule.getLog()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/types/AddTypeTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/types/AddTypeTest.java b/src/tests/junit/org/apache/tools/ant/types/AddTypeTest.java index 6dfbcf6..bebf627 100644 --- a/src/tests/junit/org/apache/tools/ant/types/AddTypeTest.java +++ b/src/tests/junit/org/apache/tools/ant/types/AddTypeTest.java @@ -18,7 +18,6 @@ package org.apache.tools.ant.types; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; @@ -28,6 +27,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.fail; public class AddTypeTest { @@ -63,19 +63,19 @@ public class AddTypeTest { @Test public void testNestedA() { buildRule.executeTarget("nested.a"); - AntAssert.assertContains("add A called", buildRule.getLog()); + assertContains("add A called", buildRule.getLog()); } @Test public void testNestedB() { buildRule.executeTarget("nested.b"); - AntAssert.assertContains("add B called", buildRule.getLog()); + assertContains("add B called", buildRule.getLog()); } @Test public void testNestedC() { buildRule.executeTarget("nested.c"); - AntAssert.assertContains("add C called", buildRule.getLog()); + assertContains("add C called", buildRule.getLog()); } @Test @@ -84,26 +84,26 @@ public class AddTypeTest { buildRule.executeTarget("nested.ab"); fail("Build exception expected: Should have got ambiguous"); } catch (BuildException ex) { - AntAssert.assertContains("ambiguous", ex.getMessage()); + assertContains("ambiguous", ex.getMessage()); } } @Test public void testConditionType() { buildRule.executeTarget("condition.type"); - AntAssert.assertContains("beforeafter", buildRule.getLog()); + assertContains("beforeafter", buildRule.getLog()); } @Test public void testConditionTask() { buildRule.executeTarget("condition.task"); - AntAssert.assertContains("My Condition execution", buildRule.getLog()); + assertContains("My Condition execution", buildRule.getLog()); } @Test public void testConditionConditionType() { buildRule.executeTarget("condition.condition.type"); - AntAssert.assertContains("My Condition eval", buildRule.getLog()); + assertContains("My Condition eval", buildRule.getLog()); } @Test @@ -112,21 +112,21 @@ public class AddTypeTest { buildRule.executeTarget("condition.condition.task"); fail("Build exception expected: Task masking condition"); } catch (BuildException ex) { - AntAssert.assertContains("doesn't support the nested", ex.getMessage()); + assertContains("doesn't support the nested", ex.getMessage()); } } @Test public void testAddConfigured() { buildRule.executeTarget("myaddconfigured"); - AntAssert.assertContains("value is Value Setexecute: value is Value Set", + assertContains("value is Value Setexecute: value is Value Set", buildRule.getLog()); } @Test public void testAddConfiguredValue() { buildRule.executeTarget("myaddconfiguredvalue"); - AntAssert.assertContains("value is Value Setexecute: value is Value Set", + assertContains("value is Value Setexecute: value is Value Set", buildRule.getLog()); } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/types/PolyTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/types/PolyTest.java b/src/tests/junit/org/apache/tools/ant/types/PolyTest.java index 73ffff4..f0589f1 100644 --- a/src/tests/junit/org/apache/tools/ant/types/PolyTest.java +++ b/src/tests/junit/org/apache/tools/ant/types/PolyTest.java @@ -18,7 +18,6 @@ package org.apache.tools.ant.types; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; @@ -26,6 +25,8 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; + public class PolyTest { @Rule @@ -39,25 +40,25 @@ public class PolyTest { @Test public void testFileSet() { buildRule.executeTarget("fileset"); - AntAssert.assertContains("types.FileSet", buildRule.getLog()); + assertContains("types.FileSet", buildRule.getLog()); } @Test public void testFileSetAntType() { buildRule.executeTarget("fileset-ant-type"); - AntAssert.assertContains("types.PolyTest$MyFileSet", buildRule.getLog()); + assertContains("types.PolyTest$MyFileSet", buildRule.getLog()); } @Test public void testPath() { buildRule.executeTarget("path"); - AntAssert.assertContains("types.Path", buildRule.getLog()); + assertContains("types.Path", buildRule.getLog()); } @Test public void testPathAntType() { buildRule.executeTarget("path-ant-type"); - AntAssert.assertContains("types.PolyTest$MyPath", buildRule.getLog()); + assertContains("types.PolyTest$MyPath", buildRule.getLog()); } public static class MyFileSet extends FileSet { http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/types/RedirectorElementTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/types/RedirectorElementTest.java b/src/tests/junit/org/apache/tools/ant/types/RedirectorElementTest.java index 1d2ccf7..0b10e33 100644 --- a/src/tests/junit/org/apache/tools/ant/types/RedirectorElementTest.java +++ b/src/tests/junit/org/apache/tools/ant/types/RedirectorElementTest.java @@ -17,7 +17,6 @@ */ package org.apache.tools.ant.types; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.Project; @@ -25,6 +24,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -74,7 +74,7 @@ public class RedirectorElementTest { public void testLogInputString() { buildRule.executeTarget("testLogInputString"); if (buildRule.getLog().contains("testLogInputString can-cat")) { - AntAssert.assertContains("Using input string", buildRule.getFullLog()); + assertContains("Using input string", buildRule.getFullLog()); } } http://git-wip-us.apache.org/repos/asf/ant/blob/cdb0348e/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java index fb511b0..f8c8e6c 100644 --- a/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java +++ b/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java @@ -24,7 +24,6 @@ import java.text.RuleBasedCollator; import java.util.Comparator; import java.util.Iterator; -import org.apache.tools.ant.AntAssert; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildFileRule; import org.apache.tools.ant.Project; @@ -47,6 +46,7 @@ import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; +import static org.apache.tools.ant.AntAssert.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; @@ -569,7 +569,7 @@ public class ModifiedSelectorTest { public void testResourceSelectorSelresTrue() { BFT bft = new BFT(); bft.doTarget("modifiedselectortest-ResourceSelresTrue"); - AntAssert.assertContains("does not provide an InputStream", bft.getLog()); + assertContains("does not provide an InputStream", bft.getLog()); bft.deleteCachefile(); }