| Author |
maven and Junit Tests
|
Krikor Krumlian
Greenhorn
Joined: Sep 24, 2004
Posts: 9
|
|
Hello everyone , using maven 1.0.2 and junit 3.8.1 machine MAC OSX So i am building this project using maven and i have a unit test that i'm trying to get it to work in maven but so far no luck my project.xml has this junit dependency defined and nothing else <!-- Junit for my unit testing --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <type>jar</type> <properties><war.bundle>false</war.bundle></properties> </dependency> as to the build part it goes as follows <build> <nagEmailAddress>krikor_krumlian@wgbh.org</nagEmailAddress> <sourceDirectory>src</sourceDirectory> <unitTestSourceDirectory>src/test</unitTestSourceDirectory> <!-- Unit test cases --> <unitTest> <includes> <include>**/*Test*.java</include> </includes> </unitTest> </build> So now building my app using the command maven test:test gives me the following __ __ | \/ |__ _Apache__ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0.2 build:start: java repare-filesystem: java:compile: [echo] Compiling to /Users/greg/Documents/sprnghibapp/target/classes java:jar-resources: test repare-filesystem: test:test-resources: test:compile: [javac] Compiling 1 source files to /Users/greg/Documents/sprnghibapp/target/test-classes test:test: [junit] Running KkTest [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec [junit] Testsuite: KkTest [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec [junit] [junit] Null Test: Caused an ERROR [junit] KkTest [junit] java.lang.ClassNotFoundException: KkTest [junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:199) [junit] at java.security.AccessController.doPrivileged(Native Method) [junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:187) [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:289) [junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:235) [junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) [junit] at java.lang.Class.forName0(Native Method) [junit] at java.lang.Class.forName(Class.java:141) [junit] Does anybody know what this is and what the problem is ? As you realized the test source files are compiling and are being copied to the target/test-classes which should happen and after that i get this null thing Any thoughts Thank you
|
 |
Kevin Hagel
Greenhorn
Joined: Feb 12, 2003
Posts: 1
|
|
|
Do you have any actual tests within kkTest?
|
 |
 |
|
|
subject: maven and Junit Tests
|
|
|