You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Kent Tong <ke...@cpttm.org.mo> on 2006/12/15 11:27:05 UTC

maven not running my tests

Hi,

This is driving me nuts. I've created some TestNG tests in tapestry-core but
they are simply not run by maven ("mvn test"). For example, I have the
the following file in
src/test/java/org/apache/tapestry/integration/pagelevel/FooTest.java
which is compiled into
target/test-classes/org/apache/tapestry/integration/pagelevel/FooTest.class,
but it is never picked up the surefire. The file content is shown below.
Any idea? Thanks!

package org.apache.tapestry.integration.pagelevel;

import org.testng.Assert;
import org.testng.annotations.Test;

public class FooTest extends Assert
{

    @Test
    public void test1()
    {
        assertTrue(true);
    }
}

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: maven not running my tests

Posted by Norbert Sándor <de...@erinors.com>.
Which version of the surefire plugin do you use?
When I switched to the latest snapshot version of the surefire plugin, 
my similar problems were gone...

Regards:
Norbi

Kent Tong írta:
> Hi,
>
> This is driving me nuts. I've created some TestNG tests in tapestry-core but
> they are simply not run by maven ("mvn test"). For example, I have the
> the following file in
> src/test/java/org/apache/tapestry/integration/pagelevel/FooTest.java
> which is compiled into
> target/test-classes/org/apache/tapestry/integration/pagelevel/FooTest.class,
> but it is never picked up the surefire. The file content is shown below.
> Any idea? Thanks!
>
> package org.apache.tapestry.integration.pagelevel;
>
> import org.testng.Assert;
> import org.testng.annotations.Test;
>
> public class FooTest extends Assert
> {
>
>     @Test
>     public void test1()
>     {
>         assertTrue(true);
>     }
> }
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: maven not running my tests

Posted by Kent Tong <ke...@cpttm.org.mo>.
Howard Lewis Ship <hlship <at> gmail.com> writes:

> Specified by the inherited plugin configuration in tapestry-project/pom.xml

Thanks.

> I'd like to see your changes to tapestry-ioc before you check them in, or
> check them into a branch.

When I see this happening again, I'll let you see my changes.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: maven not running my tests

Posted by Howard Lewis Ship <hl...@gmail.com>.
On 12/15/06, Kent Tong <ke...@cpttm.org.mo> wrote:
>
> Howard Lewis Ship <hlship <at> gmail.com> writes:
>
> > Also, you must make sure your package is listed in testng.xml.
>
> Thanks to all for helping. Finally the tip above fixed the problem!
> Interestingly, I can't find any documentation saying that
> src/test/conf/testng.xml is the default location. But anyway,
> I'm glad that it's working!


Specified by the inherited plugin configuration in tapestry-project/pom.xml


On a related note, one of my TestNG test in tapestry-ioc is sometimes
> run as JUnit test by surefire (and fails as a result). Usually this
> is when I am off-line. When I am online, it works again (run as
> TestNG test). It seems that it's because maven needs
> plexus-container-default which needs JUnit at runtime. When the
> TestNG snapshot is unavailable but JUnit is, surefire will use
> the latter. But this doesn't explain why this is not happening with
> the other TestNG tests in tapestry-ioc. Any idea?



Very strange.

I'd like to see your changes to tapestry-ioc before you check them in, or
check them into a branch.


Thanks!
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

Re: maven not running my tests

Posted by Kent Tong <ke...@cpttm.org.mo>.
Howard Lewis Ship <hlship <at> gmail.com> writes:

> Also, you must make sure your package is listed in testng.xml.

Thanks to all for helping. Finally the tip above fixed the problem!
Interestingly, I can't find any documentation saying that 
src/test/conf/testng.xml is the default location. But anyway,
I'm glad that it's working!

