Getting a NPE in Cuanto's listener implementation

76 views
Skip to first unread message

Nagesh

unread,
Jan 12, 2015, 9:59:16 PM1/12/15
to testng...@googlegroups.com
Hello,

Over this past weekend, I tried integrating my WebDriver project with Cuanto (test tracking tool). I successfully set up Cuanto to run locally on my machine with the help of the install instructions provided. Cuanto provides an listener called TestNgListener which is an ITestListener implementation for TestNG that submits test results to Cuanto on the fly. I get the following error when I execute my TestNG suite file test.xml using Maven. It points to a configuration failure in the Cuanto TestNgListener. Has anybody encountered this issue or know what maybe the issue?

<Thread-id: 1> About to begin executing Test Group - Integration Tests
Exception in thread "pool-1-thread-1" java.lang.NullPointerException
 at cuanto.adapter.listener.testng.TestNgListener.onConfigurationFailure(TestNgListener.java:130)
 at org.testng.internal.Invoker.runConfigurationListeners(Invoker.java:1868)
 at org.testng.internal.Invoker.handleConfigurationFailure(Invoker.java:334)
 at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:245)
 at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
 at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
 at java.lang.Thread.run(Thread.java:695)


Here's how the listener section of the test.xml TestNG suite file looks like -

<suite name="Turbo WebDriver Tests" parallel="classes" thread-count="4">
<listeners>
<listener class-name="com.axiom.turbo.webdriver.TestListener" />
<listener class-name="cuanto.adapter.listener.testng.TestNgListener" />
</listeners>
   <test name="Turbo WebDriver Tests" thread-count="4">
<groups>
<run>
<include name="WhatsNew" />
</run>
</groups>
<packages>
<package name="com.axiom.turbo.webdriver.tests.homePage" />
</packages>
</test>
</suite>

Here's the Maven command -

mvn -U clean integration-test -P webdriver-tests -Dtest.suite.path=src/test/java/com/axiom/turbo/webdriver/suites/test.xml -Dtest.env=rc1 -Dcuanto.url=http://localhost:8080/cuanto -Dcuanto.projectKey=AXM -Dcuanto.testrun.create=true

Appreciate the help!

Thanks,
Nagesh

Cédric Beust ♔

unread,
Jan 12, 2015, 11:45:51 PM1/12/15
to testng...@googlegroups.com
Well, there's an NPE in your code...

-- 
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Nagesh

unread,
Jan 13, 2015, 1:23:20 PM1/13/15
to testng...@googlegroups.com, ced...@beust.com
Yes, but I can't figure out where, since I'm using the TestNgListener that comes with Cuanto's jars. I was wondering if someone in this group who may have integrated their WebDriver project with Cuanto had run into a similar issue.

-Nagesh

Mark Derricutt

unread,
Jan 13, 2015, 3:56:48 PM1/13/15
to testng...@googlegroups.com

On 14 Jan 2015, at 7:23, Nagesh wrote:

Yes, but I can't figure out where, since I'm using the TestNgListener that comes with Cuanto's jars. I was wondering if someone in this group who may have integrated their WebDriver project with Cuanto had run into a similar issue.

I'd suggest running the tests with a debugger - either with:

$ mvn test -Dmaven.surefire.debug

or

$ mvnDebug test ( if the NPE is tripping up in surefire plugin itself, and not the test execution )

Connect to it via say Eclipse or IntelliJ and step into the source, see whats null and trace back from there.

Mark

--
Mark Derricutt
http://www.theoryinpractice.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt

signature.asc

Nagesh

unread,
Feb 25, 2015, 6:00:27 PM2/25/15
to testng...@googlegroups.com
Just wanted to circle back to this thread and post the solution for anyone who might run into this issue in the future. Cuanto also needs another parameter to be set "-Dcuanto.includeConfigDuration=true" in addition to the other parameters that I had set above.

-Nagesh
Reply all
Reply to author
Forward
0 new messages