Skip to content

Commit

Permalink
fix: Fixes tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Apr 11, 2024
1 parent bc0d1e9 commit 3604ae8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/org/jitsi/jigasi/JvbConference.java
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ else if (ChatRoomMemberPresenceChangeEvent.MEMBER_UPDATED
{
gatewaySession.notifyChatRoomMemberLeft(member);
logger.info(
this.callContext + " Member left : " + member.getRole()
this.callContext + " Member left : " + member.getRole()
+ " " + member.getContactAddress());

jigasiChatRoomMembers.remove(member.getName());
Expand Down Expand Up @@ -1965,6 +1965,12 @@ public void setLobbyEnabled(boolean value)
*/
private String getMeetingId()
{
// in case when running unittests
if (this.getConnection() == null)
{
return null;
}

if (this.meetingId == null)
{
try
Expand Down Expand Up @@ -1994,6 +2000,12 @@ private String getMeetingId()
*/
private void updateFromRoomConfiguration()
{
// in case when running unittests
if (this.getConnection() == null)
{
return;
}

try
{
DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(getConnection()).
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/org/jitsi/jigasi/MockJvbConferenceFocus.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ private void inviteToConference(ChatRoomMember member)
myName + " is inviting " + member.getName()
+ " to join conference in room " + roomName);

CallStateListener callStateWatch = new CallStateListener();
try
{
// let's wait for the call in progress as sometimes the test logic may answer the call after being ended
// and mess up the tests
callStateWatch.waitForState(xmppCall, CallState.CALL_IN_PROGRESS, 2000);
}
catch (InterruptedException e)
{
throw new RuntimeException(e);
}

if (leaveRoomAfterInvite)
{
logger.info(myName + " invited peer will leave the room");
Expand Down

0 comments on commit 3604ae8

Please sign in to comment.