Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools.bugreport;
|
---|
3 |
|
---|
4 | import java.util.concurrent.CountDownLatch;
|
---|
5 |
|
---|
6 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
7 | import org.junit.jupiter.api.Test;
|
---|
8 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
9 |
|
---|
10 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Unit tests of {@link BugReportExceptionHandler} class.
|
---|
14 | */
|
---|
15 | class BugReportExceptionHandlerTest {
|
---|
16 | /**
|
---|
17 | * No dependencies
|
---|
18 | */
|
---|
19 | @RegisterExtension
|
---|
20 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
21 | public JOSMTestRules test = new JOSMTestRules();
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Unit test for {@link BugReportExceptionHandler#handleException} method.
|
---|
25 | * @throws InterruptedException if the current thread is interrupted while waiting
|
---|
26 | */
|
---|
27 | @Test
|
---|
28 | void testHandleException() throws InterruptedException {
|
---|
29 | CountDownLatch latch = new CountDownLatch(1);
|
---|
30 | BugReportQueue.getInstance().addBugReportHandler(e -> {
|
---|
31 | latch.countDown(); return false;
|
---|
32 | });
|
---|
33 | BugReportExceptionHandler.handleException(new Exception("testHandleException"));
|
---|
34 | latch.await();
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.