From: Jan-Pascal van Best Date: Thu, 3 May 2012 19:15:56 +0000 (+0200) Subject: Added test to check that RTL provides the RTL 4 channel X-Git-Tag: 1.1.0~18 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=94dcc349d81ed9dbf9132f4c15bf9f0764ffbfc4;p=tv_grab_nl_java Added test to check that RTL provides the RTL 4 channel --- diff --git a/release.sh b/release.sh index 8de82f9..1625c43 100755 --- a/release.sh +++ b/release.sh @@ -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" diff --git a/src/test/java/org/vanbest/xmltv/RTLTest.java b/src/test/java/org/vanbest/xmltv/RTLTest.java index ffac0e7..02c3444 100644 --- a/src/test/java/org/vanbest/xmltv/RTLTest.java +++ b/src/test/java/org/vanbest/xmltv/RTLTest.java @@ -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 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"); + } } }