use of org.codice.alliance.video.stream.mpegts.plugins.StreamEndPlugin in project alliance by codice.
the class UdpStreamProcessorTest method testSetStreamEndPlugin.
@Test
public void testSetStreamEndPlugin() throws InterruptedException {
StreamMonitor streamMonitor = mock(StreamMonitor.class);
UdpStreamProcessor udpStreamProcessor = new UdpStreamProcessor(streamMonitor);
RolloverCondition rolloverCondition = mock(RolloverCondition.class);
when(rolloverCondition.isRolloverReady(any())).thenReturn(true);
StreamEndPlugin streamEndPlugin = mock(StreamEndPlugin.class);
udpStreamProcessor.setStreamEndPlugin(streamEndPlugin);
udpStreamProcessor.setRolloverCondition(rolloverCondition);
udpStreamProcessor.setRolloverAction(mock(RolloverAction.class));
udpStreamProcessor.getPacketBuffer().write(new byte[] { 0x00 });
Thread.sleep(1000);
udpStreamProcessor.checkForRollover();
verify(streamEndPlugin).streamEnded(any());
}
Aggregations