right i'm doing an assignment for college - for an optional subject i didn't want to pick as i had three subjects and had to pick two - and i can't get my head around it.
basically the assignment is to find bugs in a java project in eclipse using Junit tests. This i found was the easier bit of the assignment, but i'm having problems when it comes to using Ant.
we were only shown one lecture in ant and that was how to creat a build.xml file that would compile files from a single directory.
but now in this assignment we are asked to do this.
the directory structure of my project so far is this.
now i have a build.xml file in the /assignment folder, that has the following in it.
now the first target compiles perfectly and generates the .class files for whatever is in .\src\seke\assign\ but it fails to compile the second target of the unit tests. it can't seem to find the other classes from the java program that's needed in the junit tests.
anyone know what's going on? please just a note, i'm a honest to god newbie at this so take it easy on me. also anyone got any tips on how i'd go about doing any of the other requirements of the build file per the assignment?
basically the assignment is to find bugs in a java project in eclipse using Junit tests. This i found was the easier bit of the assignment, but i'm having problems when it comes to using Ant.
we were only shown one lecture in ant and that was how to creat a build.xml file that would compile files from a single directory.
but now in this assignment we are asked to do this.
You should create an Ant build file for your project which will include targets to do at least the following:
* Compile all files required
* Compile all tests required
* Create a jar of application classes built which allows the application to be executed from that jar
* Create a jar of test classes built which allows the tests to be executed from that jar
* Run junit tests created and record the results of your junit tests in a file called serverresults.xml
* Use properties to refer to the structure of your project
You should include additional targets if you think you need them. You should comment your build file adequately explaining any choices of arguments and parameters provided for tasks.
This build file should work within Eclipse and from the command prompt.
the directory structure of my project so far is this.
Code:
/assignment
/bin //stores the .class files.
/seke/assign
/test //stores the .class junit test files.
/lib //stores junit.jar
/src //stores the .java source files.
/unittests //stores the junit test source files.
now i have a build.xml file in the /assignment folder, that has the following in it.
Code:
<project name="CoffeeMaker" default="compile_test">
<property name="src" value = ".\src\seke\assign" />
<property name="unitsrc" value=".\unittests\seke\assign\test" />
<target name="compile_src" description="Compile the source files">
<javac srcdir="${src}" />
</target>
<target name="compile_test" description="Compile the junit test files" depends="compile_src">
<javac srcdir="${unitsrc}"/>
</target>
</project>
now the first target compiles perfectly and generates the .class files for whatever is in .\src\seke\assign\ but it fails to compile the second target of the unit tests. it can't seem to find the other classes from the java program that's needed in the junit tests.
anyone know what's going on? please just a note, i'm a honest to god newbie at this so take it easy on me. also anyone got any tips on how i'd go about doing any of the other requirements of the build file per the assignment?