use of jmri.Turnout in project JMRI by JMRI.
the class SE8cSignalHeadTest method testCtor1.
@Test
public void testCtor1() {
Turnout it11 = InstanceManager.turnoutManagerInstance().provideTurnout("11");
Turnout it12 = InstanceManager.turnoutManagerInstance().provideTurnout("12");
Assert.assertEquals("to low before", Turnout.UNKNOWN, it11.getCommandedState());
Assert.assertEquals("to high before", Turnout.UNKNOWN, it12.getCommandedState());
SE8cSignalHead s = new SE8cSignalHead(new NamedBeanHandle<Turnout>("11", it11), new NamedBeanHandle<Turnout>("12", it12));
Assert.assertEquals("system name", "IH:SE8C:\"11\";\"12\"", s.getSystemName());
Assert.assertEquals("to low", Turnout.UNKNOWN, it11.getCommandedState());
// dark
Assert.assertEquals("to high", Turnout.CLOSED, it12.getCommandedState());
}
use of jmri.Turnout in project JMRI by JMRI.
the class SE8cSignalHeadTest method testStateFollowingCtor2.
@Test
public void testStateFollowingCtor2() {
Turnout it11 = InstanceManager.turnoutManagerInstance().provideTurnout("11");
Turnout it12 = InstanceManager.turnoutManagerInstance().provideTurnout("12");
SE8cSignalHead s1 = new SE8cSignalHead(new NamedBeanHandle<Turnout>("11", it11), new NamedBeanHandle<Turnout>("12", it12), "user name");
// s2 should follow s1
SE8cSignalHead s2 = new SE8cSignalHead(new NamedBeanHandle<Turnout>("11", it11), new NamedBeanHandle<Turnout>("12", it12), "user name");
s1.setAppearance(SignalHead.DARK);
Assert.assertEquals("s2 after DARK", SignalHead.DARK, s2.getAppearance());
s1.setAppearance(SignalHead.RED);
Assert.assertEquals("s2 after RED", SignalHead.RED, s2.getAppearance());
s1.setAppearance(SignalHead.GREEN);
Assert.assertEquals("s2 after GREEN", SignalHead.GREEN, s2.getAppearance());
s1.setAppearance(SignalHead.YELLOW);
Assert.assertEquals("s2 after YELLOW", SignalHead.YELLOW, s2.getAppearance());
s1.setAppearance(SignalHead.DARK);
Assert.assertEquals("s2 after DARK", SignalHead.DARK, s2.getAppearance());
}
use of jmri.Turnout in project JMRI by JMRI.
the class SE8cSignalHeadTest method testDarkState.
@Test
public void testDarkState() {
Turnout it11 = InstanceManager.turnoutManagerInstance().provideTurnout("11");
Turnout it12 = InstanceManager.turnoutManagerInstance().provideTurnout("12");
SE8cSignalHead s = new SE8cSignalHead(new NamedBeanHandle<Turnout>("11", it11), new NamedBeanHandle<Turnout>("12", it12), "user name");
s.setAppearance(SignalHead.DARK);
Assert.assertEquals("to low after", Turnout.UNKNOWN, it11.getCommandedState());
Assert.assertEquals("to high after", Turnout.CLOSED, it12.getCommandedState());
}
use of jmri.Turnout in project JMRI by JMRI.
the class SE8cSignalHeadTest method testGreenState.
@Test
public void testGreenState() {
Turnout it11 = InstanceManager.turnoutManagerInstance().provideTurnout("11");
Turnout it12 = InstanceManager.turnoutManagerInstance().provideTurnout("12");
SE8cSignalHead s = new SE8cSignalHead(new NamedBeanHandle<Turnout>("11", it11), new NamedBeanHandle<Turnout>("12", it12), "user name");
s.setAppearance(SignalHead.GREEN);
Assert.assertEquals("to low after", Turnout.CLOSED, it11.getCommandedState());
Assert.assertEquals("to high after", Turnout.CLOSED, it12.getCommandedState());
}
use of jmri.Turnout in project JMRI by JMRI.
the class SE8cSignalHeadTest method testStateFollowingCtor3.
@Test
public void testStateFollowingCtor3() {
Turnout it11 = InstanceManager.turnoutManagerInstance().provideTurnout("11");
Turnout it12 = InstanceManager.turnoutManagerInstance().provideTurnout("12");
SE8cSignalHead s1 = new SE8cSignalHead(new NamedBeanHandle<Turnout>("11", it11), new NamedBeanHandle<Turnout>("12", it12), "user name");
// s2 should follow s1
SE8cSignalHead s2 = new SE8cSignalHead(11, "user name");
s1.setAppearance(SignalHead.DARK);
Assert.assertEquals("s2 after DARK", SignalHead.DARK, s2.getAppearance());
s1.setAppearance(SignalHead.RED);
Assert.assertEquals("s2 after RED", SignalHead.RED, s2.getAppearance());
s1.setAppearance(SignalHead.GREEN);
Assert.assertEquals("s2 after GREEN", SignalHead.GREEN, s2.getAppearance());
s1.setAppearance(SignalHead.YELLOW);
Assert.assertEquals("s2 after YELLOW", SignalHead.YELLOW, s2.getAppearance());
s1.setAppearance(SignalHead.DARK);
Assert.assertEquals("s2 after DARK", SignalHead.DARK, s2.getAppearance());
}
Aggregations