You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stou Sandalski <st...@icapsid.net> on 2003/10/06 03:44:26 UTC

Unit Test plug in doesn't use package name.

Hi,

Hi,

I have been trying to get maven to run the unit tests on my project, maven
test:test tries to launch the unit test by its class name as opposed to its
full package.class name, however the 'maven test:single' command runs the
test correctly.  I am probably not doing something right but its been two
days and I still can't figure it out, searched the mailing list and google,
with no luck.


Stou

P.S.

Here are the details:

The class to test is edu.ucdavis.fattyBean, and the test class is
edu.ucdavis.fattyBeanTest

Heres the output of 'maven test:test'

$ maven test:test
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc2-SNAPSHOT

java:prepare-filesystem:

java:compile:
    [echo] Compiling to /home/maven/projects/snook/target/classes
    [javac] Compiling 1 source file to
/home/maven/projects/snook/target/classes

...

test:compile:
    [javac] Compiling 1 source file to
/home/maven/projects/snook/target/test-classes

test:test:
    [junit] dir attribute ignored if running in the same VM
    [junit] Running fattyBeanTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] [ERROR] TEST fattyBeanTest FAILED
BUILD SUCCESSFUL
Total time: 8 seconds
Finished at: Sun Oct 05 18:31:20 PDT 2003

The above error is "ClassNotFound fattyBeanTest" exception.


Heres the output of 'maven test:single'

$ maven -Dtestcase=edu.ucdavis.fattyBeanTest test:single
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc2-SNAPSHOT

java:prepare-filesystem:

java:compile:
    [echo] Compiling to /home/maven/projects/snook/target/classes
    [javac] Compiling 1 source file to
/home/maven/projects/snook/target/classes

...

test:compile:
    [javac] Compiling 1 source file to
/home/maven/projects/snook/target/test-classes

test:single:
    [junit] dir attribute ignored if running in the same VM
    [junit] Running edu.ucdavis.fattyBeanTest
    [junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.105 sec
    [junit] Testsuite: edu.ucdavis.fattyBeanTest
    [junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.105 sec
    [junit] 
    [junit] Testcase: testDirEstrategias took 0.026 sec
    [junit] Testcase: testDirLN_activitie took 0 sec
    [junit] Testcase: testDirLS_Activities took 0.001 sec
    [junit] Testcase: testDirLengua took 0 sec
    [junit] Testcase: testDirMR_and_activities took 0.005 sec
    [junit] Testcase: testDirR_Activities took 0 sec
    [junit] Testcase: testDirSP_Activities took 0 sec
    [junit] Testcase: testDirW_Activities took 0 sec
BUILD SUCCESSFUL
Total time: 8 seconds
Finished at: Sun Oct 05 18:33:32 PDT 2003


>>> project.xml <<<<

<?xml version="1.0"?>
<project>
  <pomVersion>3</pomVersion>
  <name>Snook</name>
  <id>snook</id>
  <currentVersion>1.0a1</currentVersion>
  <organization>
    <name></name>
    <url></url>
  </organization>
  <inceptionYear>2003</inceptionYear>
  <package>edu.ucdavis</package>
  <shortDescription></shortDescription>
  <description></description>
  <build>
    <sourceDirectory>src/java</sourceDirectory>
    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
    <unitTest>
        <includes><include>**/*Test.java</include></includes>
    </unitTest>
  </build>
</project>
>>> end project.xml <<<<




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org