how to configure an ant to execute a class file?

J

junyoung

hi, I am questions to configure an ant to execute a class file.

okay, here is the file structures I have.

|-root --- src/test/A.java
| |
| --- classes/test/A.class
|- build.xml

$> cat A.java
package test;

......
.......

$>

inside of build.xml
.....
<target name="test">
<junit printsummary="yes" haltonfailure="yes">
<test name="test.A" haltonfailure="no" outfile="result">
<formatter type="plain"/>
</test>
</junit>
</target>
.....

to execute the target "test" normally, I have move my build.xml into
root/classes, not root/.

I am sure that you know already the reason.

so, Is there some ways to execute A.class in root directory, not root/
classes.

thanks u.
 
M

Mike Schilling

junyoung said:
hi, I am questions to configure an ant to execute a class file.

okay, here is the file structures I have.


$> cat A.java
package test;

.....
......

$>

inside of build.xml
....
<target name="test">
<junit printsummary="yes" haltonfailure="yes">
<test name="test.A" haltonfailure="no" outfile="result">
<formatter type="plain"/>
</test>
</junit>
</target>
....

to execute the target "test" normally, I have move my build.xml into
root/classes, not root/.

I am sure that you know already the reason.

so, Is there some ways to execute A.class in root directory, not root/
classes.

try
<junit ...>
<classpath>
<pathelement location="classes"/>
</classpath>
...
</junit>
 
J

junyoung

try
<junit ...>
<classpath>
<pathelement location="classes

classes"/>
</classpath>
...
</junit>

pathelement location is to indicate classpath locations. so, we have
to use pathelement path element for the correct purpose.

thanks mike.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top