Last change
on this file since 11691 was 10067, checked in by Don-vip, 8 years ago |
see #12652 - rework bug report classes to improve unit tests coverage
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools.bugreport;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertFalse;
|
---|
5 | import static org.junit.Assert.assertNotNull;
|
---|
6 | import static org.junit.Assert.assertNull;
|
---|
7 |
|
---|
8 | import org.junit.Before;
|
---|
9 | import org.junit.Test;
|
---|
10 | import org.openstreetmap.josm.JOSMFixture;
|
---|
11 | import org.openstreetmap.josm.actions.ShowStatusReportAction;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Unit tests of {@link BugReportSender} class.
|
---|
15 | */
|
---|
16 | public class BugReportSenderTest {
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Setup tests.
|
---|
20 | */
|
---|
21 | @Before
|
---|
22 | public void setUp() {
|
---|
23 | JOSMFixture.createUnitTestFixture().init();
|
---|
24 | }
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Unit test for {@link BugReportSender#BugReportSender}.
|
---|
28 | * @throws InterruptedException if the thread is interrupted
|
---|
29 | */
|
---|
30 | @Test
|
---|
31 | public void testBugReportSender() throws InterruptedException {
|
---|
32 | BugReportSender sender = BugReportSender.reportBug(ShowStatusReportAction.getReportHeader());
|
---|
33 | assertNotNull(sender);
|
---|
34 | synchronized (sender) {
|
---|
35 | while (sender.isAlive()) {
|
---|
36 | sender.wait();
|
---|
37 | }
|
---|
38 | }
|
---|
39 | assertFalse(sender.isAlive());
|
---|
40 | assertNull(sender.getErrorMessage(), sender.getErrorMessage());
|
---|
41 | }
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.