add jni wrapper junit test case

This commit is contained in:
Jehan Monnier 2015-02-05 16:04:06 +01:00
parent 284032b213
commit 5e105aec46
3 changed files with 63 additions and 1 deletions

View file

@ -30,6 +30,7 @@ public class TestRunner extends JUnitReportTestRunner {
@Override
public TestSuite getAllTests () {
TestSuite suite = new TestSuite("Tests");
suite.addTest(new WrapperTester());
addSuites(suite, mSuite, mTest);
return suite;
}

View file

@ -0,0 +1,61 @@
package org.linphone.tester;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListenerBase;
import android.test.AndroidTestCase;
import junit.framework.Assert;
public class WrapperTester extends AndroidTestCase {
public WrapperTester() {
super();
setName("wrapper tester");
}
LinphoneCore mCore;
@Override
protected void runTest() throws Throwable {
mCore.enableAudioMulticast(true);
Assert.assertEquals(true, mCore.audioMulticastEnabled());
mCore.enableAudioMulticast(false);
Assert.assertEquals(false, mCore.audioMulticastEnabled());
mCore.enableVideoMulticast(true);
Assert.assertEquals(true, mCore.videoMulticastEnabled());
mCore.enableVideoMulticast(false);
Assert.assertEquals(false, mCore.videoMulticastEnabled());
String ip = "224.3.2.1";
mCore.setAudioMulticastAddr(ip);
Assert.assertEquals(ip, mCore.getAudioMulticastAddr());
ip = "224.3.2.3";
mCore.setVideoMulticastAddr(ip);
Assert.assertEquals(ip, mCore.getVideoMulticastAddr());
mCore.setAudioMulticastTtl(3);
Assert.assertEquals(3, mCore.getAudioMulticastTtl());
mCore.setVideoMulticastTtl(4);
Assert.assertEquals(4, mCore.getVideoMulticastTtl());
}
@Override
protected void setUp() throws Exception {
// TODO Auto-generated method stub
super.setUp();
mCore = LinphoneCoreFactory.instance().createLinphoneCore(new LinphoneCoreListenerBase(),null);
}
@Override
protected void tearDown() throws Exception {
// TODO Auto-generated method stub
super.tearDown();
mCore.destroy();
mCore=null;
}
}

@ -1 +1 @@
Subproject commit c2116983d51eb3fa4ec0ada10b87077d36f25a3e
Subproject commit 2b7f2fd1cb82b2c36014f03914f02e3325990da4