I have a need to launch the WindowTeseter test and pause the test for some period of time. The way I do it is to put the main thread to sleep with the
following call:
- Code: Select all
Thread.sleep(Long.MAX_VALUE);
Please refer attached source and test code for details.
During the time the test is being paused, I can interact with the main swing application as if I launch it as a standalone application. This is a great.
However, while the test is being paused I realize that it still consumes up to 60% of my CPU usage. Below is thread dump result which shows the thread that may be involved:
"main" prio=6 tid=0x003a7000 nid=0x1650 runnable [0x0090f000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.hashCode(Native Method)
at java.util.WeakHashMap.get(Unknown Source)
at abbot.tester.WindowTracker.getRootWindows(WindowTracker.java:188)
- locked <0x27fbf878> (a java.util.WeakHashMap)
at abbot.finder.AWTHierarchy.getRoots(AWTHierarchy.java:119)
at com.windowtester.runtime.swing.internal.junit.SwingExecutionMonitor.terminateWaitForFinish(SwingExecutionMonitor.java:124)
at com.windowtester.internal.runtime.junit.core.AbstractExecutionMonitor.waitUntilFinished(AbstractExecutionMonitor.java:203)
at com.windowtester.internal.runtime.junit.core.SequenceRunner.waitUntilFinished(SequenceRunner.java:69)
at com.windowtester.internal.runtime.junit.core.SequenceRunner.exec(SequenceRunner.java:53)
at com.windowtester.runtime.common.UITestCaseCommon.runUITest(UITestCaseCommon.java:147)
at com.windowtester.runtime.common.UITestCaseCommon.runBare(UITestCaseCommon.java:128)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Can someone look into this issue and let me know how to resolve it? I appreciate your time and effort!
Thanks in advance!
-keico