Search in sources :

Example 1 with RotateResult

use of org.codice.alliance.video.stream.mpegts.netty.RotateResult 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);
}
Also used : Context(org.codice.alliance.video.stream.mpegts.Context) UdpStreamProcessor(org.codice.alliance.video.stream.mpegts.netty.UdpStreamProcessor) File(java.io.File) PacketBuffer(org.codice.alliance.video.stream.mpegts.netty.PacketBuffer) RotateResult(org.codice.alliance.video.stream.mpegts.netty.RotateResult) Test(org.junit.Test)

Aggregations

File (java.io.File)1 Context (org.codice.alliance.video.stream.mpegts.Context)1 PacketBuffer (org.codice.alliance.video.stream.mpegts.netty.PacketBuffer)1 RotateResult (org.codice.alliance.video.stream.mpegts.netty.RotateResult)1 UdpStreamProcessor (org.codice.alliance.video.stream.mpegts.netty.UdpStreamProcessor)1 Test (org.junit.Test)1