Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command line parameters to the applications #214

Open
wants to merge 1 commit into
base: malleus
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions src/test/java/org/jitsi/meet/test/MalleusJitsificus.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public class MalleusJitsificus
*/
private static final String INPUT_VIDEO_FILE
= "resources/FourPeople_1280x720_60.y4m";

private static final String INPUT_AUDIO_FILE
= "resources/fakeAudioStream.wav";
public static final String CONFERENCES_PNAME
= "org.jitsi.malleus.conferences";
public static final String PARTICIPANTS_PNAME
Expand All @@ -48,6 +49,12 @@ public class MalleusJitsificus
= "org.jitsi.malleus.duration";
public static final String ROOM_NAME_PREFIX_PNAME
= "org.jitsi.malleus.room_name_prefix";
public static final String INTERVAL
manang marked this conversation as resolved.
Show resolved Hide resolved
= "org.jitsi.malleus.interval";
public static final String FAKE_AUDIO
= "org.jitsi.malleus.fake_audio";
public static final String FAKE_VIDEO
= "org.jitsi.malleus.fake_video";


@DataProvider(name = "dp", parallel = true)
Expand All @@ -56,6 +63,11 @@ public Object[][] createData(ITestContext context)
int numConferences = Integer.valueOf(System.getProperty(CONFERENCES_PNAME));
int numParticipants = Integer.valueOf(System.getProperty(PARTICIPANTS_PNAME));
String numSendersStr = System.getProperty(SENDERS_PNAME);
String fakeAudio = System.getProperty(FAKE_AUDIO);
String fakeVideo = System.getProperty(FAKE_VIDEO);
int interval = 0;
if (System.getProperty(INTERVAL) != null && !System.getProperty(INTERVAL).isEmpty())
interval = Integer.valueOf(System.getProperty(INTERVAL));
int numSenders = numSendersStr == null
? numParticipants
: Integer.valueOf(numSendersStr);
Expand Down Expand Up @@ -83,6 +95,9 @@ public Object[][] createData(ITestContext context)
print("duration=" + timeoutMs + "ms");
print("room_name_prefix=" + roomNamePrefix);
print("enable_p2p=" + enableP2p);
print("fake_audio=" + fakeAudio);
print("fake_video=" + fakeVideo);
print("interval=" + interval);

Object[][] ret = new Object[numConferences][4];
for (int i = 0; i < numConferences; i++)
Expand All @@ -96,15 +111,15 @@ public Object[][] createData(ITestContext context)
.appendConfig("config.disable1On1Mode=false")

.appendConfig("config.p2p.enabled=" + (enableP2p ? "true" : "false"));
ret[i] = new Object[] { url, numParticipants, timeoutMs, numSenders};
ret[i] = new Object[] { url, numParticipants, timeoutMs, numSenders, fakeAudio, fakeVideo, interval};
}

return ret;
}

@Test(dataProvider = "dp")
public void testMain(
JitsiMeetUrl url, int numberOfParticipants, long waitTime, int numSenders)
JitsiMeetUrl url, int numberOfParticipants, long waitTime, int numSenders, String fakeAudio, String fakeVideo, int interval)
throws InterruptedException
{
Thread[] runThreads = new Thread[numberOfParticipants];
Expand All @@ -116,8 +131,11 @@ public void testMain(
i,
url,
waitTime,
i >= numSenders /* no video */);
i >= numSenders /* no video */,
fakeAudio,
fakeVideo);
}
Thread.sleep(interval);

for (Thread t : runThreads)
{
Expand All @@ -131,15 +149,18 @@ public void testMain(
private Thread runAsync(int i,
JitsiMeetUrl url,
long waitTime,
boolean muteVideo)
boolean muteVideo,
String fakeAudio,
String fakeVideo)
{
JitsiMeetUrl _url = url.copy();

Thread joinThread = new Thread(() -> {

WebParticipantOptions ops
= new WebParticipantOptions()
.setFakeStreamVideoFile(INPUT_VIDEO_FILE);
.setFakeStreamVideoFile(fakeVideo != null && !fakeVideo.isEmpty() ? fakeVideo : INPUT_VIDEO_FILE)
.setFakeStreamAudioFile(fakeAudio != null && !fakeAudio.isEmpty() ? fakeAudio : INPUT_AUDIO_FILE);

WebParticipant participant
= participants
Expand Down