use of jmri.jmrix.loconet.LnSensor in project JMRI by JMRI.
the class LnSensorManagerTest method testAsAbstractFactory.
@Test
public void testAsAbstractFactory() {
// ask for a Sensor, and check type
SensorManager t = jmri.InstanceManager.sensorManagerInstance();
Sensor o = t.newSensor("LS21", "my name");
if (log.isDebugEnabled()) {
log.debug("received sensor value " + o);
}
Assert.assertTrue(null != (LnSensor) o);
// make sure loaded into tables
if (log.isDebugEnabled()) {
log.debug("by system name: " + t.getBySystemName("LS21"));
}
if (log.isDebugEnabled()) {
log.debug("by user name: " + t.getByUserName("my name"));
}
Assert.assertTrue(null != t.getBySystemName("LS21"));
Assert.assertTrue(null != t.getByUserName("my name"));
}
Aggregations