Search in sources :

Example 21 with XNetInterfaceScaffold

use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.

the class Z21XNetThrottleTest method testCtor.

@Override
@Test(timeout = 1000)
public void testCtor() {
    // infrastructure objects
    XNetInterfaceScaffold tc = new XNetInterfaceScaffold(new LenzCommandStation());
    Z21XNetThrottle t = new Z21XNetThrottle(new XNetSystemConnectionMemo(tc), tc);
    Assert.assertNotNull(t);
}
Also used : XNetInterfaceScaffold(jmri.jmrix.lenz.XNetInterfaceScaffold) XNetSystemConnectionMemo(jmri.jmrix.lenz.XNetSystemConnectionMemo) LenzCommandStation(jmri.jmrix.lenz.LenzCommandStation) Test(org.junit.Test) XNetThrottleTest(jmri.jmrix.lenz.XNetThrottleTest)

Example 22 with XNetInterfaceScaffold

use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.

the class Z21XNetThrottleTest method testCtorWithArg.

// Test the constructor with an address specified.
@Override
@Test(timeout = 1000)
public void testCtorWithArg() throws Exception {
    XNetInterfaceScaffold tc = new XNetInterfaceScaffold(new LenzCommandStation());
    Z21XNetThrottle t = new Z21XNetThrottle(new XNetSystemConnectionMemo(tc), new jmri.DccLocoAddress(3, false), tc);
    Assert.assertNotNull(t);
}
Also used : XNetInterfaceScaffold(jmri.jmrix.lenz.XNetInterfaceScaffold) XNetSystemConnectionMemo(jmri.jmrix.lenz.XNetSystemConnectionMemo) LenzCommandStation(jmri.jmrix.lenz.LenzCommandStation) Test(org.junit.Test) XNetThrottleTest(jmri.jmrix.lenz.XNetThrottleTest)

Example 23 with XNetInterfaceScaffold

use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.

the class Z21XNetTurnoutManagerTest method setUp.

@Override
@Before
public void setUp() {
    apps.tests.Log4JFixture.setUp();
    // prepare an interface, register
    lnis = new XNetInterfaceScaffold(new RocoZ21CommandStation());
    // create and register the manager object
    l = new Z21XNetTurnoutManager(lnis, "X");
    jmri.InstanceManager.setTurnoutManager(l);
}
Also used : XNetInterfaceScaffold(jmri.jmrix.lenz.XNetInterfaceScaffold) Before(org.junit.Before)

Example 24 with XNetInterfaceScaffold

use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.

the class Z21XNetTurnoutManagerTest method testAsAbstractFactory.

@Test
public void testAsAbstractFactory() {
    lnis = new XNetInterfaceScaffold(new RocoZ21CommandStation());
    // create and register the manager object
    Z21XNetTurnoutManager l = new Z21XNetTurnoutManager(lnis, "X");
    jmri.InstanceManager.setTurnoutManager(l);
    // ask for a Turnout, and check type
    TurnoutManager t = jmri.InstanceManager.turnoutManagerInstance();
    Turnout o = t.newTurnout("XT21", "my name");
    if (log.isDebugEnabled()) {
        log.debug("received turnout value " + o);
    }
    Assert.assertTrue(null != (Z21XNetTurnout) o);
    // make sure loaded into tables
    if (log.isDebugEnabled()) {
        log.debug("by system name: " + t.getBySystemName("XT21"));
    }
    if (log.isDebugEnabled()) {
        log.debug("by user name:   " + t.getByUserName("my name"));
    }
    Assert.assertTrue(null != t.getBySystemName("XT21"));
    Assert.assertTrue(null != t.getByUserName("my name"));
}
Also used : XNetInterfaceScaffold(jmri.jmrix.lenz.XNetInterfaceScaffold) TurnoutManager(jmri.TurnoutManager) Turnout(jmri.Turnout) Test(org.junit.Test)

Example 25 with XNetInterfaceScaffold

use of jmri.jmrix.lenz.XNetInterfaceScaffold in project JMRI by JMRI.

the class ZTC611XNetTurnoutManagerTest method setUp.

@Override
@Before
public void setUp() {
    apps.tests.Log4JFixture.setUp();
    jmri.util.JUnitUtil.resetInstanceManager();
    // prepare an interface, register
    lnis = new XNetInterfaceScaffold(new LenzCommandStation());
    // create and register the manager object
    l = new ZTC611XNetTurnoutManager(lnis, "X");
    jmri.InstanceManager.setTurnoutManager(l);
}
Also used : XNetInterfaceScaffold(jmri.jmrix.lenz.XNetInterfaceScaffold) LenzCommandStation(jmri.jmrix.lenz.LenzCommandStation) Before(org.junit.Before)

Aggregations

XNetInterfaceScaffold (jmri.jmrix.lenz.XNetInterfaceScaffold)46 LenzCommandStation (jmri.jmrix.lenz.LenzCommandStation)26 XNetReply (jmri.jmrix.lenz.XNetReply)18 XNetSystemConnectionMemo (jmri.jmrix.lenz.XNetSystemConnectionMemo)13 Test (org.junit.Test)13 Before (org.junit.Before)10 XNetListenerScaffold (jmri.jmrix.lenz.XNetListenerScaffold)4 Turnout (jmri.Turnout)3 TurnoutManager (jmri.TurnoutManager)3 XNetThrottleTest (jmri.jmrix.lenz.XNetThrottleTest)2