Updated tests

master
Omertron 14 years ago
parent 04be080e88
commit acf43320a8

@ -13,6 +13,7 @@
package com.moviejukebox.themoviedb.model; package com.moviejukebox.themoviedb.model;
import java.util.List; import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.codehaus.jackson.annotate.JsonAnySetter; import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonProperty;
@ -94,6 +95,9 @@ public class TmdbConfiguration {
* @return * @return
*/ */
public boolean isValidPosterSize(String posterSize) { public boolean isValidPosterSize(String posterSize) {
if (StringUtils.isBlank(posterSize)) {
return false;
}
return posterSizes.contains(posterSize); return posterSizes.contains(posterSize);
} }
@ -103,6 +107,9 @@ public class TmdbConfiguration {
* @return * @return
*/ */
public boolean isValidBackdropSize(String backdropSize) { public boolean isValidBackdropSize(String backdropSize) {
if (StringUtils.isBlank(backdropSize)) {
return false;
}
return backdropSizes.contains(backdropSize); return backdropSizes.contains(backdropSize);
} }
@ -112,6 +119,9 @@ public class TmdbConfiguration {
* @return * @return
*/ */
public boolean isValidProfileSize(String profileSize) { public boolean isValidProfileSize(String profileSize) {
if (StringUtils.isBlank(profileSize)) {
return false;
}
return profileSizes.contains(profileSize); return profileSizes.contains(profileSize);
} }

@ -61,7 +61,7 @@ public class TheMovieDbTest {
/** /**
* Test of getConfiguration method, of class TheMovieDb. * Test of getConfiguration method, of class TheMovieDb.
*/ */
//@Test @Test
public void testConfiguration() throws IOException { public void testConfiguration() throws IOException {
LOGGER.info("Test Configuration"); LOGGER.info("Test Configuration");
@ -77,7 +77,7 @@ public class TheMovieDbTest {
/** /**
* Test of searchMovie method, of class TheMovieDb. * Test of searchMovie method, of class TheMovieDb.
*/ */
//@Test @Test
public void testSearchMovie() throws UnsupportedEncodingException { public void testSearchMovie() throws UnsupportedEncodingException {
LOGGER.info("searchMovie"); LOGGER.info("searchMovie");
@ -97,7 +97,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieInfo method, of class TheMovieDb. * Test of getMovieInfo method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieInfo() { public void testGetMovieInfo() {
LOGGER.info("getMovieInfo"); LOGGER.info("getMovieInfo");
String language = "en"; String language = "en";
@ -108,7 +108,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieAlternativeTitles method, of class TheMovieDb. * Test of getMovieAlternativeTitles method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieAlternativeTitles() { public void testGetMovieAlternativeTitles() {
LOGGER.info("getMovieAlternativeTitles"); LOGGER.info("getMovieAlternativeTitles");
String country = ""; String country = "";
@ -124,7 +124,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieCasts method, of class TheMovieDb. * Test of getMovieCasts method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieCasts() { public void testGetMovieCasts() {
LOGGER.info("getMovieCasts"); LOGGER.info("getMovieCasts");
List<Person> people = tmdb.getMovieCasts(ID_BLADE_RUNNER); List<Person> people = tmdb.getMovieCasts(ID_BLADE_RUNNER);
@ -151,7 +151,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieImages method, of class TheMovieDb. * Test of getMovieImages method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieImages() { public void testGetMovieImages() {
LOGGER.info("getMovieImages"); LOGGER.info("getMovieImages");
String language = ""; String language = "";
@ -162,7 +162,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieKeywords method, of class TheMovieDb. * Test of getMovieKeywords method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieKeywords() { public void testGetMovieKeywords() {
LOGGER.info("getMovieKeywords"); LOGGER.info("getMovieKeywords");
List<Keyword> result = tmdb.getMovieKeywords(ID_BLADE_RUNNER); List<Keyword> result = tmdb.getMovieKeywords(ID_BLADE_RUNNER);
@ -172,7 +172,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieReleaseInfo method, of class TheMovieDb. * Test of getMovieReleaseInfo method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieReleaseInfo() { public void testGetMovieReleaseInfo() {
LOGGER.info("getMovieReleaseInfo"); LOGGER.info("getMovieReleaseInfo");
List<ReleaseInfo> result = tmdb.getMovieReleaseInfo(ID_BLADE_RUNNER, ""); List<ReleaseInfo> result = tmdb.getMovieReleaseInfo(ID_BLADE_RUNNER, "");
@ -182,7 +182,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieTrailers method, of class TheMovieDb. * Test of getMovieTrailers method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieTrailers() { public void testGetMovieTrailers() {
LOGGER.info("getMovieTrailers"); LOGGER.info("getMovieTrailers");
List<Trailer> result = tmdb.getMovieTrailers(ID_BLADE_RUNNER, ""); List<Trailer> result = tmdb.getMovieTrailers(ID_BLADE_RUNNER, "");
@ -192,7 +192,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieTranslations method, of class TheMovieDb. * Test of getMovieTranslations method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieTranslations() { public void testGetMovieTranslations() {
LOGGER.info("getMovieTranslations"); LOGGER.info("getMovieTranslations");
List<Translation> result = tmdb.getMovieTranslations(ID_BLADE_RUNNER); List<Translation> result = tmdb.getMovieTranslations(ID_BLADE_RUNNER);
@ -202,7 +202,7 @@ public class TheMovieDbTest {
/** /**
* Test of getCollectionInfo method, of class TheMovieDb. * Test of getCollectionInfo method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetCollectionInfo() { public void testGetCollectionInfo() {
LOGGER.info("getCollectionInfo"); LOGGER.info("getCollectionInfo");
String language = ""; String language = "";
@ -210,7 +210,7 @@ public class TheMovieDbTest {
assertFalse("No collection information", result.getParts().isEmpty()); assertFalse("No collection information", result.getParts().isEmpty());
} }
//@Test @Test
public void testCreateImageUrl() { public void testCreateImageUrl() {
LOGGER.info("createImageUrl"); LOGGER.info("createImageUrl");
MovieDb movie = tmdb.getMovieInfo(ID_BLADE_RUNNER, ""); MovieDb movie = tmdb.getMovieInfo(ID_BLADE_RUNNER, "");
@ -221,7 +221,7 @@ public class TheMovieDbTest {
/** /**
* Test of getMovieInfoImdb method, of class TheMovieDb. * Test of getMovieInfoImdb method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetMovieInfoImdb() { public void testGetMovieInfoImdb() {
LOGGER.info("getMovieInfoImdb"); LOGGER.info("getMovieInfoImdb");
MovieDb result = tmdb.getMovieInfoImdb("tt0076759", "en-US"); MovieDb result = tmdb.getMovieInfoImdb("tt0076759", "en-US");
@ -231,7 +231,7 @@ public class TheMovieDbTest {
/** /**
* Test of getApiKey method, of class TheMovieDb. * Test of getApiKey method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetApiKey() { public void testGetApiKey() {
// Not required // Not required
} }
@ -239,7 +239,7 @@ public class TheMovieDbTest {
/** /**
* Test of getApiBase method, of class TheMovieDb. * Test of getApiBase method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetApiBase() { public void testGetApiBase() {
// Not required // Not required
} }
@ -247,7 +247,7 @@ public class TheMovieDbTest {
/** /**
* Test of getConfiguration method, of class TheMovieDb. * Test of getConfiguration method, of class TheMovieDb.
*/ */
//@Test @Test
public void testGetConfiguration() { public void testGetConfiguration() {
// Not required // Not required
} }
@ -294,11 +294,6 @@ public class TheMovieDbTest {
List<Artwork> artwork = tmdb.getPersonImages(ID_BRUCE_WILLIS); List<Artwork> artwork = tmdb.getPersonImages(ID_BRUCE_WILLIS);
assertTrue("No cast information", artwork.size() > 0); assertTrue("No cast information", artwork.size() > 0);
for(Artwork a:artwork) {
LOGGER.info(" " + a.toString());
}
} }
} }

Loading…
Cancel
Save