You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.NullPointerException
at org.testng.internal.objects.SimpleObjectDispenser.instantiateUsingDefaultConstructor(SimpleObjectDispenser.java:178)
at org.testng.internal.objects.SimpleObjectDispenser.createInstance(SimpleObjectDispenser.java:87)
... 46 more
Is the issue reproducible on runner?
yes, here is a sample code
public class IssueTest {
@Test
public void issueTest() {
XmlSuite suite = new XmlSuite();
suite.setName("TestSuite");
XmlTest test = new XmlTest(suite);
test.setName("ChildTests");
List<XmlClass> classes = new ArrayList<>();
classes.add(new XmlClass("test.configuration.suites.IssueTest"));
test.setXmlClasses(classes);
final IConfiguration configuration = new Configuration();
final boolean useDefaultListeners = true;
SuiteRunner baseSuiteRunner = new SuiteRunner(configuration, suite,
"outputDir",
new ITestRunnerFactory() {
@Override
public TestRunner newTestRunner(ISuite suite, XmlTest xmlTest,
Collection<IInvokedMethodListener> listeners, List<IClassListener> classListeners) {
TestRunner runner =
new TestRunner(configuration, suite, xmlTest,
false /* skipFailedInvocationCounts */,
listeners, classListeners);
if (useDefaultListeners) {
runner.addListener(new TestHTMLReporter());
runner.addListener(new JUnitXMLReporter());
}
return runner;
}
},
useDefaultListeners,
Comparator.comparingInt(ITestNGMethod::getPriority));
baseSuiteRunner.run();
}
}
Shell
Maven
Gradle
Ant
Eclipse
IntelliJ
NetBeans
Test case sample
Please, share the test case (as small as possible) which shows the issue
Contribution guidelines
Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.
The text was updated successfully, but these errors were encountered:
bj-9527
added a commit
to bj-9527/testng
that referenced
this issue
Mar 22, 2022
TestNG Version
Expected behavior
SuiteRunner could init by default Configuration
Actual behavior
Is the issue reproducible on runner?
yes, here is a sample code
Test case sample
Contribution guidelines
Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.
The text was updated successfully, but these errors were encountered: