File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes WSAD 5/Ant/JUNIT problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WSAD 5/Ant/JUNIT problem" Watch "WSAD 5/Ant/JUNIT problem" New topic
Author

WSAD 5/Ant/JUNIT problem

mike wasserman
Greenhorn

Joined: Oct 04, 2001
Posts: 5
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSAD 5/Ant/JUNIT problem