Thanks Cedric, in particular the preserve-order feature really is
helpful.
We have one problem with our upgrade to version 5.14 in combination
with inner classes, here is an example which demonstrates the issue:
// abstract test class test\innerclass\InnerClassTest.java
package test.innerclass;
import org.testng.annotations.Test;
public abstract class InnerClassTest
{
@Test
public void test()
{
// do nothing
}
}
// factory class test\innerclass\InnerClassTestFactory.java
package test.innerclass;
import org.testng.annotations.Factory;
public class InnerClassTestFactory
{
@Factory
public Object[] createTicketTest()
{
Object[] result = new Object[1];
result[0] = new InnerClassTest() { };
return result;
}
}
// xml suite
<suite name="testProject by packages">
<test verbose="2" name="test.innerclass" annotations="JDK">
<packages>
<package name="test.innerclass"/>
</packages>
</test>
</suite>
Which causes the following exception:
org.testng.TestNGException:
An error occurred while instantiating class
test.innerclass.InnerClassTestFactory$1. Check to make sure it can be
accessed/instantiated.
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:
349)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:
82)
The problem is that there is a new null check in
ClassHelper.createInstance(Class<?>, Map<Class, IClass>, XmlTest,
IAnnotationFinder, IObjectFactory). Is it possible to remove this null
check or to make an exception for (anonymous) inner classes. We use
them a lot in our current tests.
Thanks,
Carsten