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