Last change
on this file since 10886 was 10886, checked in by Don-vip, 8 years ago |
fix #13434 - Increase bug report test coverage (patch by michael2402) - gsoc-core
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
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.Rule;
|
---|
7 | import org.junit.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 | public class BugReportExceptionHandlerTest {
|
---|
16 | /**
|
---|
17 | * No dependencies
|
---|
18 | */
|
---|
19 | @Rule
|
---|
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 | public void testHandleException() throws InterruptedException {
|
---|
29 | CountDownLatch latch = new CountDownLatch(1);
|
---|
30 | BugReportQueue.getInstance().addBugReportHandler(e -> {latch.countDown(); return false;});
|
---|
31 | BugReportExceptionHandler.handleException(new Exception("testHandleException"));
|
---|
32 | latch.await();
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.