use of jmri.Turnout in project JMRI by JMRI.
the class QuadOutputSignalHeadTest method testCTor.
@Test
public void testCTor() {
Turnout it = (InstanceManager.getDefault(TurnoutManager.class)).provideTurnout("IT1");
NamedBeanHandle<Turnout> green = new NamedBeanHandle<>("green handle", it);
Turnout it2 = (InstanceManager.getDefault(TurnoutManager.class)).provideTurnout("IT3");
NamedBeanHandle<Turnout> red = new NamedBeanHandle<>("red handle", it2);
Turnout it3 = (InstanceManager.getDefault(TurnoutManager.class)).provideTurnout("IT2");
NamedBeanHandle<Turnout> yellow = new NamedBeanHandle<>("yellow handle", it3);
Turnout it4 = (InstanceManager.getDefault(TurnoutManager.class)).provideTurnout("IT4");
NamedBeanHandle<Turnout> lunar = new NamedBeanHandle<>("lunar handle", it4);
QuadOutputSignalHead t = new QuadOutputSignalHead("Test Head", green, red, yellow, lunar);
Assert.assertNotNull("exists", t);
}
use of jmri.Turnout in project JMRI by JMRI.
the class RawTurnoutOperatorTest method testCTor.
@Test
public void testCTor() {
Turnout it = (InstanceManager.getDefault(TurnoutManager.class)).provideTurnout("IT1");
RawTurnoutOperator t = new RawTurnoutOperator((AbstractTurnout) it, 5, 5);
jmri.util.JUnitAppender.assertErrorMessage("No match against the command station for IT1, so will use the default");
Assert.assertNotNull("exists", t);
}
use of jmri.Turnout in project JMRI by JMRI.
the class SensorTurnoutOperatorTest method testCTor.
@Test
public void testCTor() {
Turnout it = (InstanceManager.getDefault(TurnoutManager.class)).provideTurnout("IT1");
SensorTurnoutOperator t = new SensorTurnoutOperator((AbstractTurnout) it, 5, 5);
Assert.assertNotNull("exists", t);
}
use of jmri.Turnout in project JMRI by JMRI.
the class SE8cSignalHeadTest method testStateFollowingCtor1.
@Test
public void testStateFollowingCtor1() {
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));
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 testRedState.
@Test
public void testRedState() {
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.RED);
Assert.assertEquals("to low after", Turnout.THROWN, it11.getCommandedState());
Assert.assertEquals("to high after", Turnout.CLOSED, it12.getCommandedState());
}
Aggregations