Skip to content

Instantly share code, notes, and snippets.

@tobyweston
Created May 28, 2012 15:56
Show Gist options
  • Save tobyweston/2819829 to your computer and use it in GitHub Desktop.
Save tobyweston/2819829 to your computer and use it in GitHub Desktop.
When running genuine multithreaded test with JMock, I don't want to synchronise
Name: Interrupter-Thread-1
State: BLOCKED on java.lang.Object@381eb0c6 owned by: main
Total blocked: 1 Total waited: 0
Stack trace:
org.jmock.lib.concurrent.Synchroniser.synchroniseInvocation(Synchroniser.java:82)
org.jmock.lib.concurrent.Synchroniser.access$000(Synchroniser.java:23)
org.jmock.lib.concurrent.Synchroniser$1.invoke(Synchroniser.java:74)
org.jmock.lib.legacy.ClassImposteriser$4.invoke(ClassImposteriser.java:136)
com.google.code.tempusfugit.temporal.Clock$$EnhancerByCGLIB$$489249d6.create(<generated>)
com.google.code.tempusfugit.temporal.StopWatch.markAndGetTotalElapsedTime(StopWatch.java:45)
com.google.code.tempusfugit.temporal.Timeout.hasExpired(Timeout.java:48)
com.google.code.tempusfugit.temporal.WaitFor.waitUntil(WaitFor.java:54)
com.google.code.tempusfugit.concurrency.Interrupter$1.run(Interrupter.java:59)
java.lang.Thread.run(Thread.java:662)
Name: main
State: TIMED_WAITING
Total blocked: 2 Total waited: 1
Stack trace:
java.lang.Thread.sleep(Native Method)
com.google.code.tempusfugit.concurrency.DefaultTimeoutableCompletionServiceTest$8.invoke(DefaultTimeoutableCompletionServiceTest.java:192)
org.jmock.internal.InvocationExpectation.invoke(InvocationExpectation.java:159)
org.jmock.internal.InvocationDispatcher.dispatch(InvocationDispatcher.java:81)
org.jmock.Mockery.dispatch(Mockery.java:250)
org.jmock.Mockery.access$100(Mockery.java:46)
org.jmock.Mockery$MockObject.invoke(Mockery.java:290)
org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27)
org.jmock.internal.FakeObjectMethods.invoke(FakeObjectMethods.java:38)
org.jmock.lib.concurrent.Synchroniser.synchroniseInvocation(Synchroniser.java:82)
- locked java.lang.Object@381eb0c6
org.jmock.lib.concurrent.Synchroniser.access$000(Synchroniser.java:23)
org.jmock.lib.concurrent.Synchroniser$1.invoke(Synchroniser.java:74)
org.jmock.lib.legacy.ClassImposteriser$4.invoke(ClassImposteriser.java:136)
$java.util.concurrent.ExecutorCompletionService$$EnhancerByCGLIB$$c6b12249.take(<generated>)
com.google.code.tempusfugit.concurrency.DefaultTimeoutableCompletionService.waitFor(DefaultTimeoutableCompletionService.java:71)
com.google.code.tempusfugit.concurrency.DefaultTimeoutableCompletionService.submit(DefaultTimeoutableCompletionService.java:57)
com.google.code.tempusfugit.concurrency.DefaultTimeoutableCompletionServiceTest.timeoutReturnsPartialResults(DefaultTimeoutableCompletionServiceTest.java:118)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
org.jmock.integration.junit4.JMock$1.evaluate(JMock.java:52)
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
org.junit.runners.ParentRunner.run(ParentRunner.java:292)
org.junit.runner.JUnitCore.run(JUnitCore.java:157)
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment