You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Shabbir Kheriwala <sh...@geodesiconline.com> on 2006/05/16 08:48:33 UTC
Maven2 & Testng - tests not run
Hi,
I am using testng and maven2. Here is what i am doing.....
public abstract class MyTestCase extends TestCase
{
@Configuration(beforeTestMethod = true)
protected void setUp()
{ ... }
@Configuration(afterTestMethod = true)
protected void tearDown()
{ ... }
public static ArrayList getList()
{ .... }
}
public class MyClassUnderTest extends MyTestCase
{
@Configuration(beforeTestMethod = true)
protected void setUp()
{ super.setUp(); ... }
@Configuration(afterTestMethod = true)
protected void tearDown()
{ super.tearDown();... }
@Test
public final void testMethod1()
{
.......//test Method 1
}
@Test
public final void testMethod2()
{
.......//test Method 2
}
}
Now when i run the test it does not execute the test methods... this it
what i get ....
Running com.demo.MyClassUnderTest
*Tests run: 0*, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015
sec
Results :
*Tests run: 0*, Failures: 0, Errors: 0, Skipped: 0
.... but it works fine when i run the test through the test suite
(pom.xml) ie...
<suiteXmlFiles>
<suiteXmlFile>src/test/java/testng.xml</suiteXmlFile>
</suiteXmlFiles>
Running com.demo.MyClassUnderTest
*Tests run: 2*, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.468
sec
Results :
*Tests run: 2*, Failures: 0, Errors: 0, Skipped: 0
Please help me to figure-out why does the test not execute if i run it
without the suite.
Do i need to add an entry to the pom.xml ????
Thanx,
Shabbir