Updated test cases

master
Omertron 13 years ago
parent 7034be4681
commit 55b9760c34

@ -94,7 +94,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getConfiguration method, of class TheMovieDbApi. * Test of getConfiguration method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testConfiguration() throws IOException { public void testConfiguration() throws IOException {
logger.info("Test Configuration"); logger.info("Test Configuration");
@ -110,7 +110,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of searchMovie method, of class TheMovieDbApi. * Test of searchMovie method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSearchMovie() throws MovieDbException { public void testSearchMovie() throws MovieDbException {
logger.info("searchMovie"); logger.info("searchMovie");
@ -131,7 +131,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieInfo method, of class TheMovieDbApi. * Test of getMovieInfo method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieInfo() throws MovieDbException { public void testGetMovieInfo() throws MovieDbException {
logger.info("getMovieInfo"); logger.info("getMovieInfo");
String language = "en"; String language = "en";
@ -142,7 +142,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieAlternativeTitles method, of class TheMovieDbApi. * Test of getMovieAlternativeTitles method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieAlternativeTitles() throws MovieDbException { public void testGetMovieAlternativeTitles() throws MovieDbException {
logger.info("getMovieAlternativeTitles"); logger.info("getMovieAlternativeTitles");
String country = ""; String country = "";
@ -158,7 +158,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieCasts method, of class TheMovieDbApi. * Test of getMovieCasts method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieCasts() throws MovieDbException { public void testGetMovieCasts() throws MovieDbException {
logger.info("getMovieCasts"); logger.info("getMovieCasts");
List<Person> people = tmdb.getMovieCasts(ID_MOVIE_BLADE_RUNNER); List<Person> people = tmdb.getMovieCasts(ID_MOVIE_BLADE_RUNNER);
@ -185,7 +185,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieImages method, of class TheMovieDbApi. * Test of getMovieImages method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieImages() throws MovieDbException { public void testGetMovieImages() throws MovieDbException {
logger.info("getMovieImages"); logger.info("getMovieImages");
String language = ""; String language = "";
@ -196,7 +196,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieKeywords method, of class TheMovieDbApi. * Test of getMovieKeywords method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieKeywords() throws MovieDbException { public void testGetMovieKeywords() throws MovieDbException {
logger.info("getMovieKeywords"); logger.info("getMovieKeywords");
List<Keyword> result = tmdb.getMovieKeywords(ID_MOVIE_BLADE_RUNNER); List<Keyword> result = tmdb.getMovieKeywords(ID_MOVIE_BLADE_RUNNER);
@ -206,7 +206,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieReleaseInfo method, of class TheMovieDbApi. * Test of getMovieReleaseInfo method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieReleaseInfo() throws MovieDbException { public void testGetMovieReleaseInfo() throws MovieDbException {
logger.info("getMovieReleaseInfo"); logger.info("getMovieReleaseInfo");
List<ReleaseInfo> result = tmdb.getMovieReleaseInfo(ID_MOVIE_BLADE_RUNNER, ""); List<ReleaseInfo> result = tmdb.getMovieReleaseInfo(ID_MOVIE_BLADE_RUNNER, "");
@ -216,7 +216,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieTrailers method, of class TheMovieDbApi. * Test of getMovieTrailers method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieTrailers() throws MovieDbException { public void testGetMovieTrailers() throws MovieDbException {
logger.info("getMovieTrailers"); logger.info("getMovieTrailers");
List<Trailer> result = tmdb.getMovieTrailers(ID_MOVIE_BLADE_RUNNER, ""); List<Trailer> result = tmdb.getMovieTrailers(ID_MOVIE_BLADE_RUNNER, "");
@ -226,7 +226,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieTranslations method, of class TheMovieDbApi. * Test of getMovieTranslations method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieTranslations() throws MovieDbException { public void testGetMovieTranslations() throws MovieDbException {
logger.info("getMovieTranslations"); logger.info("getMovieTranslations");
List<Translation> result = tmdb.getMovieTranslations(ID_MOVIE_BLADE_RUNNER); List<Translation> result = tmdb.getMovieTranslations(ID_MOVIE_BLADE_RUNNER);
@ -236,7 +236,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getCollectionInfo method, of class TheMovieDbApi. * Test of getCollectionInfo method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetCollectionInfo() throws MovieDbException { public void testGetCollectionInfo() throws MovieDbException {
logger.info("getCollectionInfo"); logger.info("getCollectionInfo");
String language = ""; String language = "";
@ -249,7 +249,7 @@ public class TheMovieDbApiTest {
* *
* @throws MovieDbException * @throws MovieDbException
*/ */
//@Test @Test
public void testCreateImageUrl() throws MovieDbException { public void testCreateImageUrl() throws MovieDbException {
logger.info("createImageUrl"); logger.info("createImageUrl");
MovieDb movie = tmdb.getMovieInfo(ID_MOVIE_BLADE_RUNNER, ""); MovieDb movie = tmdb.getMovieInfo(ID_MOVIE_BLADE_RUNNER, "");
@ -260,7 +260,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getMovieInfoImdb method, of class TheMovieDbApi. * Test of getMovieInfoImdb method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetMovieInfoImdb() throws MovieDbException { public void testGetMovieInfoImdb() throws MovieDbException {
logger.info("getMovieInfoImdb"); logger.info("getMovieInfoImdb");
MovieDb result = tmdb.getMovieInfoImdb("tt0076759", "en-US"); MovieDb result = tmdb.getMovieInfoImdb("tt0076759", "en-US");
@ -270,7 +270,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getApiKey method, of class TheMovieDbApi. * Test of getApiKey method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetApiKey() { public void testGetApiKey() {
// Not required // Not required
} }
@ -278,7 +278,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getApiBase method, of class TheMovieDbApi. * Test of getApiBase method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetApiBase() { public void testGetApiBase() {
// Not required // Not required
} }
@ -286,7 +286,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getConfiguration method, of class TheMovieDbApi. * Test of getConfiguration method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetConfiguration() { public void testGetConfiguration() {
// Not required // Not required
} }
@ -294,7 +294,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of searchPeople method, of class TheMovieDbApi. * Test of searchPeople method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSearchPeople() throws MovieDbException { public void testSearchPeople() throws MovieDbException {
logger.info("searchPeople"); logger.info("searchPeople");
String personName = "Bruce Willis"; String personName = "Bruce Willis";
@ -306,7 +306,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getPersonInfo method, of class TheMovieDbApi. * Test of getPersonInfo method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetPersonInfo() throws MovieDbException { public void testGetPersonInfo() throws MovieDbException {
logger.info("getPersonInfo"); logger.info("getPersonInfo");
Person result = tmdb.getPersonInfo(ID_PERSON_BRUCE_WILLIS); Person result = tmdb.getPersonInfo(ID_PERSON_BRUCE_WILLIS);
@ -316,7 +316,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getPersonCredits method, of class TheMovieDbApi. * Test of getPersonCredits method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetPersonCredits() throws MovieDbException { public void testGetPersonCredits() throws MovieDbException {
logger.info("getPersonCredits"); logger.info("getPersonCredits");
@ -327,7 +327,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getPersonImages method, of class TheMovieDbApi. * Test of getPersonImages method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetPersonImages() throws MovieDbException { public void testGetPersonImages() throws MovieDbException {
logger.info("getPersonImages"); logger.info("getPersonImages");
@ -338,7 +338,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getLatestMovie method, of class TheMovieDbApi. * Test of getLatestMovie method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetLatestMovie() throws MovieDbException { public void testGetLatestMovie() throws MovieDbException {
logger.info("getLatestMovie"); logger.info("getLatestMovie");
MovieDb result = tmdb.getLatestMovie(); MovieDb result = tmdb.getLatestMovie();
@ -349,7 +349,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of compareMovies method, of class TheMovieDbApi. * Test of compareMovies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testCompareMovies() { public void testCompareMovies() {
// Not required // Not required
} }
@ -357,7 +357,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of setProxy method, of class TheMovieDbApi. * Test of setProxy method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSetProxy() { public void testSetProxy() {
// Not required // Not required
} }
@ -365,7 +365,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of setTimeout method, of class TheMovieDbApi. * Test of setTimeout method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSetTimeout() { public void testSetTimeout() {
// Not required // Not required
} }
@ -373,7 +373,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getNowPlayingMovies method, of class TheMovieDbApi. * Test of getNowPlayingMovies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetNowPlayingMovies() throws MovieDbException { public void testGetNowPlayingMovies() throws MovieDbException {
logger.info("getNowPlayingMovies"); logger.info("getNowPlayingMovies");
List<MovieDb> results = tmdb.getNowPlayingMovies("", 0); List<MovieDb> results = tmdb.getNowPlayingMovies("", 0);
@ -383,7 +383,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getPopularMovieList method, of class TheMovieDbApi. * Test of getPopularMovieList method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetPopularMovieList() throws MovieDbException { public void testGetPopularMovieList() throws MovieDbException {
logger.info("getPopularMovieList"); logger.info("getPopularMovieList");
List<MovieDb> results = tmdb.getPopularMovieList("", 0); List<MovieDb> results = tmdb.getPopularMovieList("", 0);
@ -393,7 +393,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getTopRatedMovies method, of class TheMovieDbApi. * Test of getTopRatedMovies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetTopRatedMovies() throws MovieDbException { public void testGetTopRatedMovies() throws MovieDbException {
logger.info("getTopRatedMovies"); logger.info("getTopRatedMovies");
List<MovieDb> results = tmdb.getTopRatedMovies("", 0); List<MovieDb> results = tmdb.getTopRatedMovies("", 0);
@ -403,7 +403,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getCompanyInfo method, of class TheMovieDbApi. * Test of getCompanyInfo method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetCompanyInfo() throws MovieDbException { public void testGetCompanyInfo() throws MovieDbException {
logger.info("getCompanyInfo"); logger.info("getCompanyInfo");
Company company = tmdb.getCompanyInfo(ID_COMPANY_LUCASFILM); Company company = tmdb.getCompanyInfo(ID_COMPANY_LUCASFILM);
@ -413,7 +413,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getCompanyMovies method, of class TheMovieDbApi. * Test of getCompanyMovies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetCompanyMovies() throws MovieDbException { public void testGetCompanyMovies() throws MovieDbException {
logger.info("getCompanyMovies"); logger.info("getCompanyMovies");
List<MovieDb> results = tmdb.getCompanyMovies(ID_COMPANY_LUCASFILM, "", 0); List<MovieDb> results = tmdb.getCompanyMovies(ID_COMPANY_LUCASFILM, "", 0);
@ -423,7 +423,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of searchCompanies method, of class TheMovieDbApi. * Test of searchCompanies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSearchCompanies() throws MovieDbException { public void testSearchCompanies() throws MovieDbException {
logger.info("searchCompanies"); logger.info("searchCompanies");
List<Company> results = tmdb.searchCompanies(COMPANY_NAME, 0); List<Company> results = tmdb.searchCompanies(COMPANY_NAME, 0);
@ -433,7 +433,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getSimilarMovies method, of class TheMovieDbApi. * Test of getSimilarMovies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetSimilarMovies() throws MovieDbException { public void testGetSimilarMovies() throws MovieDbException {
logger.info("getSimilarMovies"); logger.info("getSimilarMovies");
List<MovieDb> results = tmdb.getSimilarMovies(ID_MOVIE_BLADE_RUNNER, "", 0); List<MovieDb> results = tmdb.getSimilarMovies(ID_MOVIE_BLADE_RUNNER, "", 0);
@ -443,7 +443,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getGenreList method, of class TheMovieDbApi. * Test of getGenreList method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetGenreList() throws MovieDbException { public void testGetGenreList() throws MovieDbException {
logger.info("getGenreList"); logger.info("getGenreList");
List<Genre> results = tmdb.getGenreList(""); List<Genre> results = tmdb.getGenreList("");
@ -453,7 +453,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getGenreMovies method, of class TheMovieDbApi. * Test of getGenreMovies method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetGenreMovies() throws MovieDbException { public void testGetGenreMovies() throws MovieDbException {
logger.info("getGenreMovies"); logger.info("getGenreMovies");
List<MovieDb> results = tmdb.getGenreMovies(ID_GENRE_ACTION, "", 0); List<MovieDb> results = tmdb.getGenreMovies(ID_GENRE_ACTION, "", 0);
@ -463,7 +463,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getUpcoming method, of class TheMovieDbApi. * Test of getUpcoming method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetUpcoming() throws Exception { public void testGetUpcoming() throws Exception {
logger.info("getUpcoming"); logger.info("getUpcoming");
List<MovieDb> results = tmdb.getUpcoming("", 0); List<MovieDb> results = tmdb.getUpcoming("", 0);
@ -473,7 +473,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getCollectionImages method, of class TheMovieDbApi. * Test of getCollectionImages method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetCollectionImages() throws Exception { public void testGetCollectionImages() throws Exception {
logger.info("getCollectionImages"); logger.info("getCollectionImages");
String language = ""; String language = "";
@ -484,7 +484,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getAuthorisationToken method, of class TheMovieDbApi. * Test of getAuthorisationToken method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetAuthorisationToken() throws Exception { public void testGetAuthorisationToken() throws Exception {
logger.info("getAuthorisationToken"); logger.info("getAuthorisationToken");
TokenAuthorisation result = tmdb.getAuthorisationToken(); TokenAuthorisation result = tmdb.getAuthorisationToken();
@ -497,7 +497,6 @@ public class TheMovieDbApiTest {
* Test of getSessionToken method, of class TheMovieDbApi. * Test of getSessionToken method, of class TheMovieDbApi.
*/ */
// Cannot be tested without a HTTP authorisation: http://help.themoviedb.org/kb/api/user-authentication // Cannot be tested without a HTTP authorisation: http://help.themoviedb.org/kb/api/user-authentication
// //@Test
public void testGetSessionToken() throws Exception { public void testGetSessionToken() throws Exception {
logger.info("getSessionToken"); logger.info("getSessionToken");
TokenAuthorisation token = tmdb.getAuthorisationToken(); TokenAuthorisation token = tmdb.getAuthorisationToken();
@ -514,7 +513,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of getGuestSessionToken method, of class TheMovieDbApi. * Test of getGuestSessionToken method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testGetGuestSessionToken() throws Exception { public void testGetGuestSessionToken() throws Exception {
logger.info("getGuestSessionToken"); logger.info("getGuestSessionToken");
TokenSession result = tmdb.getGuestSessionToken(); TokenSession result = tmdb.getGuestSessionToken();
@ -522,7 +521,7 @@ public class TheMovieDbApiTest {
assertTrue("Failed to get guest session", result.getSuccess()); assertTrue("Failed to get guest session", result.getSuccess());
} }
//@Test @Test
public void testGetMovieLists() throws Exception { public void testGetMovieLists() throws Exception {
logger.info("getMovieLists"); logger.info("getMovieLists");
String language = "en"; String language = "en";
@ -550,7 +549,7 @@ public class TheMovieDbApiTest {
assertTrue("No results found", results.size() > 0); assertTrue("No results found", results.size() > 0);
} }
//@Test @Test
public void testGetPersonLatest() throws Exception { public void testGetPersonLatest() throws Exception {
logger.info("getPersonLatest"); logger.info("getPersonLatest");
@ -563,7 +562,7 @@ public class TheMovieDbApiTest {
/** /**
* Test of searchCollection method, of class TheMovieDbApi. * Test of searchCollection method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSearchCollection() throws Exception { public void testSearchCollection() throws Exception {
logger.info("searchCollection"); logger.info("searchCollection");
String query = "batman"; String query = "batman";
@ -577,9 +576,9 @@ public class TheMovieDbApiTest {
/** /**
* Test of searchList method, of class TheMovieDbApi. * Test of searchList method, of class TheMovieDbApi.
*/ */
//@Test @Test
public void testSearchList() throws Exception { public void testSearchList() throws Exception {
System.out.println("searchList"); logger.info("searchList");
String query = "watch"; String query = "watch";
String language = ""; String language = "";
int page = 0; int page = 0;
@ -592,11 +591,12 @@ public class TheMovieDbApiTest {
* Test of searchKeyword method, of class TheMovieDbApi. * Test of searchKeyword method, of class TheMovieDbApi.
*/ */
@Test @Test
public void testSearchKeyword() { public void testSearchKeyword() throws Exception {
System.out.println("searchKeyword"); logger.info("searchKeyword");
TheMovieDbApi instance = null; String query = "action";
instance.searchKeyword(); int page = 0;
// TODO review the generated test code and remove the default call to fail. List<Keyword> result = tmdb.searchKeyword(query, page);
fail("The test case is a prototype."); assertFalse("No keywords found", result == null);
assertTrue("No keywords found", result.size() > 0);
} }
} }

Loading…
Cancel
Save