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

TestNGCitrusTestRunner with DataProvider fails with NullPointerException when the dataProvider Name is not Equal to the method name #142

Closed
engzizo79 opened this Issue Nov 3, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@engzizo79
Copy link

engzizo79 commented Nov 3, 2016

When Trying to Run a Citrus Test with a TestNG dataProvider, although it is possible to use a dataProvider Name that does not correspond to the method Name and also to set a dataProviderClass, the Citrus Framework tries to find a method in the same class with the name of the dataProvider. This limitation does not exist in the TestNG framework, is not documented and results in the test run to be terminated without any useful message. Only in the TestNG Report I was able to find following stack trace:

java.lang.NullPointerException
at com.consol.citrus.testng.AbstractTestNGCitrusTest.resolveParameter(AbstractTestNGCitrusTest.java:120)
at com.consol.citrus.testng.AbstractTestNGCitrusTest.resolveParameter(AbstractTestNGCitrusTest.java:124)
at com.consol.citrus.dsl.testng.TestNGCitrusTest.invokeTestMethod(TestNGCitrusTest.java:128)
at com.consol.citrus.dsl.testng.TestNGCitrusTest.run(TestNGCitrusTest.java:100)
at com.consol.citrus.dsl.testng.TestNGCitrusTest.run(TestNGCitrusTest.java:58)
at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:201)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:642)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1137)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:753)
at org.testng.TestRunner.run(TestRunner.java:607)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:368)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:363) [..]

Through debugging it was clear that org.springframework.util.findMethod was called with the providerName as method name, which is not correct in that case

@christophd christophd added the Type: Bug label Nov 3, 2016

@christophd christophd added this to the v2.6.2 milestone Nov 3, 2016

@christophd christophd added the READY label Nov 3, 2016

@christophd christophd removed the READY label Nov 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.