Search in sources :

Example 1 with SerialDriverAdapter

use of jmri.jmrix.cmri.serial.serialdriver.SerialDriverAdapter in project JMRI by JMRI.

the class ConnectionConfigXmlTest method testStore.

@Test
@Ignore("causes errors")
public void testStore() {
    // tests that store produces an XML element from a new ConnectionConfig object.
    ConnectionConfigXml c = new ConnectionConfigXml();
    SerialDriverAdapter p = new SerialDriverAdapter() {

        /**
               * set up all of the other objects to operate connected to this port
               */
        @Override
        public void configure() {
            // connect to the traffic controller
            SerialTrafficController tc = new SerialTrafficControlScaffold();
            tc.connectPort(this);
            ((CMRISystemConnectionMemo) getSystemConnectionMemo()).setTrafficController(tc);
            ((CMRISystemConnectionMemo) getSystemConnectionMemo()).configureManagers();
        }
    };
    ConnectionConfig cc = new ConnectionConfig(p);
    p.configure();
    c.getInstance(cc);
    Assert.assertNotNull("ConnectionConfigXml store()", c.store(cc));
}
Also used : SerialTrafficController(jmri.jmrix.cmri.serial.SerialTrafficController) CMRISystemConnectionMemo(jmri.jmrix.cmri.CMRISystemConnectionMemo) SerialDriverAdapter(jmri.jmrix.cmri.serial.serialdriver.SerialDriverAdapter) SerialTrafficControlScaffold(jmri.jmrix.cmri.serial.SerialTrafficControlScaffold) ConnectionConfig(jmri.jmrix.cmri.serial.serialdriver.ConnectionConfig) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

CMRISystemConnectionMemo (jmri.jmrix.cmri.CMRISystemConnectionMemo)1 SerialTrafficControlScaffold (jmri.jmrix.cmri.serial.SerialTrafficControlScaffold)1 SerialTrafficController (jmri.jmrix.cmri.serial.SerialTrafficController)1 ConnectionConfig (jmri.jmrix.cmri.serial.serialdriver.ConnectionConfig)1 SerialDriverAdapter (jmri.jmrix.cmri.serial.serialdriver.SerialDriverAdapter)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1