import org.junit.Test;
-public class JVLCTest
+public class JVLCTest extends AbstractJVLCTest
{
String mrl = getClass().getResource("/raffa_voice.ogg").getFile();
public void jvlcNew()
{
JVLC jvlc = new JVLC();
- Assert.assertNotNull(jvlc.getMediaList());
+ Assert.assertNotNull(jvlc.getAudio());
}
@Test
public void jvlcPlay()
{
- JVLC jvlc = new JVLC();
- MediaInstance instance = jvlc.play(mrl);
+ MediaPlayer instance = jvlc.play(mrl);
Assert.assertNotNull(instance);
}
{
JVLC jvlc = new JVLC();
jvlc.release();
- jvlc.release();
}
-
+ @Test
+ public void jvlcMultipleInstances()
+ {
+ JVLC[] jvlcInstancesArray = new JVLC[10];
+
+ for (int i = 0; i < jvlcInstancesArray.length; i++)
+ {
+ jvlcInstancesArray[i] = new JVLC();
+ }
+ for (int i = 0; i < jvlcInstancesArray.length; i++)
+ {
+ jvlcInstancesArray[i].release();
+ }
+
+ }
+
+ @Test
+ public void twoAudioInstancesTest() throws Exception
+ {
+ JVLC instance1 = new JVLC();
+ JVLC instance2 = new JVLC();
+
+ instance1.play(mrl);
+ instance2.play(mrl);
+
+ Thread.sleep(1000);
+
+ instance1.getAudio().setMute(true);
+ Assert.assertNotNull(instance2.getAudio());
+ Assert.assertTrue(instance1.getAudio().getMute());
+ Assert.assertTrue(!instance2.getAudio().getMute());
+
+ }
}