]> git.sesse.net Git - vlc/commitdiff
jvlc: minor changes on unit tests
authorFilippo Carone <littlejohn@videolan.org>
Thu, 31 Jul 2008 17:42:23 +0000 (19:42 +0200)
committerFilippo Carone <littlejohn@videolan.org>
Thu, 31 Jul 2008 17:42:55 +0000 (19:42 +0200)
bindings/java/core/src/test/java/org/videolan/jvlc/AbstractJVLCTest.java
bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCInternalTest.java
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java

index 9468e85dc9f49de21880af7967349488769156c3..86d6b27544e3e72e3e4319d63e6a63fef375d299 100644 (file)
@@ -57,7 +57,8 @@ public abstract class AbstractJVLCTest
     @Before
     public void testSetup()
     {
-        jvlc = new JVLC("-vvv --ignore-config --no-media-library -I dummy --aout=dummy --vout=dummy --rtsp-host 127.0.0.1:5554");
+        jvlc = new JVLC("-vvv --ignore-config --no-media-library -I dummy -A dummy -V dummy --rtsp-host 127.0.0.1:5554");
+        jvlc.setLogVerbosity(LoggerVerbosityLevel.DEBUG);
         downloadSample();
     }
 
index e7c540cf9339dd7cea211faca8cd6704042fe517..efdcbcb62138b91562390abb1127963336e438f6 100644 (file)
@@ -65,15 +65,20 @@ public abstract class AbstractVLCInternalTest
     public void testSetup()
     {
         exception = new libvlc_exception_t();
-        libvlcInstance = libvlc.libvlc_new(0, new String[]{
+        String[] args = new String[]{
             "-vvv",
             "--ignore-config",
+            "--reset-plugins-cache",
             "--no-media-library",
             "-I",
             "dummy",
-            "--aout=dummy",
-            "--vout=dummy" }, exception);
+            "-A",
+            "dummy",
+            "-V",
+            "dummy" };
+        libvlcInstance = libvlc.libvlc_new(args.length, args, exception);
         libvlc.libvlc_exception_clear(exception);
+
         downloadSample();
     }
 
index e79aee422da3560906f512046849d8fed54adf3d..8a6b0f3330ed23f6d4bdf7f8a5db42a2f020ac5c 100644 (file)
@@ -37,6 +37,7 @@ import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
 
 public class MediaListPlayerTest extends AbstractVLCInternalTest
 {
+
     @Test
     public void mediaListPlayerNewTest()
     {
@@ -97,7 +98,7 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
     /**
      * this fails: see https://trac.videolan.org/vlc/ticket/1527
      */
-    // @Test
+    @Test
     public void mediaListPlayerPlay()
     {
         libvlc_exception_t exception = new libvlc_exception_t();
@@ -166,9 +167,7 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
             }
             Thread.sleep(150);
         }
-        // FIXME give stats the time to run... there's probably a race condition in misc/stats.c:259 that
-        // needs to be fixed
-        // Thread.sleep(400);
+        Thread.sleep(400);
         libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception);
         libvlc.libvlc_media_list_release(mediaList);
         libvlc.libvlc_media_list_player_release(mediaListPlayer);
@@ -208,20 +207,7 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
             Thread.sleep(150);
         }
         libvlc.libvlc_media_list_player_pause(mediaListPlayer, exception);
-        Assert.assertEquals(exception.message, 0, exception.raised);
-        while (true)
-        {
-            int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception);
-            if (exception.raised == 1)
-            {
-                throw new RuntimeException("Native exception thrown");
-            }
-            if (playing == 0)
-            {
-                break;
-            }
-            Thread.sleep(150);
-        }
+
         int state = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception);
         Assert.assertEquals(exception.message, 0, exception.raised);
         Assert.assertEquals(