in src/integrationtests/java/com/aws/iot/integrationtests/edgeconnectorforkvs/videorecorder/VideoRecorderNewRecorderAppPathTest.java [130:186]
public void newRecTest_newRecorder_sizeNoneZero() throws InterruptedException, IOException {
// Start recording in their own threads
System.out.println("Test Start");
this.initByteArray(true);
final RecorderTest recorder1 =
new RecorderTest(this.rec1ByteOut1, this.rec1ByteOut2, "recorder1");
final RecorderTest recorder2 =
new RecorderTest(this.rec2ByteOut1, this.rec2ByteOut2, "recorder2");
Thread recordThread1 = new Thread(() -> recorder1.run());
Thread recordThread2 = new Thread(() -> recorder2.run());
recorder1.toggle(true);
recorder2.toggle(true);
recordThread1.start();
recordThread2.start();
TimeUnit.SECONDS.sleep(this.TEST_IDLE_INTERVAL);
recorder1.stop();
recorder2.stop();
checkByteArray(false);
this.initByteArray(false);
// stop toggle
System.out.println("Re-toggle stop");
this.initByteArray(true);
final RecorderTest recorder3 =
new RecorderTest(this.rec1ByteOut1, this.rec1ByteOut2, "recorder3");
final RecorderTest recorder4 =
new RecorderTest(this.rec2ByteOut1, this.rec2ByteOut2, "recorder4");
Thread recordThread3 = new Thread(() -> recorder3.run());
Thread recordThread4 = new Thread(() -> recorder4.run());
recordThread3.start();
recordThread4.start();
TimeUnit.SECONDS.sleep(this.TEST_IDLE_INTERVAL);
recorder3.stop();
recorder4.stop();
checkByteArray(true);
this.initByteArray(false);
// start toggle
System.out.println("Re-toggle start");
this.initByteArray(true);
final RecorderTest recorder5 =
new RecorderTest(this.rec1ByteOut1, this.rec1ByteOut2, "recorder5");
final RecorderTest recorder6 =
new RecorderTest(this.rec2ByteOut1, this.rec2ByteOut2, "recorder6");
Thread recordThread5 = new Thread(() -> recorder5.run());
Thread recordThread6 = new Thread(() -> recorder6.run());
recorder5.toggle(true);
recorder6.toggle(true);
recordThread5.start();
recordThread6.start();
TimeUnit.SECONDS.sleep(this.TEST_IDLE_INTERVAL);
recorder5.stop();
recorder6.stop();
checkByteArray(false);
this.initByteArray(false);
System.out.println("Test Bye");
}