Search in sources :

Example 1 with GstDao

use of com.aws.iot.edgeconnectorforkvs.videorecorder.util.GstDao in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.

the class VideoRecorderUnitTest method registerCustomized_customizedModule_exceptionDoesNotThrow.

@Test
public void registerCustomized_customizedModule_exceptionDoesNotThrow() {
    VideoRecorder recorder = null;
    VideoRecorderBuilder builder = new VideoRecorderBuilder(mockGst, STATE_CALLBACK);
    GstDao dao = builder.getGstDao();
    Pipeline pipe = builder.getPipeline();
    Assertions.assertNotNull(builder.getPipeline());
    RecorderCameraRtsp cameraSrc = new RecorderCameraRtsp(dao, pipe, SRC_URL);
    RecorderBranchFile filePath = new RecorderBranchFile(ContainerType.MATROSKA, dao, pipe, "./record");
    // Add cam
    Assertions.assertThrows(RejectedExecutionException.class, () -> builder.construct());
    Assertions.assertTrue(builder.registerCustomCamera(cameraSrc));
    Assertions.assertFalse(builder.registerCustomCamera(cameraSrc));
    // Add branch
    Assertions.assertThrows(RejectedExecutionException.class, () -> builder.construct());
    Assertions.assertTrue(builder.registerCustomBranch(filePath, "customBranch"));
    Assertions.assertFalse(builder.registerCustomBranch(filePath, "customBranch"));
    // Get branch
    recorder = builder.construct();
    Assertions.assertNotNull(recorder.getBranch("customBranch"));
    Assertions.assertTrue(null == recorder.getBranch("NoSuchBranch"));
}
Also used : GstDao(com.aws.iot.edgeconnectorforkvs.videorecorder.util.GstDao) Pipeline(org.freedesktop.gstreamer.Pipeline) Test(org.junit.jupiter.api.Test)

Aggregations

GstDao (com.aws.iot.edgeconnectorforkvs.videorecorder.util.GstDao)1 Pipeline (org.freedesktop.gstreamer.Pipeline)1 Test (org.junit.jupiter.api.Test)1