Fix tests after RecordingProperties#ignoreFailedStreams

pull/630/head
pabloFuente 2021-05-11 14:15:02 +02:00
parent c32548b8a2
commit 390aca598b
4 changed files with 41 additions and 21 deletions

View File

@ -192,6 +192,15 @@ public class Recording {
return this.recordingProperties.customLayout();
}
/**
* Whether failed streams were ignored when the recording process started or
* not. Only applicable if {@link io.openvidu.java.client.Recording.OutputMode}
* is {@link io.openvidu.java.client.Recording.OutputMode#INDIVIDUAL}
*/
public boolean ignoreFailedStreams() {
return this.recordingProperties.ignoreFailedStreams();
}
/**
* Session associated to the recording
*/

View File

@ -216,16 +216,17 @@ public class RecordingProperties {
* starting the recording. This property only applies to
* {@link io.openvidu.java.client.Recording.OutputMode#INDIVIDUAL} recordings.
* For this type of recordings, when calling
* {@link io.openvidu.java.client.OpenVidu#startRecording} by default all the
* streams available at the moment the recording process starts must be healthy
* and properly sending media. If some stream that should be sending media is
* broken, then the recording process fails after a 10s timeout. In this way
* your application is notified that some stream is not being recorded, so it
* can retry the process again. But you can disable this rollback behavior and
* simply ignore any failed stream, which will be susceptible to be recorded in
* the future if media starts flowing as expected at any point. The downside of
* this behavior is that you will have no guarantee that all streams present at
* the beginning of a recording are actually being recorded.
* {@link io.openvidu.java.client.OpenVidu#startRecording(String, RecordingProperties)}
* by default all the streams available at the moment the recording process
* starts must be healthy and properly sending media. If some stream that should
* be sending media is broken, then the recording process fails after a 10s
* timeout. In this way your application is notified that some stream is not
* being recorded, so it can retry the process again. But you can disable this
* rollback behavior and simply ignore any failed stream, which will be
* susceptible to be recorded in the future if media starts flowing as expected
* at any point. The downside of this behavior is that you will have no
* guarantee that all streams present at the beginning of a recording are
* actually being recorded.
*/
public RecordingProperties.Builder ignoreFailedStreams(boolean ignoreFailedStreams) {
this.ignoreFailedStreams = ignoreFailedStreams;
@ -402,16 +403,17 @@ public class RecordingProperties {
* This property only applies to
* {@link io.openvidu.java.client.Recording.OutputMode#INDIVIDUAL} recordings.
* For this type of recordings, when calling
* {@link io.openvidu.java.client.OpenVidu#startRecording} by default all the
* streams available at the moment the recording process starts must be healthy
* and properly sending media. If some stream that should be sending media is
* broken, then the recording process fails after a 10s timeout. In this way
* your application is notified that some stream is not being recorded, so it
* can retry the process again. But you can disable this rollback behavior and
* simply ignore any failed stream, which will be susceptible to be recorded in
* the future if media starts flowing as expected at any point. The downside of
* this behavior is that you will have no guarantee that all streams present at
* the beginning of a recording are actually being recorded.<br>
* {@link io.openvidu.java.client.OpenVidu#startRecording(String, RecordingProperties)}
* by default all the streams available at the moment the recording process
* starts must be healthy and properly sending media. If some stream that should
* be sending media is broken, then the recording process fails after a 10s
* timeout. In this way your application is notified that some stream is not
* being recorded, so it can retry the process again. But you can disable this
* rollback behavior and simply ignore any failed stream, which will be
* susceptible to be recorded in the future if media starts flowing as expected
* at any point. The downside of this behavior is that you will have no
* guarantee that all streams present at the beginning of a recording are
* actually being recorded.<br>
* <br>
*
* Default to false
@ -510,7 +512,7 @@ public class RecordingProperties {
}
}
}
if (OutputMode.INDIVIDUAL.equals(outputModeAux)) {
if (json.has("ignoreFailedStreams") && OutputMode.INDIVIDUAL.equals(outputModeAux)) {
builder.ignoreFailedStreams(json.get("ignoreFailedStreams").getAsBoolean());
}
if (json.has("mediaNode")) {

View File

@ -156,6 +156,7 @@ export class OpenVidu {
outputMode: properties.outputMode,
recordingLayout: properties.recordingLayout,
customLayout: properties.customLayout,
ignoreFailedStreams: properties.ignoreFailedStreams,
resolution: properties.resolution,
frameRate: properties.frameRate,
hasAudio: properties.hasAudio,

View File

@ -2304,6 +2304,8 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
Assert.assertEquals("Wrong recording mode", RecordingMode.ALWAYS, session.getProperties().recordingMode());
Assert.assertEquals("Wrong default output mode", Recording.OutputMode.INDIVIDUAL,
session.getProperties().defaultRecordingProperties().outputMode());
Assert.assertEquals("Wrong default ignoreFailedStreams", false,
session.getProperties().defaultRecordingProperties().ignoreFailedStreams());
Assert.assertTrue("Session should be being recorded", session.isBeingRecorded());
Assert.assertEquals("Expected 2 active connections but found " + session.getActiveConnections().size(), 2,
session.getActiveConnections().size());
@ -2483,6 +2485,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
Assert.assertEquals("Wrong recording size", 0, recording.getSize());
Assert.assertNull("Wrong recording url", recording.getUrl());
Assert.assertEquals("Wrong recording output mode", Recording.OutputMode.INDIVIDUAL, recording.getOutputMode());
Assert.assertEquals("Wrong recording ignoreFailedStreams", false, recording.ignoreFailedStreams());
Assert.assertNull("Wrong recording layout", recording.getRecordingLayout());
Assert.assertNull("Wrong recording custom layout", recording.getCustomLayout());
Assert.assertNull("Wrong recording resolution", recording.getResolution());
@ -3370,6 +3373,9 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
user.getDriver().findElement(By.id("add-user-btn")).click();
user.getDriver().findElement(By.id("session-settings-btn-0")).click();
Thread.sleep(1000);
String rareCharsName = "öæééEstoSi`+´çḈ€$";
user.getDriver().findElement(By.id("recording-name-field")).sendKeys(rareCharsName);
user.getDriver().findElement(By.id("recording-mode-select")).click();
Thread.sleep(500);
user.getDriver().findElement(By.id("option-ALWAYS")).click();
@ -3413,6 +3419,8 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
Assert.assertEquals("Wrong recording startTime/timestamp in webhook event",
event.get("startTime").getAsLong(), event.get("timestamp").getAsLong());
Assert.assertNull("Wrong recording reason in webhook event (should be null)", event.get("reason"));
Assert.assertEquals("Wrong recording name in webhook event", rareCharsName,
event.get("name").getAsString());
// Filter event webhook
user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .filter-btn")).click();