You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Burns, Scott" <Sc...@numarasoftware.com> on 2011/02/17 16:37:40 UTC

Maven/Surefire ignores TestNG priority on test methods

Hi, some of our test specify  a priority at the method level as shown below.  We are running our tests in parallel and the order is being ignored.  Any idea on  how to configure this?  Thanks in advance.

Scott

@Test(priority = 1)
    public void testCreateCache()
    {

    }

    /**
     * Test put object.
     */
    @Test(priority = 2)
    public void testPutObject()
    {
    }

    /**
     * Test remove object.
     */
    @Test(priority = 3)
    public void testRemoveObject()
    {
    }

    /**
     * Test clear cache.
     */
    @Test(priority = 4)
    public void testClearCache()
    {
    }

    /**
     * Test delete cache.
     */
    @Test(priority = 99)
    public void testDeleteCache()
    {
    }

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<executions>
<execution></execution>
</executions>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<useSystemClassLoader>true</useSystemClassLoader>
<additionalClasspathElements>
<additionalClasspathElement>${basedir}/src/test/conf</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>

<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="test suite"  verbose="1"
       parallel="classes"
       thread-count="10"
      >
  <test name="testing">
    <classes>
       <class name="CachingUtilsTest" />
       <class name="TemplatingServiceTest" />
    </classes>
  </test>
</suite>


Re: Maven/Surefire ignores TestNG priority on test methods

Posted by Kristian Rosenvold <kr...@gmail.com>.
Surefire delegates all of this to TestNg and does nothing
with these things. You'll have to check if the
combination of parallel and order is supported by 
asking over there.

Kristian

to., 17.02.2011 kl. 15.37 +0000, skrev Burns, Scott:
> Hi, some of our test specify  a priority at the method level as shown below.  We are running our tests in parallel and the order is being ignored.  Any idea on  how to configure this?  Thanks in advance.
> 
> Scott
> 
> @Test(priority = 1)
>     public void testCreateCache()
>     {
> 
>     }
> 
>     /**
>      * Test put object.
>      */
>     @Test(priority = 2)
>     public void testPutObject()
>     {
>     }
> 
>     /**
>      * Test remove object.
>      */
>     @Test(priority = 3)
>     public void testRemoveObject()
>     {
>     }
> 
>     /**
>      * Test clear cache.
>      */
>     @Test(priority = 4)
>     public void testClearCache()
>     {
>     }
> 
>     /**
>      * Test delete cache.
>      */
>     @Test(priority = 99)
>     public void testDeleteCache()
>     {
>     }
> 
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.7.2</version>
> <executions>
> <execution></execution>
> </executions>
> <configuration>
> <suiteXmlFiles>
> <suiteXmlFile>testng.xml</suiteXmlFile>
> </suiteXmlFiles>
> <useSystemClassLoader>true</useSystemClassLoader>
> <additionalClasspathElements>
> <additionalClasspathElement>${basedir}/src/test/conf</additionalClasspathElement>
> </additionalClasspathElements>
> </configuration>
> </plugin>
> 
> <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
> <suite name="test suite"  verbose="1"
>        parallel="classes"
>        thread-count="10"
>       >
>   <test name="testing">
>     <classes>
>        <class name="CachingUtilsTest" />
>        <class name="TemplatingServiceTest" />
>     </classes>
>   </test>
> </suite>
> 



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