From 8d90a540e83114ae1e11f250a3300ee51b85c001 Mon Sep 17 00:00:00 2001 From: Kevin Ruland Date: Sun, 15 Jan 2012 02:29:34 +0000 Subject: [PATCH] Fix unit test setup which has probably been broken since the ExceptionHandler was refactored to a static object stored in the Applicaiton. --- .../l10n/TestExceptionSuppressingTranslator.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/test/net/sf/openrocket/l10n/TestExceptionSuppressingTranslator.java b/core/test/net/sf/openrocket/l10n/TestExceptionSuppressingTranslator.java index 153b921fb..3296c8345 100644 --- a/core/test/net/sf/openrocket/l10n/TestExceptionSuppressingTranslator.java +++ b/core/test/net/sf/openrocket/l10n/TestExceptionSuppressingTranslator.java @@ -1,14 +1,20 @@ package net.sf.openrocket.l10n; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.util.MissingResourceException; +import net.sf.openrocket.gui.main.SwingExceptionHandler; +import net.sf.openrocket.startup.Application; + import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.auto.Mock; import org.jmock.integration.junit4.JMock; import org.jmock.integration.junit4.JUnit4Mockery; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,6 +22,10 @@ import org.junit.runner.RunWith; public class TestExceptionSuppressingTranslator { Mockery context = new JUnit4Mockery(); + @Before + public void setupExceptionHandler() { + Application.setExceptionHandler( new SwingExceptionHandler() ); + } @Mock Translator translator;