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"));
}
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());
}
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"));
}
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"));
}
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"));
}
Aggregations