Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JUnit Test Runner Fork Mode(Does the Eclipse JUnit test runner/launcher support forkMode similar to the Ant JUnit test runner?)
JUnit Test Runner Fork Mode [message #1009294] Thu, 14 February 2013 21:04 Go to next message
John Hyun is currently offline John HyunFriend
Messages: 1
Registered: February 2013
Junior Member
I guess the description says it all. Does the Eclipse JUnit test runner/launcher support the forkMode option similar to the Ant JUnit test runner task? I'm assuming it doesn't because I don't see an option for it.

My use case is that I'm writing some tests for legacy code that uses singletons and there is no good way for me to reset the state of the system except to run each test in a separate jvm. When running the tests in our Ant build the tests succeed because we use the forkMode option. When running the tests in eclipse we run into problems because each test is run in the same jvm. We could of course manually run the tests from Ant each time, but it's just too easy to run it through the built in test runner.

I did a search and at least one person on StackOverflow is requesting the same feature.

stackoverflow.com/questions/12933565/junit-fork-mode-in-java-classes

Also, it seems like there is a somewhat related Eclipse bugzilla item for this, but it is specifically for the tycho/surefire integration? Not what this is:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=380171

My search also shows that IntelliJ supports this. I use Eclipse, but I'm just sayin...

blogs.jetbrains.com/idea/2011/04/fork-your-tests-with-intellij-idea-105-eap-build-106447/

-John

P.S. My first post here so sorry if I violated any etiquette rules. Also, I can't seem to post external urls until I have 5 posts under my belt. That's why the urls above are mangled.
Re: JUnit Test Runner Fork Mode [message #1009549 is a reply to message #1009294] Fri, 15 February 2013 09:54 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3801
Registered: July 2009
Senior Member
On 14.02.2013 22:05, John Hyun wrote:
> I guess the description says it all. Does the Eclipse JUnit test
> runner/launcher support the forkMode option similar to the Ant JUnit
> test runner task? I'm assuming it doesn't because I don't see an
> option for it.
There's no fork mode. The only thing that's there is
junit.extensions.ActiveTestSuite which allows to run tests in parallel,
but that won't work to test your singletons.

Dani
>
> My use case is that I'm writing some tests for legacy code that uses
> singletons and there is no good way for me to reset the state of the
> system except to run each test in a separate jvm. When running the
> tests in our Ant build the tests succeed because we use the forkMode
> option. When running the tests in eclipse we run into problems because
> each test is run in the same jvm. We could of course manually run the
> tests from Ant each time, but it's just too easy to run it through the
> built in test runner.
>
> I did a search and at least one person on StackOverflow is requesting
> the same feature.
>
> stackoverflow.com/questions/12933565/junit-fork-mode-in-java-classes
>
> Also, it seems like there is a somewhat related Eclipse bugzilla item
> for this, but it is specifically for the tycho/surefire integration?
> Not what this is:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=380171
>
> My search also shows that IntelliJ supports this. I use Eclipse, but
> I'm just sayin...
>
> blogs.jetbrains.com/idea/2011/04/fork-your-tests-with-intellij-idea-105-eap-build-106447/
>
>
> -John
>
> P.S. My first post here so sorry if I violated any etiquette rules.
> Also, I can't seem to post external urls until I have 5 posts under my
> belt. That's why the urls above are mangled.
Previous Topic:Parser
Next Topic:Problem with eclipse installation
Goto Forum:
  


Current Time: Thu Dec 18 22:38:14 GMT 2014

Powered by FUDForum. Page generated in 0.01835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software