Changeset 10886 in josm for trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java
- Timestamp:
- 2016-08-24T00:18:37+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java
r10819 r10886 2 2 package org.openstreetmap.josm.tools.bugreport; 3 3 4 import static org.junit.Assert.assertFalse;4 import java.util.concurrent.CountDownLatch; 5 5 6 import org.junit. Before;6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.JOSMFixture; 8 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 9 11 10 12 /** … … 12 14 */ 13 15 public class BugReportExceptionHandlerTest { 14 15 16 /** 16 * Setup tests.17 * No dependencies 17 18 */ 18 @Before 19 public void setUp() { 20 JOSMFixture.createUnitTestFixture().init(true); 21 } 19 @Rule 20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules(); 22 22 23 23 /** 24 24 * Unit test for {@link BugReportExceptionHandler#handleException} method. 25 * @throws InterruptedException if the current thread is interrupted while waiting 25 26 */ 26 27 @Test 27 public void testHandleException() { 28 public void testHandleException() throws InterruptedException { 29 CountDownLatch latch = new CountDownLatch(1); 30 BugReportQueue.getInstance().addBugReportHandler(e -> {latch.countDown(); return false;}); 28 31 BugReportExceptionHandler.handleException(new Exception("testHandleException")); 29 assertFalse(BugReportExceptionHandler.exceptionHandlingInProgress());32 latch.await(); 30 33 } 31 34 }
Note:
See TracChangeset
for help on using the changeset viewer.