mercredi 26 août 2015

TestNG XML execution order

I have testng java project as below (in the exact order)

TestNGOnePack
ClassOne.java
ClassTwo.java

TestNGThreePack
ClassOne.java
ClassTwo.java

TestNGTwoPack
ClassOne.java
ClassTwo.java

each java file is as follows

@Test
public void pkgName()
{
    System.out.println(this.getClass().getCanonicalName());
}

testng.xml is as follows

<suite name="Suite One">
<test name="Test One" >
<classes>
 <class name="TestNGTwoPack.ClassTwo" />   
 <class name="TestNGOnePack.ClassOne" />
</classes>
    <packages>
         <package name="TestNGThreePack" />
   </packages> 
</test> 

when i ran this as testng i got the followign output

TestNGTwoPack.ClassTwo
TestNGThreePack.ClassOne
TestNGOnePack.ClassOne
TestNGThreePack.ClassTwo

my question is the output's sequence is ambigous Shouldn't it be as follows? what wrong here ??? what's the reason that the output is as above and not as below ??

TestNGTwoPack.ClassTwo
TestNGOnePack.ClassOne
TestNGThreePack.ClassOne
TestNGThreePack.ClassTwo

Aucun commentaire:

Enregistrer un commentaire