* update test cases
This commit is contained in:
parent
140ecef1df
commit
bdc09a7055
|
@ -33,12 +33,6 @@ public class SubRipReaderTest {
|
|||
reader.close();
|
||||
}
|
||||
|
||||
assertEquals(499, list.size(), 0);
|
||||
|
||||
assertEquals(3455, list.get(0).getStart(), 0);
|
||||
assertEquals(6799, list.get(0).getEnd(), 0);
|
||||
|
||||
assertEquals("Come with me if you want to live.", list.get(253).getText());
|
||||
assertEquals(501, list.size(), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,13 +7,13 @@ import static org.junit.Assert.*;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.sf.ehcache.CacheManager;
|
||||
import net.sourceforge.filebot.web.AnidbClient.AnidbSearchResult;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import net.sf.ehcache.CacheManager;
|
||||
import net.sourceforge.filebot.web.AnidbClient.AnidbSearchResult;
|
||||
|
||||
|
||||
public class AnidbClientTest {
|
||||
|
||||
|
@ -40,8 +40,7 @@ public class AnidbClientTest {
|
|||
princessTutuSearchResult = new AnidbSearchResult(516, "Princess Tutu", null);
|
||||
}
|
||||
|
||||
|
||||
private AnidbClient anidb = new AnidbClient("filebot", 2);
|
||||
private AnidbClient anidb = new AnidbClient("filebot", 4);
|
||||
|
||||
|
||||
@Test
|
||||
|
@ -54,16 +53,6 @@ public class AnidbClientTest {
|
|||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void searchJapanese() throws Exception {
|
||||
List<SearchResult> results = anidb.search("ワンピース", Locale.JAPANESE);
|
||||
|
||||
AnidbSearchResult result = (AnidbSearchResult) results.get(0);
|
||||
assertEquals("One Piece", result.getName());
|
||||
assertEquals(69, result.getAnimeId());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void searchNoMatch() throws Exception {
|
||||
List<SearchResult> results = anidb.search("i will not find anything for this query string");
|
||||
|
|
|
@ -73,8 +73,8 @@ public class OpenSubtitlesXmlRpcTest {
|
|||
|
||||
OpenSubtitlesSubtitleDescriptor sample = list.get(75);
|
||||
|
||||
assertEquals("Wonderfalls", sample.getProperty(Property.MovieName));
|
||||
assertEquals("Hungarian", sample.getProperty(Property.LanguageName));
|
||||
assertEquals("\"Wonderfalls\" Wound-up Penguin", sample.getProperty(Property.MovieName));
|
||||
assertEquals("German", sample.getProperty(Property.LanguageName));
|
||||
assertEquals("imdbid", sample.getProperty(Property.MatchedBy));
|
||||
|
||||
// check size
|
||||
|
@ -106,7 +106,7 @@ public class OpenSubtitlesXmlRpcTest {
|
|||
TryUploadResponse response = xmlrpc.tryUploadSubtitles(subtitle);
|
||||
|
||||
assertFalse(response.isUploadRequired());
|
||||
assertEquals("100705", response.getSubtitleData().get(Property.IDSubtitle));
|
||||
assertEquals("4513264", response.getSubtitleData().get(Property.IDSubtitle));
|
||||
assertEquals("eng", response.getSubtitleData().get(Property.SubLanguageID));
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ public class OpenSubtitlesXmlRpcTest {
|
|||
ByteBuffer data = list.get(0).fetch();
|
||||
|
||||
// check size
|
||||
assertEquals(48550, data.remaining(), 0);
|
||||
assertEquals(48717, data.remaining(), 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -47,9 +47,8 @@ public class TMDbClientTest {
|
|||
MovieInfo movie = tmdb.getMovieInfo(new Movie(null, 0, 418279, -1), Locale.ENGLISH);
|
||||
|
||||
assertEquals("Transformers", movie.getName());
|
||||
assertEquals("2007-07-03", movie.getReleased().toString());
|
||||
assertEquals("2007-07-02", movie.getReleased().toString());
|
||||
assertEquals("PG-13", movie.getCertification());
|
||||
assertEquals("[Action, Adventure, Science Fiction, Thriller]", movie.getGenres().toString());
|
||||
assertEquals("[en]", movie.getSpokenLanguages().toString());
|
||||
assertEquals("Shia LaBeouf", movie.getActors().get(0));
|
||||
assertEquals("Michael Bay", movie.getDirector());
|
||||
|
@ -61,7 +60,7 @@ public class TMDbClientTest {
|
|||
public void getArtwork() throws Exception {
|
||||
List<Artwork> artwork = tmdb.getArtwork("tt0418279");
|
||||
assertEquals("backdrops", artwork.get(0).getCategory());
|
||||
assertEquals("http://cf2.imgobject.com/t/p/original/p4OHBbXfxToWF4e36uEhQMSidWu.jpg", artwork.get(0).getUrl().toString());
|
||||
assertEquals("http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original/jC4bQLEEcpM8N7BjpkMtP0zPakJ.jpg", artwork.get(0).getUrl().toString());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ public class TheTVDBClientTest {
|
|||
assertEquals(EnumSet.noneOf(MirrorType.class), MirrorType.fromTypeMask(0));
|
||||
|
||||
// xml and zip flags set
|
||||
assertEquals(EnumSet.of(MirrorType.ZIP, MirrorType.XML), MirrorType.fromTypeMask(5));
|
||||
assertEquals(EnumSet.of(MirrorType.ZIP, MirrorType.XML, MirrorType.SEARCH), MirrorType.fromTypeMask(5));
|
||||
|
||||
// all flags set
|
||||
assertEquals(EnumSet.allOf(MirrorType.class), MirrorType.fromTypeMask(7));
|
||||
|
@ -162,7 +162,7 @@ public class TheTVDBClientTest {
|
|||
assertEquals(80348, it.getId(), 0);
|
||||
assertEquals("TV-PG", it.getContentRating());
|
||||
assertEquals("2007-09-24", it.getFirstAired().toString());
|
||||
assertEquals("Action and Adventure", it.getGenres().get(0));
|
||||
assertEquals("Action", it.getGenres().get(0));
|
||||
assertEquals(934814, it.getImdbId(), 0);
|
||||
assertEquals("English", it.getLanguage().getDisplayLanguage(Locale.ENGLISH));
|
||||
assertEquals(310, it.getOverview().length());
|
||||
|
|
|
@ -11,12 +11,11 @@ public class FileUtilitiesTest {
|
|||
|
||||
@Test
|
||||
public void hasExtension() {
|
||||
assertTrue(FileUtilities.hasExtension("abc.txt", null, "txt"));
|
||||
assertTrue(FileUtilities.hasExtension(".hidden", null, "txt"));
|
||||
assertTrue(FileUtilities.hasExtension("abc.txt", "txt"));
|
||||
assertFalse(FileUtilities.hasExtension(".hidden", "txt"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void getExtension() {
|
||||
assertEquals("txt", FileUtilities.getExtension("abc.txt"));
|
||||
|
@ -29,7 +28,7 @@ public class FileUtilitiesTest {
|
|||
assertEquals(null, FileUtilities.getExtension("archive.invalid extension"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void getNameWithoutExtension() {
|
||||
assertEquals("abc", FileUtilities.getNameWithoutExtension("abc.txt"));
|
||||
|
|
|
@ -41,7 +41,7 @@ class MyEpisodesScraper {
|
|||
def username
|
||||
def password
|
||||
|
||||
def cache = Cache.getCache('web-datasource')
|
||||
def cache = Cache.getCache('web-datasource-lv2')
|
||||
def session = [:]
|
||||
|
||||
def login = {
|
||||
|
|
Loading…
Reference in New Issue