Files
JIMRI/java/test/jmri/jmrit/display/controlPanelEditor/shape/DrawRectangleTest.java
T
2026-06-17 14:00:51 +02:00

62 lines
1.6 KiB
Java

package jmri.jmrit.display.controlPanelEditor.shape;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import jmri.jmrit.display.EditorScaffold;
import jmri.util.JUnitUtil;
import jmri.util.ThreadingUtil;
import jmri.util.junit.annotations.DisabledIfHeadless;
import org.junit.jupiter.api.*;
/**
*
* @author Paul Bender Copyright (C) 2017
*/
@DisabledIfHeadless
public class DrawRectangleTest {
private EditorScaffold editor;
@Test
public void testCTor() {
ThreadingUtil.runOnGUI( () -> {
editor.pack();
editor.setVisible(true);
});
DrawRectangle t = new DrawRectangle("newShape", "Rectangle", null, editor, false);
assertNotNull( t, "exists");
JUnitUtil.dispose(t);
}
@Test
public void testCTorEdit() {
ThreadingUtil.runOnGUI( () -> {
editor.pack();
editor.setVisible(true);
});
PositionableRectangle ps = new PositionableRectangle(editor);
DrawRectangle t = new DrawRectangle("editShape", "Rectangle", ps, editor, true);
assertNotNull( t, "exists");
JUnitUtil.dispose(t);
}
@BeforeEach
public void setUp() {
JUnitUtil.setUp();
JUnitUtil.resetProfileManager();
editor = new EditorScaffold();
}
@AfterEach
public void tearDown() {
JUnitUtil.dispose(editor);
editor = null;
JUnitUtil.deregisterBlockManagerShutdownTask();
JUnitUtil.tearDown();
}
// private static final Logger log = LoggerFactory.getLogger(DrawRectangleTest.class);
}