Search in sources :

Example 26 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class AbstractTurnoutMgrTestBase method testUpperLower.

@Test
public void testUpperLower() {
    Turnout t = l.provideTurnout("" + getNumToTest2());
    Assert.assertNull(l.getTurnout(t.getSystemName().toLowerCase()));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Example 27 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class AbstractTurnoutMgrTestBase method testTurnoutPutGet.

@Test
public void testTurnoutPutGet() {
    // create
    Turnout t = l.newTurnout(getSystemName(getNumToTest1()), "mine");
    // check
    Assert.assertNotNull("real object returned ", t);
    Assert.assertEquals("user name correct ", t, l.getByUserName("mine"));
    Assert.assertEquals("system name correct ", t, l.getBySystemName(getSystemName(getNumToTest1())));
}
Also used : Turnout(jmri.Turnout) Test(org.junit.Test)

Example 28 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class ProxyTurnoutManagerTest method testPutGet.

public void testPutGet() {
    // create
    Turnout t = l.newTurnout(getSystemName(getNumToTest1()), "mine");
    // check
    Assert.assertTrue("real object returned ", t != null);
    Assert.assertTrue("user name correct ", t == l.getByUserName("mine"));
    Assert.assertTrue("system name correct ", t == l.getBySystemName(getSystemName(getNumToTest1())));
}
Also used : Turnout(jmri.Turnout)

Example 29 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class ProxyTurnoutManagerTest method testDefaultNotInternal.

public void testDefaultNotInternal() {
    Turnout lut = l.provideTurnout("211");
    Assert.assertNotNull(lut);
    Assert.assertEquals("JT211", lut.getSystemName());
}
Also used : Turnout(jmri.Turnout)

Example 30 with Turnout

use of jmri.Turnout in project JMRI by JMRI.

the class ProxyTurnoutManagerTest method testTwoNames.

public void testTwoNames() {
    Turnout jl212 = l.provideTurnout("JT212");
    Turnout jl211 = l.provideTurnout("JT211");
    Assert.assertNotNull(jl212);
    Assert.assertNotNull(jl211);
    Assert.assertTrue(jl212 != jl211);
}
Also used : Turnout(jmri.Turnout)

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