mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: fetch sessions before close on AfterEach
parent
fe29312bfe
commit
85204cb743
|
@ -114,6 +114,7 @@ public class OpenViduTestAppE2eTest {
|
||||||
BrowserUser user;
|
BrowserUser user;
|
||||||
Collection<BrowserUser> otherUsers = new ArrayList<>();
|
Collection<BrowserUser> otherUsers = new ArrayList<>();
|
||||||
volatile static boolean isRecordingTest;
|
volatile static boolean isRecordingTest;
|
||||||
|
private static OpenVidu OV;
|
||||||
|
|
||||||
@BeforeAll()
|
@BeforeAll()
|
||||||
static void setupAll() {
|
static void setupAll() {
|
||||||
|
@ -154,6 +155,7 @@ public class OpenViduTestAppE2eTest {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
OV = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupBrowser(String browser) {
|
void setupBrowser(String browser) {
|
||||||
|
@ -211,13 +213,19 @@ public class OpenViduTestAppE2eTest {
|
||||||
other.dispose();
|
other.dispose();
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getActiveSessions().forEach(session -> {
|
try {
|
||||||
|
OV.fetch();
|
||||||
|
} catch (OpenViduJavaClientException | OpenViduHttpException e1) {
|
||||||
|
log.error("Error fetching sessions: {}", e1.getMessage());
|
||||||
|
}
|
||||||
|
OV.getActiveSessions().forEach(session -> {
|
||||||
try {
|
try {
|
||||||
session.close();
|
session.close();
|
||||||
|
log.info("Session {} successfully closed", session.getSessionId());
|
||||||
} catch (OpenViduJavaClientException e) {
|
} catch (OpenViduJavaClientException e) {
|
||||||
e.printStackTrace();
|
log.error("Error closing session: {}", e.getMessage());
|
||||||
} catch (OpenViduHttpException e) {
|
} catch (OpenViduHttpException e) {
|
||||||
e.printStackTrace();
|
log.error("Error closing session: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (isRecordingTest) {
|
if (isRecordingTest) {
|
||||||
|
|
Loading…
Reference in New Issue