From d5e981af7ecaf8bb88b73ed204cfa28237c8188c Mon Sep 17 00:00:00 2001 From: Sampo Niskanen Date: Sat, 4 May 2013 21:11:03 +0300 Subject: [PATCH] Fix failing unit test --- .../net/sf/openrocket/util/TestMutex.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/core/test/net/sf/openrocket/util/TestMutex.java b/core/test/net/sf/openrocket/util/TestMutex.java index aa220a510..30ec34911 100644 --- a/core/test/net/sf/openrocket/util/TestMutex.java +++ b/core/test/net/sf/openrocket/util/TestMutex.java @@ -5,6 +5,8 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; 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.Test; @@ -14,6 +16,25 @@ public class TestMutex { @Before public void setup() { 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