Is there a guarantee that multiple tests in a testng.xml file will be
executed in the order they are declared in the file ?
-~----------~----~----~----~------~----~------~--~---Cédric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com
To unsubscribe from this group, send email to testng-users...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
View this message in context: http://old.nabble.com/order-of-execution-of-tests-tp26254836p29474824.html
Sent from the testng-users mailing list archive at Nabble.com.
You can get it from:
http://testng.org/beta/
It is testng-5.14beta.zip
Chuck Brunson
719-651-6259(w)
719-282-1373(h)
chuckb...@yahoo.com
--- On Wed, 8/18/10, Anna-onNabble <asul...@yahoo.com> wrote:
Cedric recently made a fix to make preserve-order work and its working
now for me. It was NOT working for me using 5.13.1.
You can get it from:
http://testng.org/beta/
It is testng-5.14beta.zip
Cedric,
What I really need is a way to guarantee execution order of test classes.
(The classes have internal method dependencies in them.)
If it is at all possible, what is the best way to achieve this right now?
Thanks,
Anna
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To post to this group, send email to testng...@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/order-of-execution-of-tests-tp26254836p29477095.html
What I really need is a way to guarantee execution order of test classes.
(The classes have internal method dependencies in them.)
If it is at all possible, what is the best way to achieve this right now?
Thanks,
Anna
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To post to this group, send email to testng...@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/order-of-execution-of-tests-tp26254836p29477095.html
>> testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
>> .
>> > For more options, visit this group at
>> > http://groups.google.com/group/testng-users?hl=en.
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/order-of-execution-of-tests-tp26254836p29477095.html
>> Sent from the testng-users mailing list archive at Nabble.com.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "testng-users" group.
>> To post to this group, send email to testng...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> testng-users...@googlegroups.com<testng-users%2Bunsu...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/testng-users?hl=en.
>>
>>
>
>
> --
> Cédric
>
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To post to this group, send email to testng...@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/order-of-execution-of-tests-tp26254836p29477494.html
Yes, I have seen that in the doc. But I also read somewhere that
"preserve-order was not preserving class order with dependent methods" in
5.13.1. Which version has that been fixed in?
org.apache.maven.surefire.booter.SurefireExecutionException:
java.util.ArrayList cannot be cast to java.lang.String;
nested exception is java.lang.ClassCastException: java.util.ArrayList cannot
be cast to java.lang.String
java.lang.ClassCastException: java.util.ArrayList cannot be cast to
java.lang.String
at org.testng.TestNG.configure(TestNG.java:1370)
at
org.apache.maven.surefire.testng.conf.TestNGMapConfigurator.configure(TestNGMapConfigurator.java:97)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:58)
at
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:144)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Here is my pared down testng.xml:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Component Tests" verbose="10" annotations="JDK">
<test name="Functional Tests" preserve-order="true">
<classes>
<class name="server.PrgTest" />
<class name="server.SibTest" />
<class name="server.SchTest" />
<class name="server.PpvTest" />
<class name="server.EdnTest" />
</classes>
</test>
</suite>
And the surefire plugin configuration in the pom is as follows:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.6</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${project.basedir}/src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<c.home>${c.home}</c.home>
<c.config.file>c.props</c.config.file>
</properties>
</configuration>
</plugin>
Am I missing something here?
Thanks,
Anna
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To post to this group, send email to testng...@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/order-of-execution-of-tests-tp26254836p29478898.html
Hi Cédric,
Thanks for such fast responses!
I created a new test project with only 3 short test classes that have method dependencies and groups, which to some degree reflects my real scenario.
And I don't get that exception. In fact, when I removed the parent declaration from my production POM, no exception is thrown.
BUT, the test classes are not executed in the order declared in the suite xml file.
I am attaching my simple test project, so you can see for yourself. (The zip files also includes the output of the test.)
Thanks,
AnnaTo: Anna Sulkina <asul...@yahoo.com>; Brett Porter <brett....@gmail.com>
Sent: Thu, August 19, 2010 11:33:03 AM
Subject: Re: [testng-users] order of execution of tests
+Brett
Anna, I can't seem to reproduce the problem.
I am using the same configuration as you: Surefire 2.6 and:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.13.1</version>
<scope>test</scope>
</dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<properties>
<cats.home>catsHome</cats.home>
<cats.config.file>catsProps</cats.config.file>
</properties>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng-single.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
The problem seems to be that Surefire is passing a String[] and TestNG expects a String, but I don't see any of this neither in the Surefire code nor in TestNG. I am able to run my tests with Surefire and TestNG 5.13.1 without seeing the ClassCastException that you are seeing, which I'm reproducing for Brett below.
Brett, any idea where Surefire might be passing a String[] in that map that TestNG might cast impropriately? And also any thought why I can't reproduce this? Can you?
Anna, are you positive that I am reproducing the correct scenario?
org.apache.maven.surefire.
booter.SurefireExecutionException:
java.util.ArrayList cannot be cast to java.lang.String;
nested exception is java.lang.ClassCastException: java.util.ArrayList cannot
be cast to java.lang.String
java.lang.ClassCastException: java.util.ArrayList cannot be cast to
java.lang.String
at org.testng.TestNG.configure(TestNG.java:1370)
at
org.apache.maven.surefire.testng.conf.TestNGMapConfigurator.configure(TestNGMapConfigurator.java:97)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:58)
at
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:144)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
2010/8/19 Anna Sulkina <asul...@yahoo.com>
Hi Cédric,
The pom.xml file is attached.
Thanks,
Anna
From: Cédric Beust ♔ <ced...@beust.com>
To: testng...@googlegroups.com; asul...@yahoo.com
Sent: Thu, August 19, 2010 7:30:13 AM
Subject: Re: [testng-users] order of execution of tests
--
Cédric
--
Cédric