Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.tagging.presets.items;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
---|
5 | import static org.junit.jupiter.api.Assertions.assertFalse;
|
---|
6 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
---|
7 |
|
---|
8 | import java.util.Collections;
|
---|
9 |
|
---|
10 | import javax.swing.JPanel;
|
---|
11 |
|
---|
12 | import org.junit.jupiter.api.BeforeAll;
|
---|
13 | import org.junit.jupiter.api.Test;
|
---|
14 | import org.openstreetmap.josm.JOSMFixture;
|
---|
15 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Unit tests of {@link Space} class.
|
---|
19 | */
|
---|
20 | class SpaceTest {
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Setup test.
|
---|
24 | */
|
---|
25 | @BeforeAll
|
---|
26 | public static void setUp() {
|
---|
27 | JOSMFixture.createUnitTestFixture().init();
|
---|
28 | }
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Unit test for {@link Space#addToPanel}.
|
---|
32 | */
|
---|
33 | @Test
|
---|
34 | void testAddToPanel() {
|
---|
35 | JPanel p = new JPanel();
|
---|
36 | assertEquals(0, p.getComponentCount());
|
---|
37 | assertFalse(new Space().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));
|
---|
38 | assertTrue(p.getComponentCount() > 0);
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.