]> www.vanbest.org Git - tv_grab_nl_java/commitdiff
Added test to check that RTL provides the RTL 4 channel
authorJan-Pascal van Best <janpascal@vanbest.org>
Thu, 3 May 2012 19:15:56 +0000 (21:15 +0200)
committerJan-Pascal van Best <janpascal@vanbest.org>
Thu, 10 May 2012 14:50:45 +0000 (16:50 +0200)
release.sh
src/test/java/org/vanbest/xmltv/RTLTest.java

index 8de82f929195879e2f57ac9d17b653ed228ff425..1625c435f6a8f32faf46cbda5e2566e7070ca0d4 100755 (executable)
@@ -17,6 +17,11 @@ mkdir "$DESTDIR"
 rm -f "$ZIPFILE"
 
 mvn compile
+mvn test
+if [ "$?" != 0 ]; then
+  echo "Test failed, aborting"
+  exit 1;
+fi
 mvn assembly:single
 cp target/tv_grab_nl_java-$VERSION-dep.jar "$DESTDIR/tv_grab_nl_java.jar"
 cp tv_grab_nl_java install.sh README LICENSE Changelog "$DESTDIR"
index ffac0e7570c36cb001f193cb7d91338ab2672ff3..02c3444b2d74ae0ab6103e342bc9c85b9e32357e 100644 (file)
@@ -2,6 +2,8 @@ package org.vanbest.xmltv;
 
 import static org.junit.Assert.*;
 
+import java.util.List;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -28,7 +30,20 @@ public class RTLTest {
 
        @Test
        public void testGetProgrammesListOfChannelInt() {
-               fail("Not yet implemented");
+               List<Channel> channels = rtl.getChannels();
+               
+               // there should be an "RTL 4" channel
+               boolean foundRTL4 = false;
+               for(Channel c: channels) {
+                       if(c.defaultName().equals("RTL 4")) {
+                               foundRTL4 = true;
+                               assertFalse("RTL 4 channel should have at least one icon", c.icons.isEmpty());
+                       }
+                       assertEquals("All channels should have RTL.nl source id", RTL_SOURCE_ID, c.source);
+               }
+               if(!foundRTL4) {
+                       fail("Channel RTL4 not found, should be there");
+               }
        }
 
 }