source: josm/trunk/test/unit/org/openstreetmap/josm/gui/io/ActionFlagsTableCellTest.java@ 17531

Last change on this file since 17531 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.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.io;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertNotNull;
6import static org.junit.jupiter.api.Assertions.assertTrue;
7
8import java.io.File;
9
10import javax.swing.JTable;
11
12import org.junit.jupiter.api.extension.RegisterExtension;
13import org.junit.jupiter.api.Test;
14import org.openstreetmap.josm.data.osm.DataSet;
15import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer;
16import org.openstreetmap.josm.gui.layer.OsmDataLayer;
17import org.openstreetmap.josm.testutils.JOSMTestRules;
18
19import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
20
21/**
22 * Unit tests of {@link ActionFlagsTableCell} class.
23 */
24class ActionFlagsTableCellTest {
25 /**
26 * Setup test.
27 */
28 @RegisterExtension
29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
30 public JOSMTestRules test = new JOSMTestRules();
31
32 /**
33 * Test of {@link ActionFlagsTableCell} class.
34 */
35 @Test
36 void testActionFlagsTableCell() {
37 JTable table = new JTable();
38 File file = new File("test");
39 String name = "layername";
40 AbstractModifiableLayer layer = new OsmDataLayer(new DataSet(), name, file);
41 SaveLayerInfo value = new SaveLayerInfo(layer);
42 ActionFlagsTableCell c = new ActionFlagsTableCell();
43 assertEquals(c, c.getTableCellEditorComponent(table, value, false, 0, 0));
44 assertEquals(c, c.getTableCellRendererComponent(table, value, false, false, 0, 0));
45 assertTrue(c.isCellEditable(null));
46 assertTrue(c.shouldSelectCell(null));
47 assertNotNull(c.getCellEditorValue());
48 assertTrue(c.stopCellEditing());
49 }
50}
Note: See TracBrowser for help on using the repository browser.