You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Davy Toch <Da...@belgacom.net> on 2006/09/25 20:46:40 UTC

Is TestNG support in M2 2.0.4 already stable?

Hi,

I was just wondering whether TestNG support in M2 is already
stable and can be used as a viable replacement of JUnit? I
already tried using TestNG in M2 but I had different problems
(tests not being run, ClassCastException, ...).

So before I start posting my TestNG-related problems in detail,
I just have this simple question : is M2 2.0.4 already supposed
to fully support TestNG or is it recommended to wait until M2
2.0.5 or higher?

Regards and thanks,
Davy Toch



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


Re: Is TestNG support in M2 2.0.4 already stable?

Posted by Wim Deblauwe <wi...@gmail.com>.
There was a promise on this mailing list a while ago that many of the
plugins would see a new release shortly, so let's hope so, so that we can
avoid having to rely on SNAPSHOT versions to get the builds working...

regards,

Wim

2006/9/27, franz see <fr...@gmail.com>:
>
>
>
>
> Davy Toch wrote:
> >
> > Hi,
> >
> > I have the following M2 2.0.4 project containing the following 3 files:
> >
> > A. $PROJECT_ROOT/src/test/java/testgroup/AppTest.java :
> >
> > package testgroup;
> >
> > public class AppTest
> > {
> >   /**
> >    * @testng.test
> >    */
> >   public void doSomething()
> >   {
> >     System.out.println("doSomething() called");
> >   }
> > }
> >
> > B. $PROJECT_ROOT/testng.xml :
> >
> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> > <suite name="Suite1"  verbose="1" >
> >   <test name="Regression1">
> >     <classes>
> >       <class name="testgroup.AppTest"/>
> >     </classes>
> >   </test>
> > </suite>
> >
> > C. $PROJECT_ROOT/pom.xml :
> >
> > <project xmlns="http://maven.apache.org/POM/4.0.0"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> >   <modelVersion>4.0.0</modelVersion>
> >   <groupId>testgroup</groupId>
> >   <artifactId>testapp</artifactId>
> >   <packaging>jar</packaging>
> >   <version>1.0-SNAPSHOT</version>
> >   <name>Maven Quick Start Archetype</name>
> >   <url>http://maven.apache.org</url>
> >   <dependencies>
> >     <dependency>
> >       <groupId>org.testng</groupId>
> >       <artifactId>testng</artifactId>
> >       <version>5.1</version>
> >       <scope>test</scope>
> >       <classifier>jdk14</classifier>
> >     </dependency>
> >   </dependencies>
> >   <build>
> >     <plugins>
> >       <plugin>
> >         <groupId>org.apache.maven.plugins</groupId>
> >         <artifactId>maven-surefire-plugin</artifactId>
> >         <configuration>
> >           <suiteXmlFiles>
> >             <suiteXmlFile>testng.xml</suiteXmlFile>
> >           </suiteXmlFiles>
> >         </configuration>
> >       </plugin>
> >     </plugins>
> >   </build>
> > </project>
> >
> > When running the tests I get:
> >
> > $mvn test
> > [INFO] Scanning for projects...
> > [INFO]
> >
> ----------------------------------------------------------------------------
> > [INFO] Building Maven Quick Start Archetype
> > [INFO]    task-segment: [test]
> > [INFO]
> >
> ----------------------------------------------------------------------------
> > [INFO] [resources:resources]
> > [INFO] Using default encoding to copy filtered resources.
> > [INFO] [compiler:compile]
> > [INFO] No sources to compile
> > [INFO] [resources:testResources]
> > [INFO] Using default encoding to copy filtered resources.
> > [INFO] [compiler:testCompile]
> > Compiling 1 source file to
> C:\tmp\xxx\testapp\testapp\target\test-classes
> > [INFO] [surefire:test]
> > [INFO] Surefire report directory:
> > C:\tmp\xxx\testapp\testapp\target\surefire-reports
> >
> > -------------------------------------------------------
> >  T E S T S
> > -------------------------------------------------------
> > Running Regression1
> > Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.09 sec
> >
> > Results :
> > Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] BUILD SUCCESSFUL
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 7 seconds
> > [INFO] Finished at: Tue Sep 26 21:16:26 CEST 2006
> > [INFO] Final Memory: 3M/10M
> > [INFO]
> > ------------------------------------------------------------------------
> >
> > So no tests were found by M2! However if I directly run the TestNG tests
> > from
> > the command-line, e.g.:
> >
> > $c:\devtools\j2sdk1.4.2_10\bin\java.exe -cp \
> >   target\test-classes;c:\devtools\testng-5.1\testng-5.1-jdk14.jar \
> >   org.testng.TestNG \
> >   -sourcedir src\test\java testng.xml
> >
> > then I get :
> >
> > doSomething() called
> >
> > ===============================================
> > Suite1
> > Total tests run: 1, Failures: 0, Skips: 0
> > ===============================================
> >
> > Remark that before I ran the above tests, I completely deleted ~/.m2, so
> > the
> > local repository would be reinitialized from scratch based on what's
> > available
> > in http://www.ibiblio.org/maven2.
> >
> > Regards,
> > Davy Toch
> >
> > Davy Toch wrote:
> >> Hi,
> >>
> >> I was just wondering whether TestNG support in M2 is already
> >> stable and can be used as a viable replacement of JUnit? I
> >> already tried using TestNG in M2 but I had different problems
> >> (tests not being run, ClassCastException, ...).
> >>
> >> So before I start posting my TestNG-related problems in detail,
> >> I just have this simple question : is M2 2.0.4 already supposed
> >> to fully support TestNG or is it recommended to wait until M2
> >> 2.0.5 or higher?
> >>
> >> Regards and thanks,
> >> Davy Toch
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> Good day to you, Davy,
>
> Pardon, but I guess I was mistaken. After reading the jira issues and logs
> again, I realized that it wasn't the maven-surefire-plugin that was
> patched
> but the surefire-testng instead. Anyway, the patched surefire-testng
> (2.1-SNAPSHOT) project is not yet released. You can however, try download
> it
> from [1].
>
> Cheers,
> Franz
>
> [1] http://people.apache.org/maven-snapshot-repository/
> --
> View this message in context:
> http://www.nabble.com/Is-TestNG-support-in-M2-2.0.4-already-stable--tf2333996.html#a6520270
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Is TestNG support in M2 2.0.4 already stable?

