]> git.sesse.net Git - vlc/blobdiff - bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java
Add some locking.
[vlc] / bindings / java / core / src / test / java / org / videolan / jvlc / JVLCTest.java
index 17ec6611313cd61360c7d8f60a139142a1a7a94c..0d8f1ed150ebd4a151ef26e29953d14e8287b380 100644 (file)
@@ -30,7 +30,7 @@ import junit.framework.Assert;
 import org.junit.Test;
 
 
-public class JVLCTest
+public class JVLCTest extends AbstractJVLCTest
 {
     
     String mrl = getClass().getResource("/raffa_voice.ogg").getFile();
@@ -39,14 +39,13 @@ public class JVLCTest
     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);
     }
     
@@ -55,8 +54,39 @@ public class JVLCTest
     {
         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());
+        
+    }
 }