diff options
author | Devan Goodwin <dgoodwin@rm-rf.ca> | 2009-11-02 09:27:57 -0400 |
---|---|---|
committer | Devan Goodwin <dgoodwin@rm-rf.ca> | 2009-11-02 09:27:57 -0400 |
commit | 760e9f2944de17e434a47cd86efa4bc6fb5946a1 (patch) | |
tree | 97f4ea3a30cd28c69bd0e187b7b226da3cc49411 | |
parent | 2ead550f93ae31a8d92ad14870d9553aaefc06d1 (diff) | |
download | cobbler-760e9f2944de17e434a47cd86efa4bc6fb5946a1.tar.gz cobbler-760e9f2944de17e434a47cd86efa4bc6fb5946a1.tar.xz cobbler-760e9f2944de17e434a47cd86efa4bc6fb5946a1.zip |
Start junit4 testing example.
Requires ant-junit and junit4 packages installed.
-rw-r--r-- | cobbler4j/build.xml | 28 | ||||
-rw-r--r-- | cobbler4j/src/org/fedorahosted/cobbler/FinderTests.java (renamed from cobbler4j/src/org/fedorahosted/cobbler/Test.java) | 10 |
2 files changed, 31 insertions, 7 deletions
diff --git a/cobbler4j/build.xml b/cobbler4j/build.xml index c6b3dc84..421328d8 100644 --- a/cobbler4j/build.xml +++ b/cobbler4j/build.xml @@ -1,13 +1,17 @@ <project default = "build"> + <target name="init"> - <path id="class.path"> - <pathelement location="build"/> - <fileset dir="lib"> - <include name="**/*.jar"/> - </fileset> + <path id="class.path"> + <pathelement location="build"/> + <fileset dir="lib"> + <include name="**/*.jar"/> + </fileset> + <fileset dir="/usr/share/java/"> + <include name="junit4.jar"/> + </fileset> </path> - </target> + <target name="build" depends="init"> <mkdir dir="build"/> <javac srcdir="." destdir="build" nowarn="true" classpathref="class.path"> @@ -20,9 +24,21 @@ </target> <target name="test" depends="build"> + <!-- <java classname="org.fedorahosted.cobbler.Test" fork="true" classpathref="class.path"> <arg value="http://192.168.1.1"/> </java> + --> + <junit printsummary="yes" haltonfailure="yes"> + <formatter type="xml"/> + <classpath refid="class.path"/> + <batchtest fork="yes" todir="build/"> + <fileset dir="src"> + <include name="**/*Test*.java"/> + </fileset> + </batchtest> + </junit> + </target> </project> diff --git a/cobbler4j/src/org/fedorahosted/cobbler/Test.java b/cobbler4j/src/org/fedorahosted/cobbler/FinderTests.java index 582b6d68..01971385 100644 --- a/cobbler4j/src/org/fedorahosted/cobbler/Test.java +++ b/cobbler4j/src/org/fedorahosted/cobbler/FinderTests.java @@ -1,12 +1,15 @@ package org.fedorahosted.cobbler; import java.util.List; +import org.junit.Test; +import static org.junit.Assert.*; -public class Test { +public class FinderTests { public static final String user = "testing"; public static final String pass = "testing"; + /* public static void main(String[] args) { if (args.length < 1) { @@ -19,5 +22,10 @@ public class Test { listItems(conn, ObjectType.DISTRO); System.out.println(distros.get(0)); } + */ + + @Test public void testSomething() { + assertTrue(true); + } } |