Posted by franz see <fr...@gmail.com>.


Davy Toch wrote:
> 
> Hi,
> 
> I have the following M2 2.0.4 project containing the following 3 files:
> 
> A. $PROJECT_ROOT/src/test/java/testgroup/AppTest.java :
> 
> package testgroup;
> 
> public class AppTest
> {
>   /**
>    * @testng.test
>    */
>   public void doSomething()
>   {
>     System.out.println("doSomething() called");
>   }
> }
> 
> B. $PROJECT_ROOT/testng.xml :
> 
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> <suite name="Suite1"  verbose="1" >
>   <test name="Regression1">
>     <classes>
>       <class name="testgroup.AppTest"/>
>     </classes>
>   </test>
> </suite>
> 
> C. $PROJECT_ROOT/pom.xml :
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>testgroup</groupId>
>   <artifactId>testapp</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>Maven Quick Start Archetype</name>
>   <url>http://maven.apache.org</url>
>   <dependencies>
>     <dependency>
>       <groupId>org.testng</groupId>
>       <artifactId>testng</artifactId>
>       <version>5.1</version>
>       <scope>test</scope>
>       <classifier>jdk14</classifier>
>     </dependency>
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <suiteXmlFiles>
>             <suiteXmlFile>testng.xml</suiteXmlFile>
>           </suiteXmlFiles>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
> </project>
> 
> When running the tests I get:
> 
> $mvn test
> [INFO] Scanning for projects...
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Building Maven Quick Start Archetype
> [INFO]    task-segment: [test]
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> Compiling 1 source file to C:\tmp\xxx\testapp\testapp\target\test-classes
> [INFO] [surefire:test]
> [INFO] Surefire report directory: 
> C:\tmp\xxx\testapp\testapp\target\surefire-reports
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running Regression1
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.09 sec
> 
> Results :
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 7 seconds
> [INFO] Finished at: Tue Sep 26 21:16:26 CEST 2006
> [INFO] Final Memory: 3M/10M
> [INFO] 
> ------------------------------------------------------------------------
> 
> So no tests were found by M2! However if I directly run the TestNG tests 
> from
> the command-line, e.g.:
> 
> $c:\devtools\j2sdk1.4.2_10\bin\java.exe -cp \
>   target\test-classes;c:\devtools\testng-5.1\testng-5.1-jdk14.jar \
>   org.testng.TestNG \
>   -sourcedir src\test\java testng.xml
> 
> then I get :
> 
> doSomething() called
> 
> ===============================================
> Suite1
> Total tests run: 1, Failures: 0, Skips: 0
> ===============================================
> 
> Remark that before I ran the above tests, I completely deleted ~/.m2, so
> the
> local repository would be reinitialized from scratch based on what's 
> available
> in http://www.ibiblio.org/maven2.
> 
> Regards,
> Davy Toch
> 
> Davy Toch wrote:
>> Hi,
>>
>> I was just wondering whether TestNG support in M2 is already
>> stable and can be used as a viable replacement of JUnit? I
>> already tried using TestNG in M2 but I had different problems
>> (tests not being run, ClassCastException, ...).
>>
>> So before I start posting my TestNG-related problems in detail,
>> I just have this simple question : is M2 2.0.4 already supposed
>> to fully support TestNG or is it recommended to wait until M2
>> 2.0.5 or higher?
>>
>> Regards and thanks,
>> Davy Toch
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

