You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wim Deblauwe <wi...@gmail.com> on 2006/11/22 15:28:17 UTC

Maven and TestNG

Hi,

what is the current status on Maven2 and TestNG?

This blog entry[1] shows me a way to avoid surefire, but this does not feel
right. The official TestNG documentation[2] talks about using surefire
2.8-SNAPSHOT, but when I declare this version, all I get from maven is this:

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.maven.plugins
ArtifactId: maven-plugins
Version: 2-SNAPSHOT

Reason: Unable to download the artifact from any repository

Notice the version 2-SNAPSHOT, although I put 2.8-SNAPSHOT in my pom.xml! I
added the extra repository (http://howardlewisship.com/repository), so that
should be ok.

any help would highly appriciated.

regards,

Wim


[1]http://www.ninthavenue.com.au/blog/maven_and_testng
[2]http://testng.org/doc/maven.html

Re: Maven and TestNG

Posted by Marco Mistroni <mm...@gmail.com>.
Hello Wim,
  sorry havent' had a look at TestNG in a bit (i m doing it on my leasure
time..which is almost null).

I m sure there are parameters in TestNG with which you can configure
dynamically
the tests that run (for example, by making all tests part of the same group
and specifying which
test to run.. i m sure you can use wildcard with packages..).
Pls have a look at TestNG documentation (or TestNG mailing list), you will
find more help there

hth
 marco

On 11/22/06, Wim Deblauwe <wi...@gmail.com> wrote:
>
> Thanks, that runs my tests. It a pity that I have to add all my packages
> to
> my testng.xml file. Do you know a way to say: recursively from this one?
>
> This is what I got now:
>
> <suite name="All tests" verbose="1">
>     <test name="All tests">
>         <packages>
>             <package name="net.sourceforge.vigilog"/>
>             <package name="net.sourceforge.vigilog.parse"/>
>             <package name="net.sourceforge.vigilog.models"/>
>         </packages>
>         <classes>
>             <class name="
> net.sourceforge.vigilog.parse.Log4jXMLFileLogFileParserTest">
>                 <methods>
>                     <exclude name="testBigFileParsing"/>
>                 </methods>
>             </class>
>         </classes>
>     </test>
>
> regards,
>
> Wim
>
> 2006/11/22, Marco Mistroni <mm...@gmail.com>:
> >
> > Hello,
> >   try with this
> >
> > <dependencies>
> >     <dependency>
> >       <groupId>org.testng</groupId>
> >       <artifactId>testng</artifactId>
> >       <version>5.1</version>
> >       <scope>test</scope>
> >       <classifier>jdk15</classifier>
> >     </dependency>
> >   </dependencies>
> >
> >   <build>
> >     <plugins>
> >       <plugin>
> >         <artifactId>maven-surefire-plugin</artifactId>
> >         <configuration>
> >           <suiteXmlFiles>
> >             <suiteXmlFile>src/test/resources/testing.xml</suiteXmlFile>
> >           </suiteXmlFiles>
> >         </configuration>
> >       </plugin>
> >     </plugins>
> >   </build>
> >
> >
> > hth
> > marco
> >
> >
>
>

Re: Maven and TestNG

Posted by Wim Deblauwe <wi...@gmail.com>.
Thanks, that runs my tests. It a pity that I have to add all my packages to
my testng.xml file. Do you know a way to say: recursively from this one?

This is what I got now:

<suite name="All tests" verbose="1">
    <test name="All tests">
        <packages>
            <package name="net.sourceforge.vigilog"/>
            <package name="net.sourceforge.vigilog.parse"/>
            <package name="net.sourceforge.vigilog.models"/>
        </packages>
        <classes>
            <class name="
net.sourceforge.vigilog.parse.Log4jXMLFileLogFileParserTest">
                <methods>
                    <exclude name="testBigFileParsing"/>
                </methods>
            </class>
        </classes>
    </test>

regards,

Wim

2006/11/22, Marco Mistroni <mm...@gmail.com>:
>
> Hello,
>   try with this
>
> <dependencies>
>     <dependency>
>       <groupId>org.testng</groupId>
>       <artifactId>testng</artifactId>
>       <version>5.1</version>
>       <scope>test</scope>
>       <classifier>jdk15</classifier>
>     </dependency>
>   </dependencies>
>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <suiteXmlFiles>
>             <suiteXmlFile>src/test/resources/testing.xml</suiteXmlFile>
>           </suiteXmlFiles>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>
>
> hth
> marco
>
>

Re: Maven and TestNG

Posted by Marco Mistroni <mm...@gmail.com>.
Hello,
  try with this

<dependencies>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>5.1</version>
      <scope>test</scope>
      <classifier>jdk15</classifier>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>src/test/resources/testing.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
    </plugins>
  </build>


hth
 marco