in src/integrationtests/java/com/aws/iot/integrationtests/edgeconnectorforkvs/videorecorder/VideoRecorderToggleSetAppPathTest.java [170:221]
public void setToggleTest_toggleStream_sizeNoneZero() throws InterruptedException, IOException {
System.out.println("Test Init");
this.initByteArray(true);
RecorderTest recorder1 =
new RecorderTest(this.rec1ByteOut1, this.rec1ByteOut2, "recorder1");
RecorderTest recorder2 =
new RecorderTest(this.rec2ByteOut1, this.rec2ByteOut2, "recorder2");
Thread recordThread1 = new Thread(() -> recorder1.run());
Thread recordThread2 = new Thread(() -> recorder2.run());
recorder1.setToggle(this.rec1ByteOut1, this.rec1ByteOut2);
recorder2.setToggle(this.rec2ByteOut1, this.rec2ByteOut2);
recorder1.toggle(true);
recorder2.toggle(true);
// Start recording in their own threads
System.out.println("Test Start");
recordThread1.start();
recordThread2.start();
TimeUnit.SECONDS.sleep(this.TEST_IDLE_INTERVAL);
// stop toggle
System.out.println("stop toggle");
recorder1.toggle(false);
recorder2.toggle(false);
checkByteArray(false);
this.initByteArray(false);
this.initByteArray(true);
recorder1.setToggle(this.rec1ByteOut1, this.rec1ByteOut2);
recorder2.setToggle(this.rec2ByteOut1, this.rec2ByteOut2);
TimeUnit.SECONDS.sleep(this.TEST_IDLE_INTERVAL);
checkByteArray(true);
this.initByteArray(false);
// start toggle
System.out.println("start toggle");
this.initByteArray(true);
recorder1.setToggle(this.rec1ByteOut1, this.rec1ByteOut2);
recorder2.setToggle(this.rec2ByteOut1, this.rec2ByteOut2);
recorder1.toggle(true);
recorder2.toggle(true);
TimeUnit.SECONDS.sleep(this.TEST_IDLE_INTERVAL);
// stop rec
System.out.println("stop rec");
recorder1.toggle(false);
recorder2.toggle(false);
checkByteArray(false);
this.initByteArray(false);
recorder1.stop();
recorder2.stop();
System.out.println("Bye");
}