[vlma-devel] commit: Re-enable DirectMulticastStreamWatcherTest. (Adrien Grand )

git version control git at videolan.org
Mon Oct 13 22:57:50 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Mon Oct 13 22:54:37 2008 +0200| [5e1f8e5afe135e22a44c952cd963bdc30784e5d2] | committer: Adrien Grand 

Re-enable DirectMulticastStreamWatcherTest.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=5e1f8e5afe135e22a44c952cd963bdc30784e5d2
---

 .../watcher/DirectMulticastStreamWatcherTest.java  |    9 +++++----
 .../vlma/watcher/HttpStreamWatcherTest.java        |    2 --
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/vlma-core/src/test/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcherTest.java b/vlma-core/src/test/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcherTest.java
index 7b2dd00..6a55464 100644
--- a/vlma-core/src/test/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcherTest.java
+++ b/vlma-core/src/test/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcherTest.java
@@ -23,7 +23,6 @@ package org.videolan.vlma.watcher;
 import static org.junit.Assert.assertFalse;
 
 import java.net.InetAddress;
-import java.util.Random;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -33,6 +32,9 @@ import org.videolan.vlma.model.SatChannel;
 
 public class DirectMulticastStreamWatcherTest {
 
+    // We assume that there is no streaming broadcasted on this IP address
+    static final String localMulticastAddress = "224.0.0.1";
+
     private StreamWatcher watcher;
 
     @Before
@@ -42,13 +44,12 @@ public class DirectMulticastStreamWatcherTest {
 
     @Test
     public void testIsPlayed() throws Exception {
-        Random random = new Random();
         Media media = new SatChannel();
         Program program = new Program();
         media.setProgram(program);
         // Pick a random address
-        program.setIp(InetAddress.getByName("239.142." + random.nextInt(256) + "." + random.nextInt(256)));
-        //assertFalse(watcher.isPlayed(media));
+        program.setIp(InetAddress.getByName(localMulticastAddress));
+        assertFalse(watcher.isPlayed(media));
     }
 
 }
diff --git a/vlma-core/src/test/java/org/videolan/vlma/watcher/HttpStreamWatcherTest.java b/vlma-core/src/test/java/org/videolan/vlma/watcher/HttpStreamWatcherTest.java
index b77c675..7a98459 100644
--- a/vlma-core/src/test/java/org/videolan/vlma/watcher/HttpStreamWatcherTest.java
+++ b/vlma-core/src/test/java/org/videolan/vlma/watcher/HttpStreamWatcherTest.java
@@ -54,8 +54,6 @@ public class HttpStreamWatcherTest {
         program.setSapGroup("group");
         program.setSapName("name");
         media.setProgram(program);
-        assertFalse(watcher.isPlayed(media));
-        // Pick a random address
         program.setPlayer(InetAddress.getByName("127.0.0.1"));
         assertFalse(watcher.isPlayed(media));
     }



More information about the vlma-devel mailing list