use of jmri.jmrix.loconet.LocoNetInterfaceScaffold in project JMRI by JMRI.
the class LocoIOPanelTest method testReadAll.
public void testReadAll() {
// prepare an interface
LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold();
LocoIOPanel f = new LocoIOPanel();
LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo();
memo.setLnTrafficController(lnis);
f.initComponents(memo);
// click button
f.readAllButton.doClick();
// check first message of ReadAll
Assert.assertEquals("One message sent", 1, lnis.outbound.size());
LocoNetMessage msg = lnis.outbound.elementAt(0);
Assert.assertEquals("message length", 16, msg.getNumDataElements());
Assert.assertEquals("message opCode", 0xE5, msg.getOpCode());
Assert.assertEquals("message bytes", "E5 10 50 51 01 00 02 04 00 00 10 00 00 00 00 00", msg.toString());
// dispose and end operation
f.dispose();
}
use of jmri.jmrix.loconet.LocoNetInterfaceScaffold in project JMRI by JMRI.
the class LnSensorManagerTest method setUp.
// The minimal setup for log4J
@Override
@Before
public void setUp() {
apps.tests.Log4JFixture.setUp();
jmri.util.JUnitUtil.resetInstanceManager();
// prepare an interface
lnis = new LocoNetInterfaceScaffold();
Assert.assertNotNull("exists", lnis);
// create and register the manager object
l = new LnSensorManager(lnis, "L");
jmri.InstanceManager.setSensorManager(l);
}
use of jmri.jmrix.loconet.LocoNetInterfaceScaffold in project JMRI by JMRI.
the class LocoIOPanelTest method testAddrField.
public void testAddrField() {
// make sure that the address field does a notify
// and new address is used
// prepare an interface
LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold();
LocoIOPanel f = new LocoIOPanel();
LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo();
memo.setLnTrafficController(lnis);
f.initComponents(memo);
f.addrField.setText("1234");
f.addrField.postActionEvent();
// click button
f.readAllButton.doClick();
// check first message of readAll
Assert.assertEquals("One message sent", 1, lnis.outbound.size());
LocoNetMessage msg = lnis.outbound.elementAt(0);
Assert.assertEquals("message length", 16, msg.getNumDataElements());
Assert.assertEquals("message opCode", 0xE5, msg.getOpCode());
Assert.assertEquals("message bytes", "E5 10 50 34 01 00 02 04 00 00 10 00 00 00 00 00", msg.toString());
// dispose and end operation
f.dispose();
}
use of jmri.jmrix.loconet.LocoNetInterfaceScaffold in project JMRI by JMRI.
the class LnPr2PowerManagerTest method setUp.
// setup a default interface
@Before
@Override
public void setUp() {
controller = new LocoNetInterfaceScaffold();
slotmanager = new SlotManager(controller);
PR2SystemConnectionMemo memo = new PR2SystemConnectionMemo(controller, slotmanager);
memo.configureManagers();
jmri.InstanceManager.setThrottleManager(memo.getPr2ThrottleManager());
memo.getPr2ThrottleManager().requestThrottleSetup(new jmri.DccLocoAddress(3, false), true);
p = new LnPr2PowerManager(memo);
}
use of jmri.jmrix.loconet.LocoNetInterfaceScaffold in project JMRI by JMRI.
the class SlotMonDataModelTest method testCTor.
@Test
public void testCTor() {
LnTrafficController lnis = new LocoNetInterfaceScaffold();
SlotManager slotmanager = new SlotManager(lnis);
LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo(lnis, slotmanager);
SlotMonDataModel t = new SlotMonDataModel(1, 19, memo);
Assert.assertNotNull("exists", t);
}
Aggregations