Search in sources :

Example 6 with SignalSystem

use of jmri.SignalSystem in project JMRI by JMRI.

the class DefaultSignalSystemTest method testOneAspectOneProperty.

@Test
public void testOneAspectOneProperty() {
    SignalSystem t = new DefaultSignalSystem("sys", "user");
    t.setProperty("Stop", "Speed", 0);
    Assert.assertEquals(0, t.getProperty("Stop", "Speed"));
}
Also used : SignalSystem(jmri.SignalSystem) Test(org.junit.Test)

Example 7 with SignalSystem

use of jmri.SignalSystem in project JMRI by JMRI.

the class DefaultSignalSystemTest method testGetKeys.

@Test
public void testGetKeys() {
    SignalSystem t = new DefaultSignalSystem("sys", "user");
    t.setProperty("Stop", "A", 0);
    t.setProperty("Approach", "C", 5);
    t.setProperty("Clear", "B", 10);
    java.util.Enumeration<String> e = t.getKeys();
    Assert.assertEquals("A", e.nextElement());
    Assert.assertEquals("C", e.nextElement());
    Assert.assertEquals("B", e.nextElement());
    Assert.assertTrue(!e.hasMoreElements());
}
Also used : SignalSystem(jmri.SignalSystem) Test(org.junit.Test)

Example 8 with SignalSystem

use of jmri.SignalSystem in project JMRI by JMRI.

the class DefaultSignalSystemTest method testCheckAspect.

@Test
public void testCheckAspect() {
    SignalSystem t = new DefaultSignalSystem("sys", "user");
    t.setProperty("Stop", "Speed", 0);
    t.setProperty("Approach", "Speed", 5);
    Assert.assertTrue("Stop", t.checkAspect("Stop"));
    Assert.assertFalse("Clear", t.checkAspect("Clear"));
}
Also used : SignalSystem(jmri.SignalSystem) Test(org.junit.Test)

Example 9 with SignalSystem

use of jmri.SignalSystem in project JMRI by JMRI.

the class DefaultSignalSystemTest method testTwoAspectTwoProperties.

@Test
public void testTwoAspectTwoProperties() {
    SignalSystem t = new DefaultSignalSystem("sys", "user");
    t.setProperty("Stop", "Speed", 0);
    t.setProperty("Clear", "Speed", 10);
    t.setProperty("Stop", "Biff", "ffiB");
    t.setProperty("Clear", "Biff", "beef");
    Assert.assertEquals("Stop", 0, t.getProperty("Stop", "Speed"));
    Assert.assertEquals("Clear", 10, t.getProperty("Clear", "Speed"));
    Assert.assertEquals("Stop", "ffiB", t.getProperty("Stop", "Biff"));
    Assert.assertEquals("Clear", "beef", t.getProperty("Clear", "Biff"));
}
Also used : SignalSystem(jmri.SignalSystem) Test(org.junit.Test)

Example 10 with SignalSystem

use of jmri.SignalSystem in project JMRI by JMRI.

the class DefaultSignalSystemTest method testGetNullProperties.

@Test
public void testGetNullProperties() {
    SignalSystem t = new DefaultSignalSystem("sys", "user");
    t.setProperty("Stop", "Speed", 0);
    t.setProperty("Approach", "Speed", 5);
    Assert.assertEquals("Stop", null, t.getProperty("Stop", "None"));
    Assert.assertEquals("Clear", null, t.getProperty("Clear", "Speed"));
}
Also used : SignalSystem(jmri.SignalSystem) Test(org.junit.Test)

Aggregations

SignalSystem (jmri.SignalSystem)11 Test (org.junit.Test)9 FocusEvent (java.awt.event.FocusEvent)1 FocusListener (java.awt.event.FocusListener)1 JLabel (javax.swing.JLabel)1 SignalMast (jmri.SignalMast)1 SignalSystemManager (jmri.SignalSystemManager)1 DefaultSignalSystem (jmri.implementation.DefaultSignalSystem)1