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());
}
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());
}
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());
}
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);
}
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));
}
Aggregations