source: josm/trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java@ 17275

Last change on this file since 17275 was 17275, checked in by Don-vip, 3 years ago

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.tagging.presets.items;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertTrue;
6
7import java.util.Collections;
8
9import javax.swing.JPanel;
10
11import org.junit.jupiter.api.extension.RegisterExtension;
12import org.junit.jupiter.api.Test;
13import org.openstreetmap.josm.data.osm.OsmPrimitive;
14import org.openstreetmap.josm.testutils.JOSMTestRules;
15
16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
17
18/**
19 * Unit tests of {@link Text} class.
20 */
21class TextTest {
22
23 /**
24 * Setup test.
25 */
26 @RegisterExtension
27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
28 public JOSMTestRules test = new JOSMTestRules().main();
29
30 /**
31 * Unit test for {@link Text#addToPanel}.
32 */
33 @Test
34 void testAddToPanel() {
35 JPanel p = new JPanel();
36 assertEquals(0, p.getComponentCount());
37 assertTrue(new Text().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));
38 assertTrue(p.getComponentCount() > 0);
39 }
40}
Note: See TracBrowser for help on using the repository browser.