Search in sources :

Example 1 with TempFileGenerator

use of org.codice.alliance.video.stream.mpegts.filename.TempFileGenerator in project alliance by codice.

the class PacketBufferTest method setup.

@Before
public void setup() throws IOException {
    TempFileGenerator tempFileGenerator = mock(TempFileGenerator.class);
    when(tempFileGenerator.generate()).thenReturn(new File("x"));
    packetBuffer = new PacketBuffer();
    outputStream = mock(OutputStream.class);
    packetBuffer.setOutputStreamFactory((file, append) -> outputStream);
    packetBuffer.setTempFileGenerator(tempFileGenerator);
    rolloverCondition = mock(RolloverCondition.class);
    when(rolloverCondition.isRolloverReady(any())).thenReturn(true);
    tempFile = null;
    os = new ByteArrayOutputStream();
}
Also used : TempFileGenerator(org.codice.alliance.video.stream.mpegts.filename.TempFileGenerator) OutputStream(java.io.OutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RolloverCondition(org.codice.alliance.video.stream.mpegts.rollover.RolloverCondition) File(java.io.File) Before(org.junit.Before)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 OutputStream (java.io.OutputStream)1 TempFileGenerator (org.codice.alliance.video.stream.mpegts.filename.TempFileGenerator)1 RolloverCondition (org.codice.alliance.video.stream.mpegts.rollover.RolloverCondition)1 Before (org.junit.Before)1