File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

WSAD 5/Ant/JUNIT problem

mike wasserman

Joined: Oct 04, 2001
Posts: 5
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 name="test" depends="init">
<junit printsummary="true" >
<!--<formatter type="plain" usefile="false" />-->
<formatter type="xml" />
<test name="com.aon.frameworktest.ServiceLocatorTest" />
<pathelement location="${outdir}" />
<pathelement path="${java.class.path}"/>
<junitreport todir="./reports">
<fileset dir=".">
<include name="TEST-*.xml" />
<report format="frames" todir="./reports/html"/>
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\ (The system cannot find the path specified) .\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?
[ March 21, 2003: Message edited by: mike wasserman ]
I agree. Here's the link:
subject: WSAD 5/Ant/JUNIT problem
It's not a secret anymore!