42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package jmri.jmrix.oaktree;
|
|
|
|
import java.awt.GraphicsEnvironment;
|
|
|
|
import jmri.util.JUnitUtil;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.jupiter.api.*;
|
|
import org.junit.Assume;
|
|
|
|
/**
|
|
* Test simple functioning of OakTreeMenu
|
|
*
|
|
* @author Paul Bender Copyright (C) 2016
|
|
*/
|
|
public class OakTreeMenuTest {
|
|
|
|
private SerialTrafficController tc = null;
|
|
private OakTreeSystemConnectionMemo m = null;
|
|
|
|
@Test
|
|
public void testCtor() {
|
|
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
|
|
OakTreeMenu action = new OakTreeMenu(m);
|
|
Assert.assertNotNull("exists", action);
|
|
}
|
|
|
|
@BeforeEach
|
|
public void setUp() {
|
|
JUnitUtil.setUp();
|
|
m = new OakTreeSystemConnectionMemo();
|
|
tc = new SerialTrafficControlScaffold(m);
|
|
m.setSystemPrefix("ABC");
|
|
m.setTrafficController(tc); // important for successful getTrafficController()
|
|
}
|
|
|
|
@AfterEach
|
|
public void tearDown() { JUnitUtil.clearShutDownManager(); // put in place because AbstractMRTrafficController implementing subclass was not terminated properly
|
|
JUnitUtil.tearDown();
|
|
}
|
|
}
|