Fix failing unit test

This commit is contained in:
Sampo Niskanen 2013-05-04 21:11:03 +03:00
parent bb916d1889
commit d5e981af7e

View File

@ -5,6 +5,8 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import net.sf.openrocket.startup.Application;
import net.sf.openrocket.startup.ExceptionHandler;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -14,6 +16,25 @@ public class TestMutex {
@Before @Before
public void setup() { public void setup() {
System.setProperty("openrocket.debug.safetycheck", "true"); System.setProperty("openrocket.debug.safetycheck", "true");
// Set exception handler that does nothing (called by SafetyMutex)
Application.setExceptionHandler(new ExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
}
@Override
public void handleErrorCondition(Throwable exception) {
}
@Override
public void handleErrorCondition(String message, Throwable exception) {
}
@Override
public void handleErrorCondition(String message) {
}
});
} }
@Test @Test