You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Joe Germuska <Jo...@Germuska.com> on 2003/03/06 23:29:19 UTC

[discovery] Tests Fail?

Hi:

I went to build the commons-discovery package out of CVS and I'm
finding a test failure in ...TestAll.testFindResources()

It doesn't seem like the test could pass, because it's expecting to
find a resource named "testResource" in three different locations,
but those locations are not on the test class path.  (They are in the
class path, but that means to the ClassLoader that there is no
"testResource" in the root of the classpath.)

I was able to get the tests to pass by adding some directories to the
Maven-generated build.xml file...  I might submit a patch, but I'm
not quite sure how one would make Maven aware of the requirement for
these additions to the test classpath.

Here's my change to the "internal-test" ant target.  When I run "ant
test" using this, the tests all pass.

   <target name="internal-test" depends="compile-tests">
     <mkdir dir="${testreportdir}">
     </mkdir>
     <junit dir="./" failureproperty="test.failure" printSummary="yes"
fork="true" haltonerror="true">
       <sysproperty key="basedir" value=".">
       </sysproperty>
       <formatter type="xml">
       </formatter>
       <formatter usefile="false" type="plain">
       </formatter>
       <classpath>
         <fileset dir="${libdir}">
           <include name="*.jar">
           </include>
         </fileset>
         <pathelement path="${testclassesdir}">
         </pathelement>
<!-- begin change here -->
         <pathelement path="${testclassesdir}/test">
         </pathelement>
         <pathelement path="${testclassesdir}/testAlt1">
         </pathelement>
         <pathelement path="${testclassesdir}/testAlt2">
         </pathelement>
<!-- end change here -->
         <pathelement path="${classesdir}">
         </pathelement>
       </classpath>
       <batchtest todir="${testreportdir}">
         <fileset dir="src/test">
           <include name="**/TestAll.java">
           </include>
         </fileset>
       </batchtest>
     </junit>
   </target>

-- 
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"If nature worked that way, the universe would crash all the time."
	--Jaron Lanier