Index: test/org/jmock/test/unit/lib/SingleThreadedImposteriser.java =================================================================== --- test/org/jmock/test/unit/lib/SingleThreadedImposteriser.java (revision 1350) +++ test/org/jmock/test/unit/lib/SingleThreadedImposteriser.java (working copy) @@ -1,38 +0,0 @@ -package org.jmock.test.unit.lib; - -import java.util.ConcurrentModificationException; - -import org.jmock.api.Imposteriser; -import org.jmock.api.Invocation; -import org.jmock.api.Invokable; -import org.jmock.lib.DecoratingImposteriser; -import org.jmock.lib.concurrent.SynchronisingImposteriser; - -public class SingleThreadedImposteriser extends DecoratingImposteriser { - private final Thread testThread; - - public SingleThreadedImposteriser(Imposteriser imposteriser) { - super(imposteriser); - this.testThread = Thread.currentThread(); - } - - @Override - protected Object applyInvocation(Invokable imposter, Invocation invocation) - throws Throwable - { - checkRunningOnTestThread(); - return imposter.invoke(invocation); - } - - private void checkRunningOnTestThread() { - if (Thread.currentThread() != testThread) { - reportError("the Mockery is not thread-safe: wrap an Imposteriser in a " + - SynchronisingImposteriser.class.getSimpleName() + " to ensure thread safety"); - } - } - - private void reportError(String error) { - System.err.println(error); - throw new ConcurrentModificationException(error); - } -} Index: src/org/jmock/lib/SingleThreadedImposteriser.java =================================================================== --- src/org/jmock/lib/SingleThreadedImposteriser.java (revision 0) +++ src/org/jmock/lib/SingleThreadedImposteriser.java (revision 0) @@ -0,0 +1,37 @@ +package org.jmock.lib; + +import java.util.ConcurrentModificationException; + +import org.jmock.api.Imposteriser; +import org.jmock.api.Invocation; +import org.jmock.api.Invokable; +import org.jmock.lib.concurrent.SynchronisingImposteriser; + +public class SingleThreadedImposteriser extends DecoratingImposteriser { + private final Thread testThread; + + public SingleThreadedImposteriser(Imposteriser imposteriser) { + super(imposteriser); + this.testThread = Thread.currentThread(); + } + + @Override + protected Object applyInvocation(Invokable imposter, Invocation invocation) + throws Throwable + { + checkRunningOnTestThread(); + return imposter.invoke(invocation); + } + + private void checkRunningOnTestThread() { + if (Thread.currentThread() != testThread) { + reportError("the Mockery is not thread-safe: wrap an Imposteriser in a " + + SynchronisingImposteriser.class.getSimpleName() + " to ensure thread safety"); + } + } + + private void reportError(String error) { + System.err.println(error); + throw new ConcurrentModificationException(error); + } +} Index: src/org/jmock/Mockery.java =================================================================== --- src/org/jmock/Mockery.java (revision 1350) +++ src/org/jmock/Mockery.java (working copy) @@ -27,7 +27,7 @@ import org.jmock.lib.CamelCaseNamingScheme; import org.jmock.lib.IdentityExpectationErrorTranslator; import org.jmock.lib.JavaReflectionImposteriser; -import org.jmock.test.unit.lib.SingleThreadedImposteriser; +import org.jmock.lib.SingleThreadedImposteriser; /** Index: build.xml =================================================================== --- build.xml (revision 1350) +++ build.xml (working copy) @@ -50,15 +50,29 @@ + + + + + + + + + @@ -79,15 +93,11 @@ - - - - @@ -151,10 +161,7 @@ - - - - +