ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Meade" <eme...@geekfarm.org>
Subject [Patch] IntrospectionHelperTest.java
Date Sun, 01 Oct 2000 22:27:18 GMT
I checked Ant out of CVS today and executed "ant runtests" and got the
following
error:

    [junit] Testcase: testAttributeSetters took 0.02 sec
    [junit]     Caused an ERROR
    [junit] junit.framework.AssertionFailedError: expected:<c:\tmp\2> but
was:<e
:\tmp\2>
    [junit] junit.framework.AssertionFailedError: expected:<c:\tmp\2> but
was:<e
:\tmp\2>
    [junit]     at
org.apache.tools.ant.IntrospectionHelper.setAttribute(Introsp
ectionHelper.java:236)
    [junit]     at
org.apache.tools.ant.IntrospectionHelperTest.testAttributeSet
ters(IntrospectionHelperTest.java:302)
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:155)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:129)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:100)
    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:117)
    [junit]     at junit.framework.TestResult.run(TestResult.java:103)
    [junit]     at junit.framework.TestCase.run(TestCase.java:120)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:144)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java:185)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
main(JUnitTestRunner.java:309)
    [junit]

Obviously I am running Ant off of my e:\ drive, so here is a patch which
ignores
the drive letter for that test.  Did I create this patch correctly?  It
seems like
a lot of stuff when only one line was edited....

Erik Meade
----

Index: IntrospectionHelperTest.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/testcases/org/apache/tools/ant/Introspection
HelperTest.java,v
retrieving revision 1.3
diff -u -r1.3 IntrospectionHelperTest.java
--- IntrospectionHelperTest.java	2000/09/18 14:04:58	1.3
+++ IntrospectionHelperTest.java	2000/10/01 22:17:09
@@ -62,7 +62,7 @@
 /**
  * JUnit 3 testcases for org.apache.tools.ant.IntrospectionHelper.
  *
- * @author Stefan Bodewig <a
href="mailto:stefan.bodewig@megabit.net">stefan.bodewig@megabit.net</a>
+ * @author Stefan Bodewig <a
href="mailto:stefan.bodewig@megabit.net">stefan.bodewig@megabit.net</a>
  */

 public class IntrospectionHelperTest extends TestCase {
@@ -72,7 +72,7 @@
     public IntrospectionHelperTest(String name) {
         super(name);
     }
-
+
     public void testAddText() throws BuildException {
         IntrospectionHelper ih =
IntrospectionHelper.getHelper(java.lang.String.class);
         try {
@@ -95,14 +95,14 @@
         IntrospectionHelper ih =
IntrospectionHelper.getHelper(java.lang.String.class);
         assert("String doesn\'t support addText",
!ih.supportsCharacters());
         ih = IntrospectionHelper.getHelper(getClass());
-        assert("IntrospectionHelperTest supports addText",
+        assert("IntrospectionHelperTest supports addText",
                ih.supportsCharacters());
     }

     public void addText(String text) {
         assertEquals("test", text);
     }
-
+
     public void testElementCreators() throws BuildException {
         IntrospectionHelper ih = IntrospectionHelper.getHelper(getClass());
         try {
@@ -180,7 +180,7 @@
             assert(be.getException() instanceof NullPointerException);
         }
     }
-
+
     public void testGetNestedElements() {
         Hashtable h = new Hashtable();
         h.put("six", java.lang.String.class);
@@ -239,7 +239,7 @@
     public void addThirteen(StringBuffer sb) {
         sb.append("test");
     }
-
+
     public void addFourteen(StringBuffer s) {
         throw new NullPointerException();
     }
@@ -406,10 +406,10 @@
     }

     public void setTen(File f) {
-        if (isUnixStyle)

+        if (isUnixStyle) {
             assertEquals("/tmp/2", f.getAbsolutePath());
         } else {
-            assertEquals("c:\\tmp\\2", f.getAbsolutePath().toLowerCase());
+            assertEquals(":\\tmp\\2",
f.getAbsolutePath().toLowerCase().substring(1));
         }
     }



Mime
View raw message