From 110508383d4714c907d10a84b4dd534b5cff118e Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 5 Feb 2019 15:09:41 +0100 Subject: [PATCH] openvidu-test-e2e: check number of files in ZIP individual recordings --- .../openvidu/test/e2e/OpenViduTestAppE2eTest.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index 8a4665ed..1b954d6c 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -1213,7 +1213,7 @@ public class OpenViduTestAppE2eTest { String recPath = recordingsPath + sessionName + "/"; Recording recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(sessionName); - this.checkIndividualRecording(recPath, recording, "opus", "vp8"); + this.checkIndividualRecording(recPath, recording, 1, "opus", "vp8"); // Try to get the stopped recording user.getDriver().findElement(By.id("get-recording-btn")).click(); @@ -1447,12 +1447,12 @@ public class OpenViduTestAppE2eTest { // Check video-only INDIVIDUAL recording recPath = recordingsPath + SESSION_NAME + "-2/"; recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "-2"); - this.checkIndividualRecording(recPath, recording, "opus", "vp8"); + this.checkIndividualRecording(recPath, recording, 3, "opus", "vp8"); // Check audio-only INDIVIDUAL recording recPath = recordingsPath + SESSION_NAME + "-3/"; recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "-3"); - this.checkIndividualRecording(recPath, recording, "opus", "vp8"); + this.checkIndividualRecording(recPath, recording, 2, "opus", "vp8"); user.getDriver().findElement(By.id("close-dialog-btn")).click(); Thread.sleep(500); @@ -1896,8 +1896,8 @@ public class OpenViduTestAppE2eTest { return isFine; } - private void checkIndividualRecording(String recPath, Recording recording, String audioDecoder, - String videoDecoder) { + private void checkIndividualRecording(String recPath, Recording recording, int numberOfVideoFiles, + String audioDecoder, String videoDecoder) { // Should be only 2 files: zip and metadata File folder = new File(recPath); @@ -1911,6 +1911,9 @@ public class OpenViduTestAppE2eTest { List unzippedWebmFiles = new Unzipper().unzipFile(recPath, recording.getName() + ".zip"); + log.info("Expected {} video files and ZIP file has {}", numberOfVideoFiles, unzippedWebmFiles.size()); + Assert.assertEquals(numberOfVideoFiles, unzippedWebmFiles.size()); + File jsonSyncFile = new File(recPath + recording.getName() + ".json"); Assert.assertTrue(jsonSyncFile.exists() && jsonSyncFile.length() > 0); JsonObject jsonSyncMetadata;