Good day to you, Davy,

Pardon, but I guess I was mistaken. After reading the jira issues and logs
again, I realized that it wasn't the maven-surefire-plugin that was patched
but the surefire-testng instead. Anyway, the patched surefire-testng
(2.1-SNAPSHOT) project is not yet released. You can however, try download it
from [1].

Cheers,
Franz

[1] http://people.apache.org/maven-snapshot-repository/
-- 
View this message in context: http://www.nabble.com/Is-TestNG-support-in-M2-2.0.4-already-stable--tf2333996.html#a6520270
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Is TestNG support in M2 2.0.4 already stable?

Posted by Stephen Duncan <st...@gmail.com>.
Any reason not to bump up the version of TestNG to the latest in the
docs?  (i.e. 4.7->5.1)

-Stephen

On 9/26/06, franz see <fr...@gmail.com> wrote:
>
>
>
> Davy Toch wrote:
> >
> > Hi,
> >
> > I was just wondering whether TestNG support in M2 is already
> > stable and can be used as a viable replacement of JUnit? I
> > already tried using TestNG in M2 but I had different problems
> > (tests not being run, ClassCastException, ...).
> >
> > So before I start posting my TestNG-related problems in detail,
> > I just have this simple question : is M2 2.0.4 already supposed
> > to fully support TestNG or is it recommended to wait until M2
> > 2.0.5 or higher?
> >
> > Regards and thanks,
> > Davy Toch
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> Good day to you, Davy,
>
> If im not mitaken, yes it is already supported. Furthermore, you can try and
> read [1] for more information about configuring your maven2 for TestNG.
> However, [1] is not yet final, and it's stil being reviewed. So if you have
> any comments or suggestions about it, please let do let us know so that we
> can improve it.
>
> Thanks,
> Franz
>
> [1]
> http://people.apache.org/~aramirez/maven-surefire-plugin/examples/testng.html
> --
> View this message in context: http://www.nabble.com/Is-TestNG-support-in-M2-2.0.4-already-stable--tf2333996.html#a6500391
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com

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


Re: Is TestNG support in M2 2.0.4 already stable?

Posted by franz see <fr...@gmail.com>.


Davy Toch wrote:
> 
> Hi,
> 
> I was just wondering whether TestNG support in M2 is already
> stable and can be used as a viable replacement of JUnit? I
> already tried using TestNG in M2 but I had different problems
> (tests not being run, ClassCastException, ...).
> 
> So before I start posting my TestNG-related problems in detail,
> I just have this simple question : is M2 2.0.4 already supposed
> to fully support TestNG or is it recommended to wait until M2
> 2.0.5 or higher?
> 
> Regards and thanks,
> Davy Toch
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

Good day to you, Davy,

If im not mitaken, yes it is already supported. Furthermore, you can try and
read [1] for more information about configuring your maven2 for TestNG.
However, [1] is not yet final, and it's stil being reviewed. So if you have
any comments or suggestions about it, please let do let us know so that we
can improve it. 

Thanks,
Franz

[1]
http://people.apache.org/~aramirez/maven-surefire-plugin/examples/testng.html
-- 
View this message in context: http://www.nabble.com/Is-TestNG-support-in-M2-2.0.4-already-stable--tf2333996.html#a6500391
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Is TestNG support in M2 2.0.4 already stable?

Posted by Stephen Duncan <st...@gmail.com>.
My experience is that the only way to use TestNG is to specify a
suiteXml file and do all your configuration there.  The rest of the
TestNG support does not work as documented.  While you won't have to
wait for Maven 2.0.5 necessarily, you will have to wait for another
surefire-plugin release (at least) to get everything working as it's
supposed to.

-Stephen

On 9/25/06, Davy Toch <Da...@belgacom.net> wrote:
> Hi,
>
> I was just wondering whether TestNG support in M2 is already
> stable and can be used as a viable replacement of JUnit? I
> already tried using TestNG in M2 but I had different problems
> (tests not being run, ClassCastException, ...).
>
> So before I start posting my TestNG-related problems in detail,
> I just have this simple question : is M2 2.0.4 already supposed
> to fully support TestNG or is it recommended to wait until M2
> 2.0.5 or higher?
>
> Regards and thanks,
> Davy Toch
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com

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