Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 79131 invoked from network); 1 Oct 2000 22:22:00 -0000 Received: from uhura.concentric.net (206.173.118.93) by locus.apache.org with SMTP; 1 Oct 2000 22:22:00 -0000 Received: from marconi.concentric.net (marconi.concentric.net [206.173.118.71]) by uhura.concentric.net (8.9.1a/(98/12/15 5.12)) id SAA16399; Sun, 1 Oct 2000 18:21:34 -0400 (EDT) [1-800-745-2747 The Concentric Network] Errors-To: Received: from buji (ts001d14.sjc-ca.concentric.net [206.173.234.26]) by marconi.concentric.net (8.9.1a) id SAA29604; Sun, 1 Oct 2000 18:21:32 -0400 (EDT) Reply-To: From: "Erik Meade" To: Subject: [Patch] IntrospectionHelperTest.java Date: Sun, 1 Oct 2000 15:27:18 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <39D6D8C2.C69DBCEC@stonecottage.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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: but was: [junit] junit.framework.AssertionFailedError: expected: but was: [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 stefan.bodewig@megabit.net + * @author Stefan Bodewig stefan.bodewig@megabit.net */ 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)); } }