use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.
the class CbusProgrammerTest method testWriteSequence.
public void testWriteSequence() throws jmri.ProgrammerException {
TrafficControllerScaffold tc = new TrafficControllerScaffold();
CbusProgrammer p = new CbusProgrammer(3, tc);
reply = false;
rcvdValue = -2;
rcvdStatus = -2;
p.writeCV(4, 5, testListener);
Assert.assertEquals("listeners", 0, tc.numListeners());
Assert.assertEquals("sent count", 1, tc.outbound.size());
Assert.assertEquals("content 1", "96 00 03 04 05", tc.outbound.get(0).toString());
// no reply from CAN and listener replies immediately,
// contrast read test below
Assert.assertTrue("listener invoked", reply);
Assert.assertEquals("status", 0, rcvdStatus);
}
use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.
the class CbusDccOpsModeProgrammerTest method testCTor.
@Test
public void testCTor() {
CbusDccOpsModeProgrammer t = new CbusDccOpsModeProgrammer(100, true, new TrafficControllerScaffold());
Assert.assertNotNull("exists", t);
}
use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.
the class CbusDccProgrammerManagerTest method testCTor.
@Test
public void testCTor() {
TrafficControllerScaffold tc = new TrafficControllerScaffold();
CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
memo.setTrafficController(tc);
CbusDccProgrammerManager t = new CbusDccProgrammerManager(new CbusDccProgrammer(tc), memo);
Assert.assertNotNull("exists", t);
}
use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.
the class CbusLightManagerTest method testCTor.
@Test
public void testCTor() {
TrafficControllerScaffold tc = new TrafficControllerScaffold();
CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
memo.setTrafficController(tc);
CbusLightManager t = new CbusLightManager(memo);
Assert.assertNotNull("exists", t);
}
use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.
the class MonitorPaneTest method testDisplay.
@Test
public void testDisplay() throws Exception {
TrafficControllerScaffold tcs = new TrafficControllerScaffold();
MonitorPane f = new MonitorPane();
CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
memo.setTrafficController(tcs);
f.initComponents(memo);
//pane.MonitorPane.Default;
/*MonitorFrame f = new MonitorFrame(){
{ rawCheckBox.setSelected(true);}
};
f.initComponents();
f.setVisible(true);*/
// show std message
CanMessage m = new CanMessage(0x123);
m.setNumDataElements(3);
m.setElement(0, (byte) 0x02);
m.setElement(1, (byte) 0xA2);
m.setElement(2, (byte) 0x31);
f.message(m);
// show ext message
m = new CanMessage(0x654321);
m.setExtended(true);
m.setNumDataElements(3);
m.setElement(0, (byte) 0x02);
m.setElement(1, (byte) 0xA2);
m.setElement(2, (byte) 0x31);
f.message(m);
// show reply
CanReply r = new CanReply();
r.setNumDataElements(3);
r.setElement(0, (byte) 0x11);
r.setElement(1, (byte) 0x82);
r.setElement(2, (byte) 0x33);
f.reply(r);
// close panel
f.dispose();
memo.dispose();
}
Aggregations