Search in sources :

Example 81 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class EasyDccTurnoutManagerTest method testAsAbstractFactory.

@Test
public void testAsAbstractFactory() {
    // ask for a Turnout, and check type
    Turnout o = l.newTurnout("ET21", "my name");
    if (log.isDebugEnabled()) {
        log.debug("received turnout value " + o);
    }
    Assert.assertTrue(null != (EasyDccTurnout) o);
    // make sure loaded into tables
    if (log.isDebugEnabled()) {
        log.debug("by system name: " + l.getBySystemName("ET21"));
    }
    if (log.isDebugEnabled()) {
        log.debug("by user name:   " + l.getByUserName("my name"));
    }
    Assert.assertTrue(null != l.getBySystemName("ET21"));
    Assert.assertTrue(null != l.getByUserName("my name"));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Example 82 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class XBeeTurnoutManagerTest method testDefaultSystemName.

@Override
@Test
public void testDefaultSystemName() {
    // create
    Turnout t = l.provideTurnout("ABCT2:" + getNumToTest1());
    // check
    Assert.assertTrue("real object returned ", t != null);
    Assert.assertTrue("system name correct ", t == l.getBySystemName(getSystemName(getNumToTest1())));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Example 83 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class SerialTurnoutManagerTest method testAsAbstractFactory.

@Test
public void testAsAbstractFactory() {
    // ask for a Turnout, and check type
    Turnout o = l.newTurnout("KT21", "my name");
    if (log.isDebugEnabled()) {
        log.debug("received turnout value " + o);
    }
    Assert.assertTrue(null != (SerialTurnout) o);
    // make sure loaded into tables
    if (log.isDebugEnabled()) {
        log.debug("by system name: " + l.getBySystemName("KT21"));
    }
    if (log.isDebugEnabled()) {
        log.debug("by user name:   " + l.getByUserName("my name"));
    }
    Assert.assertTrue(null != l.getBySystemName("KT21"));
    Assert.assertTrue(null != l.getByUserName("my name"));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Example 84 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class NceTurnoutManagerTest method testAsAbstractFactory.

@Test
public void testAsAbstractFactory() {
    // ask for a Turnout, and check type
    Turnout o = l.newTurnout("NT21", "my name");
    if (log.isDebugEnabled()) {
        log.debug("received turnout value " + o);
    }
    Assert.assertTrue(null != (NceTurnout) o);
    // make sure loaded into tables
    if (log.isDebugEnabled()) {
        log.debug("by system name: " + l.getBySystemName("NT21"));
    }
    if (log.isDebugEnabled()) {
        log.debug("by user name:   " + l.getByUserName("my name"));
    }
    Assert.assertTrue(null != l.getBySystemName("NT21"));
    Assert.assertTrue(null != l.getByUserName("my name"));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Example 85 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class SerialTurnoutManagerTest method testAsAbstractFactory.

@Test
public void testAsAbstractFactory() {
    // ask for a Turnout, and check type
    Turnout o = l.newTurnout("PTB1", "my name");
    if (log.isDebugEnabled()) {
        log.debug("received turnout value " + o);
    }
    Assert.assertTrue(null != (SerialTurnout) o);
    // make sure loaded into tables
    if (log.isDebugEnabled()) {
        log.debug("by system name: " + l.getBySystemName("PTB1"));
    }
    if (log.isDebugEnabled()) {
        log.debug("by user name:   " + l.getByUserName("my name"));
    }
    Assert.assertTrue(null != l.getBySystemName("PTB1"));
    Assert.assertTrue(null != l.getByUserName("my name"));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Aggregations

Turnout (jmri.Turnout)221 Test (org.junit.Test)63 Sensor (jmri.Sensor)26 SignalHead (jmri.SignalHead)20 Element (org.jdom2.Element)20 TurnoutManager (jmri.TurnoutManager)17 JmriException (jmri.JmriException)11 Light (jmri.Light)10 SignalMast (jmri.SignalMast)10 ActionEvent (java.awt.event.ActionEvent)9 NamedBeanHandle (jmri.NamedBeanHandle)9 JsonException (jmri.server.json.JsonException)9 ActionListener (java.awt.event.ActionListener)8 Block (jmri.Block)7 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 NamedBean (jmri.NamedBean)6 Route (jmri.Route)6 AbstractTurnout (jmri.implementation.AbstractTurnout)6 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)5