ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r473781 - in /ant/core/trunk/src/tests/junit/org/apache/tools: ant/IntrospectionHelperTest.java ant/taskdefs/ManifestTest.java ant/taskdefs/PropertyTest.java tar/TarRoundTripTest.java
Date Sat, 11 Nov 2006 19:45:21 GMT
Author: jkf
Date: Sat Nov 11 11:45:20 2006
New Revision: 473781

URL: http://svn.apache.org/viewvc?view=rev&rev=473781
Log:
Avoid JUNIT methods requiring java 1.4 or higher.

Modified:
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/tar/TarRoundTripTest.java

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java?view=diff&rev=473781&r1=473780&r2=473781
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java Sat Nov
11 11:45:20 2006
@@ -589,7 +589,8 @@
     }
 
     public void setNineteen(double d) {
-        assertEquals(19, d, 1e-6);
+        double diff = d - 19;
+        assertTrue("Expected 19, received " + d, diff > -1e-6 && diff < 1e-6);
     }
 
     public void testGetExtensionPoints() {

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java?view=diff&rev=473781&r1=473780&r2=473781
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java Sat Nov
11 11:45:20 2006
@@ -108,7 +108,7 @@
         executeTarget("test5");
         String output = getLog();
         boolean hasWarning = output.indexOf("Manifest warning: \"Name\" attributes should
not occur in the main section") != -1;
-        assertEquals("Expected warning about Name in main section", true, hasWarning);
+        assertTrue("Expected warning about Name in main section", hasWarning);
     }
 
     /**
@@ -119,7 +119,7 @@
                                        "Invalid Manifest");
         String output = getLog();
         boolean hasWarning = output.indexOf("Manifest sections should start with a \"Name\"
attribute") != -1;
-        assertEquals("Expected warning about section not starting with Name: attribute",
true, hasWarning);
+        assertTrue("Expected warning about section not starting with Name: attribute", hasWarning);
     }
 
     /**
@@ -129,7 +129,7 @@
         executeTarget("test7");
 
         boolean hasWarning = getLog().indexOf(Manifest.ERROR_FROM_FORBIDDEN) != -1;
-        assertEquals("Expected warning about From: attribute", true, hasWarning);
+        assertTrue("Expected warning about From: attribute", hasWarning);
     }
 
     /**

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java?view=diff&rev=473781&r1=473780&r2=473781
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java Sat Nov
11 11:45:20 2006
@@ -51,7 +51,7 @@
             executeTarget("test3");
         }
         catch (BuildException e) {
-            assertEquals("Circular definition not detected - ", true,
+            assertTrue("Circular definition not detected - ",
                      e.getMessage().indexOf("was circularly defined") != -1);
             return;
         }
@@ -85,7 +85,7 @@
             executeTarget("prefix.fail");
         }
         catch (BuildException e) {
-            assertEquals("Prefix allowed on non-resource/file load - ", true,
+            assertTrue("Prefix allowed on non-resource/file load - ", 
                      e.getMessage().indexOf("Prefix is only valid") != -1);
             return;
         }
@@ -96,7 +96,7 @@
         try {
             executeTarget("testCircularReference");
         } catch (BuildException e) {
-            assertEquals("Circular definition not detected - ", true,
+            assertTrue("Circular definition not detected - ",
                          e.getMessage().indexOf("was circularly defined")
                          != -1);
             return;

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/tar/TarRoundTripTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/tar/TarRoundTripTest.java?view=diff&rev=473781&r1=473780&r2=473781
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/tar/TarRoundTripTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/tar/TarRoundTripTest.java Sat Nov 11 11:45:20
2006
@@ -37,7 +37,7 @@
      */
     public void testLongRoundTripping() throws IOException {
         TarEntry original = new TarEntry(LONG_NAME);
-        assertEquals("over 100 chars", true, LONG_NAME.length() > 100);
+        assertTrue("over 100 chars", LONG_NAME.length() > 100);
         assertEquals("original name", LONG_NAME, original.getName());
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message