* update test cases

This commit is contained in:
Reinhard Pointner 2011-01-07 11:02:11 +00:00
parent aa9b407fee
commit a2493bc969
6 changed files with 16 additions and 12 deletions

View File

@ -159,6 +159,10 @@ public class SublightSubtitleClient implements SubtitleProvider, VideoHashSubtit
Collections.addAll(languages.getSubtitleLanguage(), SubtitleLanguage.values()); Collections.addAll(languages.getSubtitleLanguage(), SubtitleLanguage.values());
} }
// hash singleton array
ArrayOfString videoHashes = new ArrayOfString();
videoHashes.getString().add(videoHash);
// all genres // all genres
ArrayOfGenre genres = new ArrayOfGenre(); ArrayOfGenre genres = new ArrayOfGenre();
Collections.addAll(genres.getGenre(), Genre.values()); Collections.addAll(genres.getGenre(), Genre.values());
@ -168,7 +172,7 @@ public class SublightSubtitleClient implements SubtitleProvider, VideoHashSubtit
Holder<ArrayOfRelease> releases = new Holder<ArrayOfRelease>(); Holder<ArrayOfRelease> releases = new Holder<ArrayOfRelease>();
Holder<String> error = new Holder<String>(); Holder<String> error = new Holder<String>();
webservice.searchSubtitles3(session, videoHash, name, year, null, null, languages, genres, null, null, null, subtitles, releases, null, error); webservice.searchSubtitles4(session, videoHashes, name, year, null, null, languages, genres, null, null, null, subtitles, releases, null, error);
// abort if something went wrong // abort if something went wrong
checkError(error); checkError(error);

View File

@ -33,12 +33,12 @@ public class SubRipReaderTest {
reader.close(); reader.close();
} }
assertEquals(501, list.size(), 0); assertEquals(499, list.size(), 0);
assertEquals(3455, list.get(0).getStart(), 0); assertEquals(3455, list.get(0).getStart(), 0);
assertEquals(6799, list.get(0).getEnd(), 0); assertEquals(6799, list.get(0).getEnd(), 0);
assertEquals("Come with me if you want to live.", list.get(254).getText()); assertEquals("Come with me if you want to live.", list.get(253).getText());
} }
} }

View File

@ -94,7 +94,7 @@ public class IMDbClientTest {
Episode first = list.get(0); Episode first = list.get(0);
assertEquals("Mushishi", first.getSeriesName()); assertEquals("Mushi-Shi", first.getSeriesName());
assertEquals("Midori no za", first.getTitle()); assertEquals("Midori no za", first.getTitle());
assertEquals("1", first.getEpisode().toString()); assertEquals("1", first.getEpisode().toString());
assertEquals("1", first.getSeason().toString()); assertEquals("1", first.getSeason().toString());

View File

@ -182,7 +182,7 @@ public class OpenSubtitlesXmlRpcTest {
ByteBuffer data = list.get(0).fetch(); ByteBuffer data = list.get(0).fetch();
// check size // check size
assertEquals(48707, data.remaining(), 0); assertEquals(48550, data.remaining(), 0);
} }

View File

@ -64,8 +64,8 @@ public class SublightSubtitleClientTest {
SubtitleDescriptor sample = list.get(0); SubtitleDescriptor sample = list.get(0);
assertEquals("Terminator.2.Judgment.Day(1991)", sample.getName()); assertEquals("Terminator.2.1991.ULTIMATE.EDITION.DC.DVDXvID.AC3.CDx-HLS", sample.getName());
assertEquals("English", sample.getLanguageName()); assertEquals("Slovenian", sample.getLanguageName());
// check size // check size
assertTrue(list.size() > 15); assertTrue(list.size() > 15);

View File

@ -17,12 +17,12 @@ public class TMDbClientTest {
@Test @Test
public void searchByName() throws Exception { public void searchByName() throws Exception {
List<MovieDescriptor> result = tmdb.searchMovie("Transformers"); List<MovieDescriptor> result = tmdb.searchMovie("Serenity");
MovieDescriptor movie = result.get(1); MovieDescriptor movie = result.get(0);
assertEquals("Transformers", movie.getName()); assertEquals("Serenity", movie.getName());
assertEquals(2007, movie.getYear()); assertEquals(2005, movie.getYear());
assertEquals(418279, movie.getImdbId()); assertEquals(379786, movie.getImdbId());
} }