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

NullPointerException in ReportPortalTestNGListener #2

Closed
shaburov opened this issue Dec 11, 2016 · 1 comment
Closed

NullPointerException in ReportPortalTestNGListener #2

shaburov opened this issue Dec 11, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@shaburov
Copy link

shaburov commented Dec 11, 2016

NullPointerException in ReportPortalTestNGListener with version testNG 6.9.13. *

Method addListener(Object listener) in this version is marked as @deprecated, possible cause of the error somehow connected with it.
Do you support the version testNG 6.9.13.0 and above?

Code

    public static void main(String[] args) throws JAXBException, IOException {
        ReportPortalTestNGListener reportPortalTestNGListener = new ReportPortalTestNGListener();
        TestNG testNG = new TestNG();
        List<XmlSuite> suites = new ArrayList<>();
        suites.add(new TestRailApiSuite());
        suites.add(new YandexDNSApiSuite());
        testNG.setXmlSuites(suites);
        testNG.setSuiteThreadPoolSize(SUITE_THREAD_POOL_SIZE);
        List<Class<? extends ITestNGListener>> listeners = new ArrayList<>();
        listeners.add(SuiteListener.class);
        testNG.setListenerClasses(listeners);
        testNG.addListener((Object) reportPortalTestNGListener);
        testNG.setUseDefaultListeners(false);
        testNG.run();
    }

Run result

Exception in thread "pool-1-thread-1" Exception in thread "pool-1-thread-2" java.lang.NullPointerException
	at com.epam.reportportal.testng.ReportPortalTestNGListener.onStart(ReportPortalTestNGListener.java:68)
	at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:210)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
	at com.epam.reportportal.testng.ReportPortalTestNGListener.onStart(ReportPortalTestNGListener.java:68)
	at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:210)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

UPD
The reason for errors in multithreaded start on suites.
If you set testNG.setSuiteThreadPoolSize(1); еrror do not arise

@avarabyeu avarabyeu self-assigned this Dec 14, 2016
@avarabyeu avarabyeu added the bug label Dec 14, 2016
admizh added a commit to admizh/agent-java-testNG that referenced this issue Jan 4, 2017
Populate TestNG group to PR launch tags (reportportal/reportportal#46)
@DzmitryHumianiuk DzmitryHumianiuk added this to the 3.0 milestone Jan 13, 2017
@avarabyeu
Copy link
Member

Fixed

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

No branches or pull requests

3 participants