Search in sources :

Example 11 with TestTrafficController

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

the class CbusProgrammerManagerTest method testAddressed.

public void testAddressed() {
    CbusProgrammerManager m = new CbusProgrammerManager(new TestTrafficController());
    Assert.assertTrue("addressed mode ok", m.isAddressedModePossible());
}
Also used : TestTrafficController(jmri.jmrix.can.TestTrafficController)

Example 12 with TestTrafficController

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

the class CbusProgrammerTest method testGetCanRead.

public void testGetCanRead() {
    CbusProgrammer p = new CbusProgrammer(10, new TestTrafficController());
    Assert.assertTrue("can read", p.getCanRead());
}
Also used : TestTrafficController(jmri.jmrix.can.TestTrafficController)

Example 13 with TestTrafficController

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

the class CbusProgrammerTest method testGetMode.

public void testGetMode() {
    CbusProgrammer p = new CbusProgrammer(10, new TestTrafficController());
    Assert.assertEquals("CBUSNODEVARMODE", CbusProgrammer.CBUSNODEVARMODE, p.getMode());
}
Also used : TestTrafficController(jmri.jmrix.can.TestTrafficController)

Example 14 with TestTrafficController

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

the class CbusSensorTest method testIncomingChange.

public void testIncomingChange() {
    // load dummy TrafficController
    TestTrafficController t = new TestTrafficController();
    Assert.assertNotNull("exists", t);
    CbusSensor s = new CbusSensor("MS", "+1;-1", t);
    // message for Active and Inactive
    CanMessage mActive = new CanMessage(new int[] { CbusConstants.CBUS_ASON, 0x00, 0x00, 0x00, 0x01 }, t.getCanid());
    CanMessage mInactive = new CanMessage(new int[] { CbusConstants.CBUS_ASOF, 0x00, 0x00, 0x00, 0x01 }, t.getCanid());
    // check states
    Assert.assertTrue(s.getKnownState() == Sensor.UNKNOWN);
    s.message(mActive);
    Assert.assertTrue(s.getKnownState() == Sensor.ACTIVE);
    s.message(mInactive);
    Assert.assertTrue(s.getKnownState() == Sensor.INACTIVE);
}
Also used : TestTrafficController(jmri.jmrix.can.TestTrafficController) CanMessage(jmri.jmrix.can.CanMessage)

Example 15 with TestTrafficController

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

the class CbusSensorTest method testNameCreation.

public void testNameCreation() {
    TestTrafficController t = new TestTrafficController();
    Assert.assertTrue("create MSX0A;+N15E6", null != new CbusSensor("MS", "X0A;+N15E6", t));
}
Also used : TestTrafficController(jmri.jmrix.can.TestTrafficController)

Aggregations

TestTrafficController (jmri.jmrix.can.TestTrafficController)15 CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)7 Before (org.junit.Before)7 CanMessage (jmri.jmrix.can.CanMessage)1