Search in sources :

Example 1 with LnSensor

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"));
}
Also used : LnSensor(jmri.jmrix.loconet.LnSensor) SensorManager(jmri.SensorManager) Sensor(jmri.Sensor) LnSensor(jmri.jmrix.loconet.LnSensor) Test(org.junit.Test)

Aggregations

Sensor (jmri.Sensor)1 SensorManager (jmri.SensorManager)1 LnSensor (jmri.jmrix.loconet.LnSensor)1 Test (org.junit.Test)1