ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Cooper <>
Subject JUnit task : getResourceAsStream problems
Date Thu, 22 Mar 2001 23:47:30 GMT
I am using ant 1.3 junit 3.5 and  sun jdk 1.3 for linux. If i use the junit 
task to run a test under ant, the code cannot load the resource I specify - I 
just get null returned from ...

	    System.out.println("System classloader");


	ClassLoader classLoader = Thread.currentThread()
	    System.out.println(" classloader="+classLoader);

If i run the unit test from the command line with something like...

java -cp ../build/classes:../build/test/classes/:lib/junit.jar...etc... 
junit.textui.TestRunner MyTest

then the system classloader works and finds the resource (although I cannot 
get the current Thread's class loader to work).

In case its relevant, I am trying to load the resource in a static code
that gets run when my class loads.

Can anyone help???

Thanks, Matty.

View raw message