Don't treat inner classes as test classes with ant. master
authorW. Trevor King <wking@drexel.edu>
Fri, 7 Oct 2011 07:50:13 +0000 (03:50 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 7 Oct 2011 07:50:13 +0000 (03:50 -0400)
This had been causing errors like

    [junit] Testsuite: nom.tam.util.test.ArrayFuncsTest$CloneTest
    [junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.039 sec
    [junit]
    [junit] Testcase: initializationError(nom.tam.util.test.ArrayFuncsTest$CloneTest):  Caused an ERROR
    [junit] Test class should have exactly one public zero-argument constructor
    [junit] java.lang.Exception: Test class should have exactly one public zero-argument constructor
    [junit]     at java.lang.reflect.Constructor.newInstance(Constructor.java:532)

The fix follows a patch submitted by peter to the hamake project [1].

[1]: http://code.google.com/p/hamake/issues/detail?id=55

build.xml

index d3fbad20f8c6db2163effb914b1d1c34c450f6af..e0a290521189a824c104b39b84b41f2027fd5c4d 100644 (file)
--- a/build.xml
+++ b/build.xml
       <classpath refid="test.class.path"/>
       <formatter type="brief" usefile="false" />
       <batchtest>
       <classpath refid="test.class.path"/>
       <formatter type="brief" usefile="false" />
       <batchtest>
-        <fileset dir="${build}" includes="**/test/*.class" />
+        <fileset dir="${build}">
+         <include name="**/test/*.class" />
+         <exclude name="**/*$*.class" />
+       </fileset>
       </batchtest>
     </junit>
   </target>
       </batchtest>
     </junit>
   </target>