use of jmri.Reporter in project JMRI by JMRI.
the class AbstractReporterMgrTestBase method testUpperLower.
@Test
public void testUpperLower() {
Reporter t = l.provideReporter("" + getNameToTest1());
String name = t.getSystemName();
Assert.assertNull(l.getReporter(name.toLowerCase()));
}
use of jmri.Reporter in project JMRI by JMRI.
the class AbstractReporterMgrTestBase method testReporterGetBySystemName.
@Test
public void testReporterGetBySystemName() {
// Create
Reporter t = l.provideReporter("" + getNameToTest1());
t.setUserName("Fred");
// Try a successful one
t = l.getBySystemName(getSystemName(getNameToTest1()));
Assert.assertTrue("get retrieved existing object ", t != null);
// Try a nonexistant one. Should return null
if (maxN() < 2)
return;
t = l.getBySystemName(getSystemName(getNameToTest2()));
Assert.assertTrue("get nonexistant object ", t == null);
}
use of jmri.Reporter in project JMRI by JMRI.
the class AbstractReporterMgrTestBase method testSingleObject.
@Test
public void testSingleObject() {
// test that you always get the same representation
Reporter t1 = l.newReporter(getSystemName(getNameToTest1()), "mine");
Assert.assertTrue("t1 real object returned ", t1 != null);
Assert.assertTrue("same by user ", t1 == l.getByUserName("mine"));
Assert.assertTrue("same by system ", t1 == l.getBySystemName(getSystemName(getNameToTest1())));
Reporter t2 = l.newReporter(getSystemName(getNameToTest1()), "mine");
Assert.assertTrue("t2 real object returned ", t2 != null);
// check
Assert.assertTrue("same new ", t1 == t2);
}
use of jmri.Reporter in project JMRI by JMRI.
the class AbstractReporterMgrTestBase method testReporterGetByUserName.
@Test
public void testReporterGetByUserName() {
// Create
Reporter t = l.provideReporter("" + getNameToTest1());
t.setUserName("Fred");
// Try a successful one
t = l.getByUserName("Fred");
Assert.assertTrue("get retrieved existing object ", t != null);
// Try a nonexistant one. Should return null
t = l.getBySystemName("Barney");
Assert.assertTrue("get nonexistant object ", t == null);
}
use of jmri.Reporter in project JMRI by JMRI.
the class ProxyReporterManagerTest method testTwoNames.
@Test
public void testTwoNames() {
Reporter ir211 = l.provideReporter("LR211");
Reporter lr211 = l.provideReporter("IR211");
Assert.assertNotNull(ir211);
Assert.assertNotNull(lr211);
Assert.assertTrue(ir211 != lr211);
}
Aggregations