@Test public void testReceiveAfterRestart() throws Exception { List<EspRadioTelegram> expectedTelegrams = new ArrayList<EspRadioTelegram>(); expectedTelegrams.add(new Esp3RPSTelegram(senderID, (byte)0x11, (byte)0x22)); expectedTelegrams.add(new Esp31BSTelegram(senderID, (byte)0x33, (byte)0x44)); expectedTelegrams.add(new Esp34BSTelegram( senderID, new byte[] {(byte)0xFF, 0x01, 0x02, 0x03}, (byte)0x55) ); for(EspRadioTelegram telegram : expectedTelegrams) { mockPort.addDataToReturn(((EspPacket) telegram).asByteArray()); } RadioListener listener = new RadioListener(2, expectedTelegrams.size()); processor.setProcessorListener(listener); processor.start(); List<EspRadioTelegram> receivedTelegrams = listener.waitForRadioTelegrams(); processor.stop(); Assert.assertNotNull(receivedTelegrams); Assert.assertEquals(expectedTelegrams.size(), receivedTelegrams.size()); for(EspRadioTelegram telegram : expectedTelegrams) { mockPort.addDataToReturn(((EspPacket) telegram).asByteArray()); } listener = new RadioListener(2, expectedTelegrams.size()); processor.setProcessorListener(listener); processor.start(); receivedTelegrams = listener.waitForRadioTelegrams(); processor.stop(); Assert.assertNotNull(receivedTelegrams); Assert.assertEquals(expectedTelegrams.size(), receivedTelegrams.size()); }
public void setProcessorListener(Esp3ProcessorListener listener) { this.listener = listener; }
Esp3Processor extends AbstractEspProcessor<Esp3Packet> { public void setProcessorListener(Esp3ProcessorListener listener) { this.listener = listener; } }
Esp3Processor extends AbstractEspProcessor<Esp3Packet> { public void setProcessorListener(Esp3ProcessorListener listener) { this.listener = listener; } Esp3Processor(Esp3ComPortAdapter port); }
Esp3Processor extends AbstractEspProcessor<Esp3Packet> { public void setProcessorListener(Esp3ProcessorListener listener) { this.listener = listener; } Esp3Processor(Esp3ComPortAdapter port); void setProcessorListener(Esp3ProcessorListener listener); }
Esp3Processor extends AbstractEspProcessor<Esp3Packet> { public void setProcessorListener(Esp3ProcessorListener listener) { this.listener = listener; } Esp3Processor(Esp3ComPortAdapter port); void setProcessorListener(Esp3ProcessorListener listener); static final long ESP3_RESPONSE_TIMEOUT; }