ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant IntrospectionHelperTest.java
Date Thu, 30 Sep 2004 09:27:07 GMT
bodewig     2004/09/30 02:27:07

  Modified:    src/testcases/org/apache/tools/ant
                        IntrospectionHelperTest.java
  Log:
  Make test pass on OS X
  
  Revision  Changes    Path
  1.24      +19 -9     ant/src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java
  
  Index: IntrospectionHelperTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- IntrospectionHelperTest.java	13 Sep 2004 13:26:32 -0000	1.23
  +++ IntrospectionHelperTest.java	30 Sep 2004 09:27:07 -0000	1.24
  @@ -594,16 +594,25 @@
   
       public void testGetExtensionPoints() {
           List extensions = ih.getExtensionPoints();
  -        assertEquals("extension count", 3, extensions.size());
  +        final int adders = 2;
  +        assertEquals("extension count", adders, extensions.size());
   
  -        assertExtMethod(extensions.get(0), "add", Number.class,
  -                        new Integer(2), new Integer(3));
  +        // this original test assumed something about the order of
  +        // add(Number) and addConfigured(Map) returned by reflection.
  +        // Unfortunately the assumption doesn't hold for all VMs
  +        // (failed on MacOS X using JDK 1.4.2_05) and the possible
  +        // combinatorics are too hard to check.  We really only want
  +        // to ensure that the more derived Hashtable can be found
  +        // before Map.
  +//        assertExtMethod(extensions.get(0), "add", Number.class,
  +//                        new Integer(2), new Integer(3));
   
           // addConfigured(Hashtable) should come before addConfigured(Map)
  -        assertExtMethod(extensions.get(1), "addConfigured", Hashtable.class,
  +        assertExtMethod(extensions.get(adders - 2),
  +                        "addConfigured", Hashtable.class,
                           makeTable("key", "value"), makeTable("1", "2"));
   
  -        assertExtMethod(extensions.get(2), "addConfigured", Map.class,
  +        assertExtMethod(extensions.get(adders - 1), "addConfigured", Map.class,
                           new HashMap(), makeTable("1", "2"));
       }
   
  @@ -644,10 +653,11 @@
           return null;
       }
   
  -    public void add(Number n) {
  -        // Valid extension point
  -        assertEquals(2, n.intValue());
  -    }
  +    // see comments in testGetExtensionPoints
  +//    public void add(Number n) {
  +//        // Valid extension point
  +//        assertEquals(2, n.intValue());
  +//    }
   
       public void add(List l, int i) {
           // INVALID extension point
  
  
  

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


Mime
View raw message