Help - Test NG, IntelliJ and different versions of Test NG, Reporter

847 views
Skip to first unread message

AnthonyK

unread,
Feb 23, 2012, 5:18:06 AM2/23/12
to testng-users
Hi All,

relatively new to TestNG but using it with Selenium Web Driver and
using it with IntelliJ which i like for its user interface and ease of
use etc.

However, i'm trying to figure out how to do the following......

1. How can i change the reporter so that i use the latest one with the
latest TestNG version etc?

2. When i change the version of TestNG and run my test i get the
following......for each test method executed......
java.net.SocketException: Software caused connection abort: socket
write error
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.writeNonProxyDesc(ObjectOutputStream.java:
1249)
at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:
1203)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:
1387)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
1150)
at
java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:
1538)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:
329)
at
org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:
25)
at
org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:
44)
at
org.testng.remote.strprotocol.RemoteTestListener.onTestStart(RemoteTestListener.java:
49)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1891)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1866)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:671)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:893)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1218)
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:768)
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:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
at org.testng.TestNG.run(TestNG.java:1022)
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)


I can see TestNG references in here so I'm not sure what's going on?!
Anybody any ideas? I'm just including testng-6.4.1beta.jar in my
libraries. Do i need to include something else also?

I have tried this on IntelliJ v10 and v11.

I'm getting the feeling that IntelliJ is so tightly integrated with
TestNG that i cant do any of the above?!


Thanks
Antk

Cédric Beust ♔

unread,
Feb 23, 2012, 1:25:27 PM2/23/12
to testng...@googlegroups.com

On Thu, Feb 23, 2012 at 2:18 AM, AnthonyK <akear...@gmail.com> wrote:
1. How can i change the reporter so that i use the latest one with the
latest TestNG version etc?

Use the latest version (6.4). I don't think IDEA ships with it yet, but it might be possible to tell IDEA to use your own testng.jar, although this might lead to a few problems. I suggest asking this on the IDEA forums.

-- 
Cédric




Mark Derricutt

unread,
Feb 23, 2012, 6:10:34 PM2/23/12
to testng...@googlegroups.com
Unless things have changed super-drastically since I last did anything on the plugin, you should be able to just replace the testng.jar inside the plugin directory.

It also uses the version in project from memory - so if you just update that you should be good ( or update your maven pom etc. )

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree



2012/2/24 Cédric Beust ♔ <ced...@beust.com>



--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Cédric Beust ♔

unread,
Feb 23, 2012, 6:26:18 PM2/23/12
to testng...@googlegroups.com
Be aware that it might break if you do that because the remote runner and the IDE will then try to communicate with what could be two different versions of the protocol (I know for a fact that you can't do this right now with TestNG 6.4, but JetBrains already has a 6.4-ready version which will ship with the next EAP).

-- 
Cédric

Mark Derricutt

unread,
Feb 23, 2012, 6:35:30 PM2/23/12
to testng...@googlegroups.com
Ahh that explains the strange errors I saw in the last EAP.  Fixed in the current builds  tho, not sure if that EAP is out yet tho.


--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree



2012/2/24 Cédric Beust ♔ <ced...@beust.com>
Be aware that it might break if you do that because the remote runner and the IDE will then try to communicate with what could be two different versions of the protocol (I know for a fact that you can't do this right now with TestNG 6.4, but JetBrains already has a 6.4-ready version which will ship with the next EAP).

Mark Derricutt

unread,
Feb 23, 2012, 11:49:00 PM2/23/12
to testng...@googlegroups.com
Correction - I just rechecked with the current build and theres still a Broken Pipe exception being sent to the console.

Turns out I'd updated to 6.4 on one of my feature branches and am running a older build on the main branch :(

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree



AnthonyK

unread,
Feb 24, 2012, 7:32:32 AM2/24/12
to testng-users
Ok,

so i downloaded TestNG 6.4 and added the testng-6.4.jar into my
'Project Structure'->'Modules'->'Dependencies' so i assume i'm now
using the latest version? All my tests pas and no output like before
in my debugger/console so all looks good with using testng-6.4.jar.


From you thread above as you saying there is a problem with the TestNG
IntelliJ plug ?


Thanks
Anthony

Mark Derricutt

unread,
Feb 24, 2012, 6:53:54 PM2/24/12
to testng...@googlegroups.com
I've just been talking to Anna at Jetbrains, seems there -was- a build that updated its internal version to 6.4 which resolved the problem using 6.4. However, because the problem stems from a change in the protocol this then breaks using earlier versions of TestNG so the change was reverted.

The heart of the problem is that the IntelliJ plugin uses the internal testng version for its UI, but uses the projects testng version for actually running the tests ( this way you get consistent test behavior between maven/ant/idea builds, but it does mean a protocol change like 6.4 introduced can cause breakages ).

Anna mentioned she'll be working on a testng-independent protocol next week to solve the issue, there doesn't appear to be a Youtrack ticket for this yet but I'll keep monitoring the state of this problem and keep the list updated.

Mark  

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree


Cédric Beust ♔

unread,
Feb 24, 2012, 7:26:40 PM2/24/12
to testng...@googlegroups.com
Yes, I've had numerous exchanges with Anna about this, I think there is still a disconnect.

Using the user testng.jar by default is unsustainable. It's not just the protocol that can change from one version to the next, it's signatures of internal methods. You just can't have the IDE use testng v1 spawn a remote runner with testng v2, it's going to break most of the time.

I do it the other way around with Eclipse: by default, it's always the internal testng.jar that's used, and adventurous users can override this if they need to use an older or newer testng.jar. I don't think I've managed to convince Anna that it's the right approach.

-- 
Cédric




Reply all
Reply to author
Forward
0 new messages