64 lines
1.5 KiB
Java
64 lines
1.5 KiB
Java
package jmri.jmrit.logixng.expressions.swing;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
import jmri.util.JUnitUtil;
|
|
import jmri.jmrit.logixng.expressions.Hold;
|
|
import jmri.util.junit.annotations.DisabledIfHeadless;
|
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
/**
|
|
* Test HoldSwing
|
|
*
|
|
* @author Daniel Bergqvist 2018
|
|
*/
|
|
public class HoldSwingTest {
|
|
|
|
@Test
|
|
@DisabledIfHeadless
|
|
public void testCtor() {
|
|
|
|
HoldSwing t = new HoldSwing();
|
|
assertNotNull( t, "exists");
|
|
}
|
|
|
|
@Test
|
|
@DisabledIfHeadless
|
|
public void testPanel() {
|
|
|
|
HoldSwing t = new HoldSwing();
|
|
JPanel panel = t.getConfigPanel(new JPanel());
|
|
assertNotNull( panel, "exists");
|
|
}
|
|
|
|
@Test
|
|
@DisabledIfHeadless
|
|
public void testCreatePanel() {
|
|
|
|
assertNotNull( new HoldSwing().getConfigPanel(new JPanel()), "panel is not null");
|
|
assertNotNull( new HoldSwing().getConfigPanel(new Hold("IQDE1", null), new JPanel()), "panel is not null");
|
|
}
|
|
|
|
@BeforeEach
|
|
public void setUp() {
|
|
JUnitUtil.setUp();
|
|
JUnitUtil.resetInstanceManager();
|
|
JUnitUtil.resetProfileManager();
|
|
JUnitUtil.initConfigureManager();
|
|
JUnitUtil.initLogixNGManager();
|
|
}
|
|
|
|
@AfterEach
|
|
public void tearDown() {
|
|
jmri.jmrit.logixng.util.LogixNG_Thread.stopAllLogixNGThreads();
|
|
JUnitUtil.deregisterBlockManagerShutdownTask();
|
|
JUnitUtil.tearDown();
|
|
}
|
|
|
|
}
|