3

I have some unit tests (yes, perhaps more integration-ey tests !) that I would like to spin up another jvm, and then run the test code from that "other" JVM (and wait for it to finish, collecting the results). Am interested if there is an easy/reliable way of doing that with junit (eg inherit the classpath of what is needed etc...)

Any ideas appreciated.

Michael Neale
  • 19,248
  • 19
  • 77
  • 109

3 Answers3

1

Ant will do this for you:

<junit fork="yes">
    <jvmarg value="-Djava.compiler=NONE"/>
    ...
</junit>
martin clayton
  • 76,436
  • 32
  • 213
  • 198
dfa
  • 114,442
  • 31
  • 189
  • 228
0

Have a read through the JUnit Tools pages. There entries for tools etc that support system testing, integration testing, etc in various forms.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
0

Just did that exact thing using the methods explained in this question: Executing a Java application in a separate process

Community
  • 1
  • 1
Epaga
  • 38,231
  • 58
  • 157
  • 245