• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSAD 5/Ant/JUNIT problem

 
mike wasserman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm want to use ant to run some JUNIT tests and generate reports for the tests.
I wrote the following build.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="junitTest" default="test">
<target name="init">
<property name="outdir" value="."/>
</target>
<target name="test" depends="init">
<junit printsummary="true" >
<!--<formatter type="plain" usefile="false" />-->
<formatter type="xml" />
<test name="com.aon.frameworktest.ServiceLocatorTest" />
<classpath>
<pathelement location="${outdir}" />
<pathelement path="${java.class.path}"/>
</classpath>
</junit>
<junitreport todir="./reports">
<fileset dir=".">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="./reports/html"/>
</junitreport>
</target>
</project>
It runs, but the tests all throw the same error.
It seems that my tests can't find a properties file I use in my code. I am developing with WSAD 5.
The error is:
.\properties\Framework.properties (The system cannot find the path specified)
java.io.FileNotFoundException: .\properties\Framework.properties (The system cannot find the path specified)
I refrence the properties file in my code based on my working directory, which I set properly in my External Tools configuration.
Is there something I need to pass to the Test class inside of Ant to get it to find the properties file? This runs fine with I don't use Ant and just run JUNIT directly within WSAD.
Anyone have any ideas?
Thanks
Mike
[ March 21, 2003: Message edited by: mike wasserman ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic