use of org.codice.alliance.video.stream.mpegts.netty.PacketBuffer in project alliance by codice.
the class FlushPacketBufferStreamShutdownPluginTest method testOnShutdown.
@Test
public void testOnShutdown() throws StreamShutdownException, IOException {
Context context = mock(Context.class);
UdpStreamProcessor udpStreamProcessor = mock(UdpStreamProcessor.class);
PacketBuffer packetBuffer = mock(PacketBuffer.class);
File file = mock(File.class);
when(context.getUdpStreamProcessor()).thenReturn(udpStreamProcessor);
when(udpStreamProcessor.getPacketBuffer()).thenReturn(packetBuffer);
when(packetBuffer.flushAndRotate()).thenReturn(new RotateResult(file, false));
FlushPacketBufferStreamShutdownPlugin flushPacketBufferStreamShutdownPlugin = new FlushPacketBufferStreamShutdownPlugin();
flushPacketBufferStreamShutdownPlugin.onShutdown(context);
verify(udpStreamProcessor).doRollover(file);
}
use of org.codice.alliance.video.stream.mpegts.netty.PacketBuffer in project alliance by codice.
the class ResetPacketBufferStreamShutdownPluginTest method testOnShutdown.
@Test
public void testOnShutdown() throws StreamShutdownException {
PacketBuffer packetBuffer = mock(PacketBuffer.class);
UdpStreamProcessor udpStreamProcessor = mock(UdpStreamProcessor.class);
Context context = mock(Context.class);
when(context.getUdpStreamProcessor()).thenReturn(udpStreamProcessor);
when(udpStreamProcessor.getPacketBuffer()).thenReturn(packetBuffer);
ResetPacketBufferStreamShutdownPlugin resetPacketBufferStreamShutdownPlugin = new ResetPacketBufferStreamShutdownPlugin();
resetPacketBufferStreamShutdownPlugin.onShutdown(context);
verify(packetBuffer).reset();
}
Aggregations