Monday, March 26, 2012

Idea 11 does not supprot TestNG 6.4

In one of my project I've started using TestNG as unit testing framework. The project itself is Maven based. So, obviously I added appropriate dependency to my pom file:
        <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.4</version>
<scope>test</scope>
</dependency>
As you can see I've used the latest TestNG version available at this time, which is 6.4.
But when I was trying to run any test from Idea, I saw following error:
java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1838)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1747)
    at java.io.ObjectOutputStream.(ObjectOutputStream.java:226)
    at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
    at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
    at org.testng.remote.RemoteTestNG$RemoteSuiteListener.onFinish(RemoteTestNG.java:248)
    at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:200)
    at org.testng.SuiteRunner.run(SuiteRunner.java:243)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1170)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1095)
    at org.testng.TestNG.run(TestNG.java:1007)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
The error is strange and there is no my code in the stack trace. Also, test was finishing fine if run by maven. This hints that there is something wrong. And this something is IDE-related.
I used a linux answering machine to find out what is wrong. The answer was found very quickly: Idea 11 does not support TestNG 6.4. The workaround is to downgrade TestNG version to 6.3.1. I did just that and the problem vanished :)

P.S. I'm still confident that Idea is the best java IDE :p

2 comments:

mrduguo said...

just to confirm idea 11.1 still not support latest testng 6.5.1

Thanks

Andriy said...

2 mrduguo:

Thanks for update!