You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Deck <mi...@Valtech.com> on 2005/10/05 16:03:08 UTC

[m2] Surefire doesn't discover new tests

I've just installed Maven 2.0 beta-3 and I'm walking through some simple exercises to get a feel for the app.  I've used the archetype plugin to create a simple java project and it seems to build fine.  However, if I add another test class to the src/test/java directory m2 doesn't seem to detect the new test.  When I run m2 test this is the out put I get:
 
[INFO] [compiler:testCompile]
Compiling 2 source files to C:\sandbox\eclipse\Roberto\Maven2\my-app\target\test
-classes
[INFO] [surefire:test]
[INFO] Setting reports dir: C:\sandbox\eclipse\Roberto\Maven2\my-app\target/sure
fire-reports
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
[surefire] Running com.mycompany.app.AppTest
[surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0 sec
 
 
What's interesting is that 2 classes are compiled, but only 1 of the tests is run.  Has anyone else experienced this behavior?  Am I doning something wrong, or is this the expected behavior?
 
 
Thanks in advance,
 
Mike

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


Re: [m2] Surefire doesn't discover new tests

Posted by Jason van Zyl <ja...@maven.org>.
On Wed, 2005-10-05 at 11:53 -0400, Daniel Krisher wrote:
> I believe that the surefire plugin only includes classes with names
> ending in "Test" by default.  If this is your problem, you can modify
> this behavior with a <configuration> section for the surefire
> plugin...

The defaults are as follows now:

includes = new ArrayList( Arrays.asList( new String[] { "**/Test*.java", "**/*Test.java", "**/*TestCase.java" } ) );

> Dan
> 
> On 10/5/05, Michael Deck <mi...@valtech.com> wrote:
> > I've just installed Maven 2.0 beta-3 and I'm walking through some simple exercises to get a feel for the app.  I've used the archetype plugin to create a simple java project and it seems to build fine.  However, if I add another test class to the src/test/java directory m2 doesn't seem to detect the new test.  When I run m2 test this is the out put I get:
> >
> > [INFO] [compiler:testCompile]
> > Compiling 2 source files to C:\sandbox\eclipse\Roberto\Maven2\my-app\target\test
> > -classes
> > [INFO] [surefire:test]
> > [INFO] Setting reports dir: C:\sandbox\eclipse\Roberto\Maven2\my-app\target/sure
> > fire-reports
> > -------------------------------------------------------
> >  T E S T S
> > -------------------------------------------------------
> > [surefire] Running com.mycompany.app.AppTest
> > [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0 sec
> >
> >
> > What's interesting is that 2 classes are compiled, but only 1 of the tests is run.  Has anyone else experienced this behavior?  Am I doning something wrong, or is this the expected behavior?
> >
> >
> > Thanks in advance,
> >
> > Mike
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 
> 
> --
> Daniel Krisher
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



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


Re: [m2] Surefire doesn't discover new tests

Posted by Daniel Krisher <da...@gmail.com>.
I believe that the surefire plugin only includes classes with names
ending in "Test" by default.  If this is your problem, you can modify
this behavior with a <configuration> section for the surefire
plugin...

Dan

On 10/5/05, Michael Deck <mi...@valtech.com> wrote:
> I've just installed Maven 2.0 beta-3 and I'm walking through some simple exercises to get a feel for the app.  I've used the archetype plugin to create a simple java project and it seems to build fine.  However, if I add another test class to the src/test/java directory m2 doesn't seem to detect the new test.  When I run m2 test this is the out put I get:
>
> [INFO] [compiler:testCompile]
> Compiling 2 source files to C:\sandbox\eclipse\Roberto\Maven2\my-app\target\test
> -classes
> [INFO] [surefire:test]
> [INFO] Setting reports dir: C:\sandbox\eclipse\Roberto\Maven2\my-app\target/sure
> fire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> [surefire] Running com.mycompany.app.AppTest
> [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0 sec
>
>
> What's interesting is that 2 classes are compiled, but only 1 of the tests is run.  Has anyone else experienced this behavior?  Am I doning something wrong, or is this the expected behavior?
>
>
> Thanks in advance,
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Daniel Krisher

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