use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.
the class LlnmonTest method testSv1Messages.
public void testSv1Messages() {
LocoNetMessage l;
l = new LocoNetMessage(new int[] { 0xe5, 0x10, 0x50, 0x51, 0x01, 0x00, 0x01, 0x02, 0x13, 0x04, 0x10, 0x05, 0x06, 0x07, 0x08, 0x00 });
assertEquals("SV1 test 1", "LocoBuffer => LocoIO@51/5 Write SV2=0x4 Firmware rev 1.9.\n", f.displayMessage(l));
l = new LocoNetMessage(new int[] { 0xE5, 0x10, 0x50, 0x04, 0x01, 0x00, 0x01, 0x10, 0x07, 0x14, 0x10, 0x05, 0x06, 0x07, 0x08, 0x12 });
assertEquals("SV1 test 2", "LocoBuffer => LocoIO@4/5 Write SV16=0x14 Firmware rev 7.\n", f.displayMessage(l));
l = new LocoNetMessage(new int[] { 0xE5, 0x10, 0x50, 0x04, 0x01, 0x00, 0x01, 0x10, 0x78, 0x24, 0x1F, 0x05, 0x06, 0x07, 0x08, 0x12 });
assertEquals("SV1 test 3", "LocoBuffer => LocoIO@4/85 Write SV16=0x24 Firmware rev 1.2.0.\n", f.displayMessage(l));
}
use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.
the class LocoMonPaneTest method testFilterMultiple.
@Test
public void testFilterMultiple() throws Exception {
pane.initComponents();
// filter A0
pane.setFilterText("B1 A0");
new org.netbeans.jemmy.QueueTool().waitEmpty(100);
Assert.assertEquals("filter set", "B1 A0", pane.getFilterText());
LocoNetMessage m = new LocoNetMessage(new int[] { 0xA0, 0x07, 0x00, 0x58 });
((LocoMonPane) pane).message(m);
new org.netbeans.jemmy.QueueTool().waitEmpty(100);
Assert.assertEquals("shows message", "", pane.getFrameText());
}
use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.
the class LocoMonPaneTest method testFilterNot.
@Test
public void testFilterNot() throws Exception {
pane.initComponents();
// filter not match
pane.setFilterText("A1");
new org.netbeans.jemmy.QueueTool().waitEmpty(100);
Assert.assertEquals("filter set", "A1", ((LocoMonPane) pane).getFilterText());
LocoNetMessage m = new LocoNetMessage(new int[] { 0xA0, 0x07, 0x00, 0x58 });
((LocoMonPane) pane).message(m);
new org.netbeans.jemmy.QueueTool().waitEmpty(100);
Assert.assertEquals("shows message", "Set speed of loco in slot 7 to 0.\n", ((LocoMonPane) pane).getFrameText());
}
use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.
the class LoaderEngineTest method testGetStartWavDataMessage2.
public void testGetStartWavDataMessage2() {
LoaderEngine l = new LoaderEngine(null);
LocoNetMessage m = l.getStartDataMessage(LoaderEngine.TYPE_WAV, 0x17, 512);
Assert.assertEquals("contents", "D3 04 17 02 00 3D", m.toString());
Assert.assertEquals("checksum", true, m.checkParity());
}
use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.
the class LoaderEngineTest method testGetStartWavDataMessage1.
public void testGetStartWavDataMessage1() {
LoaderEngine l = new LoaderEngine(null);
LocoNetMessage m = l.getStartDataMessage(LoaderEngine.TYPE_WAV, 0x17, 128);
Assert.assertEquals("contents", "D3 04 17 01 00 3E", m.toString());
Assert.assertEquals("checksum", true, m.checkParity());
}
Aggregations