On a related note, one of my TestNG test in tapestry-ioc is sometimes
run as JUnit test by surefire (and fails as a result). Usually this 
is when I am off-line. When I am online, it works again (run as 
TestNG test). It seems that it's because maven needs 
plexus-container-default which needs JUnit at runtime. When the
TestNG snapshot is unavailable but JUnit is, surefire will use
the latter. But this doesn't explain why this is not happening with
the other TestNG tests in tapestry-ioc. Any idea?

Thanks!

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: maven not running my tests

Posted by Howard Lewis Ship <hl...@gmail.com>.
Also, you must make sure your package is listed in testng.xml.

On 12/15/06, Eric BIANCHI <er...@quod.ch> wrote:
>
> Hi Kent,
>
> I had the same problem until I change my pom.xml and had the version
> number to the surefire-plugin.
>
> <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <version>2.8-SNAPSHOT</version>
> </plugin>
>
> I hope it helps
>
> Best regards
>
> Eric
>
>
> Le 15 déc. 06 à 11:27, Kent Tong a écrit :
>
> > Hi,
> >
> > This is driving me nuts. I've created some TestNG tests in tapestry-
> > core but
> > they are simply not run by maven ("mvn test"). For example, I have the
> > the following file in
> > src/test/java/org/apache/tapestry/integration/pagelevel/FooTest.java
> > which is compiled into
> > target/test-classes/org/apache/tapestry/integration/pagelevel/
> > FooTest.class,
> > but it is never picked up the surefire. The file content is shown
> > below.
> > Any idea? Thanks!
> >
> > package org.apache.tapestry.integration.pagelevel;
> >
> > import org.testng.Assert;
> > import org.testng.annotations.Test;
> >
> > public class FooTest extends Assert
> > {
> >
> >     @Test
> >     public void test1()
> >     {
> >         assertTrue(true);
> >     }
> > }
> >
> > --
> > Author of a book for learning Tapestry (http://www.agileskills2.org/
> > EWDT)
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
> --
> Eric BIANCHI
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

Re: maven not running my tests

Posted by Eric BIANCHI <er...@quod.ch>.
Hi Kent,

I had the same problem until I change my pom.xml and had the version  
number to the surefire-plugin.

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-surefire-plugin</artifactId>
	<version>2.8-SNAPSHOT</version>
</plugin>

I hope it helps

Best regards

Eric


Le 15 déc. 06 à 11:27, Kent Tong a écrit :

> Hi,
>
> This is driving me nuts. I've created some TestNG tests in tapestry- 
> core but
> they are simply not run by maven ("mvn test"). For example, I have the
> the following file in
> src/test/java/org/apache/tapestry/integration/pagelevel/FooTest.java
> which is compiled into
> target/test-classes/org/apache/tapestry/integration/pagelevel/ 
> FooTest.class,
> but it is never picked up the surefire. The file content is shown  
> below.
> Any idea? Thanks!
>
> package org.apache.tapestry.integration.pagelevel;
>
> import org.testng.Assert;
> import org.testng.annotations.Test;
>
> public class FooTest extends Assert
> {
>
>     @Test
>     public void test1()
>     {
>         assertTrue(true);
>     }
> }
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/ 
> EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>

--
Eric BIANCHI




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: maven not running my tests

Posted by Norbert Sándor <de...@erinors.com>.
Just ignore my previous response please, I have just realized that it's 
the tapestry-core which already uses the snapshot...
Norbi

Kent Tong írta:
> Hi,
>
> This is driving me nuts. I've created some TestNG tests in tapestry-core but
> they are simply not run by maven ("mvn test"). For example, I have the
> the following file in
> src/test/java/org/apache/tapestry/integration/pagelevel/FooTest.java
> which is compiled into
> target/test-classes/org/apache/tapestry/integration/pagelevel/FooTest.class,
> but it is never picked up the surefire. The file content is shown below.
> Any idea? Thanks!
>
> package org.apache.tapestry.integration.pagelevel;
>
> import org.testng.Assert;
> import org.testng.annotations.Test;
>
> public class FooTest extends Assert
> {
>
>     @Test
>     public void test1()
>     {
>         assertTrue(true);
>     }
> }
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org