Search in sources :

Example 16 with CanSystemConnectionMemo

use of jmri.jmrix.can.CanSystemConnectionMemo in project JMRI by JMRI.

the class GcPortControllerTest method setUp.

@Override
@Before
public void setUp() {
    apps.tests.Log4JFixture.setUp();
    JUnitUtil.resetInstanceManager();
    CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
    apc = new GcPortController(memo) {

        @Override
        public boolean status() {
            return true;
        }

        @Override
        public void configure() {
        }

        @Override
        public java.io.DataInputStream getInputStream() {
            return null;
        }

        @Override
        public java.io.DataOutputStream getOutputStream() {
            return null;
        }

        /**
             * Get an array of valid baud rates; used to display valid options.
             */
        @Override
        public String[] validBaudRates() {
            String[] retval = { "9600" };
            return retval;
        }

        /**
             * Open a specified port. The appname argument is to be provided to the
             * underlying OS during startup so that it can show on status displays, etc
             */
        @Override
        public String openPort(String portName, String appName) {
            return "";
        }
    };
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) Before(org.junit.Before)

Example 17 with CanSystemConnectionMemo

use of jmri.jmrix.can.CanSystemConnectionMemo in project JMRI by JMRI.

the class CbusPowerManagerTest method testCTor.

@Test
public void testCTor() {
    TrafficControllerScaffold tc = new TrafficControllerScaffold();
    CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
    memo.setTrafficController(tc);
    CbusPowerManager t = new CbusPowerManager(memo);
    Assert.assertNotNull("exists", t);
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 18 with CanSystemConnectionMemo

use of jmri.jmrix.can.CanSystemConnectionMemo in project JMRI by JMRI.

the class CbusDccProgrammerManagerTest method testCTor.

@Test
public void testCTor() {
    TrafficControllerScaffold tc = new TrafficControllerScaffold();
    CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
    memo.setTrafficController(tc);
    CbusDccProgrammerManager t = new CbusDccProgrammerManager(new CbusDccProgrammer(tc), memo);
    Assert.assertNotNull("exists", t);
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 19 with CanSystemConnectionMemo

use of jmri.jmrix.can.CanSystemConnectionMemo in project JMRI by JMRI.

the class CbusLightManagerTest method testCTor.

@Test
public void testCTor() {
    TrafficControllerScaffold tc = new TrafficControllerScaffold();
    CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
    memo.setTrafficController(tc);
    CbusLightManager t = new CbusLightManager(memo);
    Assert.assertNotNull("exists", t);
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) Test(org.junit.Test)

Example 20 with CanSystemConnectionMemo

use of jmri.jmrix.can.CanSystemConnectionMemo in project JMRI by JMRI.

the class MonitorPaneTest method testDisplay.

@Test
public void testDisplay() throws Exception {
    TrafficControllerScaffold tcs = new TrafficControllerScaffold();
    MonitorPane f = new MonitorPane();
    CanSystemConnectionMemo memo = new CanSystemConnectionMemo();
    memo.setTrafficController(tcs);
    f.initComponents(memo);
    //pane.MonitorPane.Default;
    /*MonitorFrame f = new MonitorFrame(){
         { rawCheckBox.setSelected(true);}
         };
         f.initComponents();
         f.setVisible(true);*/
    // show std message
    CanMessage m = new CanMessage(0x123);
    m.setNumDataElements(3);
    m.setElement(0, (byte) 0x02);
    m.setElement(1, (byte) 0xA2);
    m.setElement(2, (byte) 0x31);
    f.message(m);
    // show ext message
    m = new CanMessage(0x654321);
    m.setExtended(true);
    m.setNumDataElements(3);
    m.setElement(0, (byte) 0x02);
    m.setElement(1, (byte) 0xA2);
    m.setElement(2, (byte) 0x31);
    f.message(m);
    // show reply
    CanReply r = new CanReply();
    r.setNumDataElements(3);
    r.setElement(0, (byte) 0x11);
    r.setElement(1, (byte) 0x82);
    r.setElement(2, (byte) 0x33);
    f.reply(r);
    // close panel
    f.dispose();
    memo.dispose();
}
Also used : CanSystemConnectionMemo(jmri.jmrix.can.CanSystemConnectionMemo) CanReply(jmri.jmrix.can.CanReply) TrafficControllerScaffold(jmri.jmrix.can.TrafficControllerScaffold) CanMessage(jmri.jmrix.can.CanMessage) Test(org.junit.Test)

Aggregations

CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)25 Before (org.junit.Before)14 TrafficControllerScaffold (jmri.jmrix.can.TrafficControllerScaffold)12 Test (org.junit.Test)10 TestTrafficController (jmri.jmrix.can.TestTrafficController)7 DccLocoAddress (jmri.DccLocoAddress)2 CanMessage (jmri.jmrix.can.CanMessage)1 CanReply (jmri.jmrix.can.CanReply)1