Search in sources :

Example 11 with TrafficControllerScaffold

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);
}
Also used : TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold)

Example 12 with TrafficControllerScaffold

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);
}
Also used : TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 13 with TrafficControllerScaffold

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);
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 14 with TrafficControllerScaffold

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);
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 15 with TrafficControllerScaffold

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();
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) CanReply(jmri.jmrix.can.CanReply) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) CanMessage(jmri.jmrix.can.CanMessage) Test(org.junit.Test)

Aggregations

TrafficControllerScaffold (jmri.jmrix.can.TrafficControllerScaffold)19 Test (org.junit.Test)13 CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)12 Before (org.junit.Before)4 CanReply (jmri.jmrix.can.CanReply)2 DccLocoAddress (jmri.DccLocoAddress)1 CanMessage (jmri.jmrix.can.CanMessage)1