From 7556a882dbfe0629fba911311c882299f0e920f3 Mon Sep 17 00:00:00 2001 From: kruland2607 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. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@355 180e2498-e6e9-4542-8430-84ac67f01cd8 --- .../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 153b921f..3296c834 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; -- 2.47.2