Search in sources :

Example 6 with TrafficControllerScaffold

use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.

the class CbusReporterTest method testCTor.

@Test
public void testCTor() {
    CbusReporter t = new CbusReporter(1, new TrafficControllerScaffold(), "Test");
    Assert.assertNotNull("exists", t);
}
Also used : TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 7 with TrafficControllerScaffold

use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.

the class CbusDccProgrammerTest method testCTor.

@Test
public void testCTor() {
    CbusDccProgrammer t = new CbusDccProgrammer(new TrafficControllerScaffold());
    Assert.assertNotNull("exists", t);
}
Also used : TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 8 with TrafficControllerScaffold

use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.

the class CbusLightTest method testCTor.

@Test
public void testCTor() {
    CbusLight t = new CbusLight("ML", "+1;-1", new TrafficControllerScaffold());
    Assert.assertNotNull("exists", t);
}
Also used : TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 9 with TrafficControllerScaffold

use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.

the class CbusProgrammerTest method testReadSequence.

public void testReadSequence() throws jmri.ProgrammerException {
    TrafficControllerScaffold tc = new TrafficControllerScaffold();
    CbusProgrammer p = new CbusProgrammer(3, tc);
    reply = false;
    rcvdValue = -2;
    rcvdStatus = -2;
    p.readCV(4, testListener);
    Assert.assertEquals("listeners", 0, tc.numListeners());
    Assert.assertEquals("sent count", 1, tc.outbound.size());
    Assert.assertEquals("content 1", "71 00 03 04", tc.outbound.get(0).toString());
    Assert.assertTrue("listener not invoked", !reply);
    // pretend reply from CAN
    int[] frame = new int[] { 0x97, 0, 3, 5 };
    CanReply f = new CanReply(frame);
    p.reply(f);
    Assert.assertTrue("listener invoked", reply);
    Assert.assertEquals("status", 0, rcvdStatus);
    Assert.assertEquals("value", 5, rcvdValue);
}
Also used : CanReply(jmri.jmrix.can.CanReply) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold)

Example 10 with TrafficControllerScaffold

use of jmri.jmrix.can.TrafficControllerScaffold in project JMRI by JMRI.

the class CbusPowerManagerTest method testCTor.

@Test
public void testCTor() {
    TrafficControllerScaffold tc = new TrafficControllerScaffold();
    CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
    memo.setTrafficController(tc);
    CbusPowerManager t = new CbusPowerManager(memo);
    Assert.assertNotNull("exists", t);
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) 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