Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jgiven report fails when running testng dataproviders in parallel mode #105

Closed
adrian-herscu opened this issue Aug 26, 2015 · 2 comments · Fixed by #108
Closed

jgiven report fails when running testng dataproviders in parallel mode #105

adrian-herscu opened this issue Aug 26, 2015 · 2 comments · Fixed by #108

Comments

@adrian-herscu
Copy link

Given the following scenario:

@Test(enabled = false, dataProvider = "dummyData", dataProviderClass = SelfTestsData.class)
public void shouldTestInParallel(final String left, final String right)
        throws Exception {
    given().nothing();
    when().doing_nothing();
    then().$("left should be equal to right", stage -> { //$NON-NLS-1$
                assertThat(left).isEqualTo(right);
            });
}

and the following data provider:
@dataProvider(parallel = true)
public static Object[][] dummyData() {
// NOTE: could be populated from a CSV file
return new Object[][] {
{ "one", "one" },
{ "two", "two" }
};
}

When running with TestNG

Then the following stacktrace appears:

Exception in thread "main" java.lang.NullPointerException
at com.tngtech.jgiven.report.model.ReportModelBuilder.setSuccess(ReportModelBuilder.java:247)
at com.tngtech.jgiven.report.model.ReportModelBuilder.scenarioFailed(ReportModelBuilder.java:279)
at com.tngtech.jgiven.impl.StandaloneScenarioExecutor.failed(StandaloneScenarioExecutor.java:413)
at com.tngtech.jgiven.testng.ScenarioTestListener.onTestFailure(ScenarioTestListener.java:58)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1895)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1879)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1292)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)

@janschaefer
Copy link
Contributor

Interesting. I never actually tried that. I classify that as a feature request :-)

@janschaefer
Copy link
Contributor

This is now tracked by PR #108 (not finished yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants