KentBeck/junit — Issue #371: Why JUnit test running in both initial JVM and the forked JVM?
Author: bingy1234
Created: 2012-01-06 15:01:19+00:00
State: open

Below two stacks from the initial JVM and forked JVM seems saying the test code executed twice instead of only one time. I wonder why it is not only executed in the forked one.

JUnit test config: fork=true, forkmode=perTest

at oracle.security.jps.internal.policystore.PolicyUtil.getPDPService(PolicyUtil.java:3099)
at oracle.security.jps.internal.policystore.PolicyDelegationController.(PolicyDelegationController.java:164)
at oracle.security.jps.internal.policystore.JavaPolicyProvider.(JavaPolicyProvider.java:369)
at oracle.security.jps.service.policystore.PolicyStoreTestCaseBase.(PolicyStoreTestCaseBase.java:39)
at oracle.security.jps.service.policystore.JpsJavaPolicyPreTestCase.(JpsJavaPolicyPreTestCase.java:145)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at junit.framework.TestSuite.createTest(TestSuite.java:65)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
at junit.framework.TestSuite.(TestSuite.java:146)
at oracle.security.jps.service.policystore.JpsJavaPolicyPreTestCase.suite(JpsJavaPolicyPreTestCase.java:603)
at devtest.JpsUnitPreTestSuite.suite(JpsUnitPreTestSuite.java:66)
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 org.testlogic.testrunner.ant.junit4.JUnitTestRunner.createTestSuite(JUnitTestRunner.java:929)
at org.testlogic.testrunner.ant.junit4.TLJUnitTestRunner.createTestSuite(TLJUnitTestRunner.java:217)
at org.testlogic.testrunner.ant.junit4.JUnitTestRunner.run(JUnitTestRunner.java:366)
at org.testlogic.testrunner.ant.junit4.TLJUnitTestRunner.run(TLJUnitTestRunner.java:111)
at org.testlogic.testrunner.ant.junit4.JUnitTask.runTestInVM(JUnitTask.java:1319)
at org.testlogic.testrunner.ant.junit4.TLJUnitTask.runInitMode(TLJUnitTask.java:327)
at org.testlogic.testrunner.ant.junit4.TLJUnitTask.run(TLJUnitTask.java:120)
at org.testlogic.impl.ant.JITInitModeListener.runTestTaskInInitMode(JITInitModeListener.java:91)
at org.testlogic.impl.ant.JITInitModeListener.taskStarted(JITInitModeListener.java:121)
at org.apache.tools.ant.Project.fireTaskStarted(Project.java:2131)
at org.apache.tools.ant.Task.perform(Task.java:345)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1307)
at org.testlogic.impl.ant.AntTaskUtils.simulateAntCall(AntTaskUtils.java:273)
at org.testlogic.impl.ant.executionPlan.model.CommandRunnable.runCommand(CommandRunnable.java:178)
at org.testlogic.impl.ant.executionPlan.model.CommandRunnable.run(CommandRunnable.java:105)
at java.lang.Thread.run(Thread.java:662)

and

at oracle.security.jps.internal.policystore.PolicyUtil.getPDPService(PolicyUtil.java:3099)
at oracle.security.jps.internal.policystore.PolicyDelegationController.(PolicyDelegationController.java:164)
at oracle.security.jps.internal.policystore.JavaPolicyProvider.(JavaPolicyProvider.java:369)
at oracle.security.jps.service.policystore.PolicyStoreTestCaseBase.(PolicyStoreTestCaseBase.java:39)
at oracle.security.jps.service.policystore.JpsJavaPolicyPreTestCase.(JpsJavaPolicyPreTestCase.java:145)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at junit.framework.TestSuite.createTest(TestSuite.java:65)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
at junit.framework.TestSuite.(TestSuite.java:146)
at oracle.security.jps.service.policystore.JpsJavaPolicyPreTestCase.suite(JpsJavaPolicyPreTestCase.java:603)
at devtest.JpsUnitPreTestSuite.suite(JpsUnitPreTestSuite.java:66)
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 org.testlogic.testrunner.ant.junit4.JUnitTestRunner.createTestSuite(JUnitTestRunner.java:929)
at org.testlogic.testrunner.ant.junit4.TLJUnitTestRunner.createTestSuite(TLJUnitTestRunner.java:217)
at org.testlogic.testrunner.ant.junit4.JUnitTestRunner.run(JUnitTestRunner.java:366)
at org.testlogic.testrunner.ant.junit4.TLJUnitTestRunner.run(TLJUnitTestRunner.java:111)
at org.testlogic.testrunner.ant.junit4.JUnitTestRunner.launch(JUnitTestRunner.java:869)
at org.testlogic.testrunner.ant.junit4.JUnitTestRunner.main(JUnitTestRunner.java:714)
at org.testlogic.testrunner.ant.junit4.TLJUnitTestRunner.main(TLJUnitTestRunner