use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.
the class EliteXNetProgrammerTest method testWriteRegisterSequenceString.
public void testWriteRegisterSequenceString() throws JmriException {
// infrastructure objects
XNetInterfaceScaffold t = new XNetInterfaceScaffold(new HornbyEliteCommandStation());
EliteXNetListenerScaffold l = new EliteXNetListenerScaffold();
EliteXNetProgrammer p = new EliteXNetProgrammer(t);
// set register mode
p.setMode(DefaultProgrammerManager.REGISTERMODE);
// and do the write
p.writeCV("29", 12, l);
// check "prog mode" message sent
Assert.assertEquals("read message sent", 2, t.outbound.size());
Assert.assertEquals("write message contents", "23 12 05 0C 38", t.outbound.elementAt(0).toString());
// send reply
XNetReply mr1 = new XNetReply();
mr1.setElement(0, 0x61);
mr1.setElement(1, 0x02);
mr1.setElement(2, 0x63);
t.sendTestMessage(mr1);
Assert.assertEquals("enquire message sent", 2, t.outbound.size());
Assert.assertEquals("enquire message contents", "21 10 31", t.outbound.elementAt(1).toString());
}
use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.
the class EliteXNetThrottleManagerTest method setUp.
// The minimal setup for log4J
@Override
@Before
public void setUp() {
apps.tests.Log4JFixture.setUp();
jmri.util.JUnitUtil.resetInstanceManager();
XNetInterfaceScaffold tc = new XNetInterfaceScaffold(new HornbyEliteCommandStation());
tm = new EliteXNetThrottleManager(new XNetSystemConnectionMemo(tc));
}
use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.
the class EliteXNetThrottleTest method testCtor.
public void testCtor() {
// infrastructure objects
XNetInterfaceScaffold tc = new XNetInterfaceScaffold(new HornbyEliteCommandStation());
EliteXNetThrottle t = new EliteXNetThrottle(new jmri.jmrix.lenz.XNetSystemConnectionMemo(tc), tc);
Assert.assertNotNull(t);
}
use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.
the class EliteXNetTurnoutManagerTest method testAsAbstractFactory.
@Test
public void testAsAbstractFactory() {
lnis = new XNetInterfaceScaffold(new HornbyEliteCommandStation());
// create and register the manager object
EliteXNetTurnoutManager l = new EliteXNetTurnoutManager(lnis, "X");
jmri.InstanceManager.setTurnoutManager(l);
// ask for a Turnout, and check type
TurnoutManager t = jmri.InstanceManager.turnoutManagerInstance();
Turnout o = t.newTurnout("XT21", "my name");
if (log.isDebugEnabled()) {
log.debug("received turnout value " + o);
}
Assert.assertTrue(null != (EliteXNetTurnout) o);
// make sure loaded into tables
if (log.isDebugEnabled()) {
log.debug("by system name: " + t.getBySystemName("XT21"));
}
if (log.isDebugEnabled()) {
log.debug("by user name: " + t.getByUserName("my name"));
}
Assert.assertTrue(null != t.getBySystemName("XT21"));
Assert.assertTrue(null != t.getByUserName("my name"));
}
use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.
the class EliteXNetTurnoutTest method setUp.
// The minimal setup for log4J
@Override
@Before
public void setUp() {
apps.tests.Log4JFixture.setUp();
// prepare an interface
jmri.util.JUnitUtil.resetInstanceManager();
jmri.util.JUnitUtil.initInternalSensorManager();
lnis = new XNetInterfaceScaffold(new HornbyEliteCommandStation());
t = new EliteXNetTurnout("XT", 21, lnis);
jmri.InstanceManager.store(new jmri.NamedBeanHandleManager(), jmri.NamedBeanHandleManager.class);
}
Aggregations