final String previousThreadSafetyCheck = setEasyMockProperty(ENABLE_THREAD_SAFETY_CHECK_BY_DEFAULT,
Boolean.TRUE.toString());
final String previousThreadSafe = setEasyMockProperty(NOT_THREAD_SAFE_BY_DEFAULT, Boolean.TRUE
.toString());
try {
final MocksBehavior behavior = new MocksBehavior(true);
assertFalse(behavior.isThreadSafe());
final Thread t = new Thread() {
@Override
public void run() {
behavior.checkThreadSafety();
}
};
t.start();
t.join();
try {
behavior.checkThreadSafety();
fail("Shouldn't work");
} catch (final AssertionErrorWrapper e) {
}