Discussion:
[castor-dev] mvn test runs all classes - even without test methods?
Peter Schmidt
2009-02-19 11:03:48 UTC
Permalink
Hi!

I created a couple of JUnit4 tests in the cpa module (JPA support for
Castor). JUnit4 is even used by MVN (according to stacktraces in
reports) as I added it to the pom locally.

Now my problem is, that I need a couple of classes defined to test -
nested classes and classes and "normal" ones, to test JPA processing
with. I Eclipse, JUnit runs perfectly. But using mvn, JUnit tries to run
the nested classes aswell - which is not possible because they are not
runnable! Right now I'm putting an @Ignore on every class that is not a
testcase but so to say a test-object or ressource. Is this really necessary?

Thanks in advance!

Cheers,
Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2009-02-19 11:22:28 UTC
Permalink
Peter,

assuming that this is about JUnit 4.x (as opposed to 3.8.x), I assume
that if you use a @Test annotation on a class or its methods, it looks
like all 'nested' or 'inner' classes are being analysed as well ....

Can you have a look at the 'maven-surefire-plugin' to see whether
there's any extra configuration items you could pass along. If not, I
could only recommend to ask a question on the maven user mailing list.

Werner
Post by Peter Schmidt
Hi!
I created a couple of JUnit4 tests in the cpa module (JPA support for
Castor). JUnit4 is even used by MVN (according to stacktraces in
reports) as I added it to the pom locally.
Now my problem is, that I need a couple of classes defined to test -
nested classes and classes and "normal" ones, to test JPA processing
with. I Eclipse, JUnit runs perfectly. But using mvn, JUnit tries to run
the nested classes aswell - which is not possible because they are not
testcase but so to say a test-object or ressource. Is this really necessary?
Thanks in advance!
Cheers,
Peter
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Ralf Joachim
2009-02-19 12:04:57 UTC
Permalink
Hi Peter,

do the classes that mvn tries to execute as junit test have the word
'test' in their name? Could you try what happens if you rename them?

Regards
Ralf
Post by Peter Schmidt
Hi!
I created a couple of JUnit4 tests in the cpa module (JPA support for
Castor). JUnit4 is even used by MVN (according to stacktraces in
reports) as I added it to the pom locally.
Now my problem is, that I need a couple of classes defined to test -
nested classes and classes and "normal" ones, to test JPA processing
with. I Eclipse, JUnit runs perfectly. But using mvn, JUnit tries to
run the nested classes aswell - which is not possible because they are
not a testcase but so to say a test-object or ressource. Is this
really necessary?
Thanks in advance!
Cheers,
Peter
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Syscon Ingenieurbüro für Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
72127 Kusterdingen
Germany

Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98

Internet: www.syscon.eu
E-Mail: ***@syscon.eu

Sitz der Gesellschaft: D-72127 Kusterdingen
Registereintrag: Amtsgericht Stuttgart, HRB 382295
Geschäftsleitung: Jens Joachim, Ralf Joachim


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Peter Schmidt
2009-02-19 12:51:56 UTC
Permalink
Hi Ralf!

I renamed the classes, but that did not change a thing.

By now, it works with @Ignore, but that is quite annoying.

I'll check how to configure surefire/maven test later.

Cheers,
Peter
Post by Ralf Joachim
Hi Peter,
do the classes that mvn tries to execute as junit test have the word
'test' in their name? Could you try what happens if you rename them?
Regards
Ralf
Post by Peter Schmidt
Hi!
I created a couple of JUnit4 tests in the cpa module (JPA support for
Castor). JUnit4 is even used by MVN (according to stacktraces in
reports) as I added it to the pom locally.
Now my problem is, that I need a couple of classes defined to test -
nested classes and classes and "normal" ones, to test JPA processing
with. I Eclipse, JUnit runs perfectly. But using mvn, JUnit tries to
run the nested classes aswell - which is not possible because they are
not a testcase but so to say a test-object or ressource. Is this
really necessary?
Thanks in advance!
Cheers,
Peter
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...