// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.gui.tagging.presets.items; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.Collections; import javax.swing.JPanel; import org.junit.BeforeClass; import org.junit.Test; import org.openstreetmap.josm.JOSMFixture; import org.openstreetmap.josm.data.osm.OsmPrimitive; /** * Unit tests of {@link Label} class. */ public class LabelTest { /** * Setup test. */ @BeforeClass public static void setUp() { JOSMFixture.createUnitTestFixture().init(); } /** * Unit test for {@link Label#addToPanel}. */ @Test public void testAddToPanel() { JPanel p = new JPanel(); assertEquals(0, p.getComponentCount()); assertTrue(new Label().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false)); assertTrue(p.getComponentCount() > 0); } }