Пример #1
0
 public Movie getMovieByName(String name) {
   Movie movie = null;
   ResultSet rs;
   String mySelect = "select * from " + table + " where title=\"" + name + "\"";
   try {
     if (cargaControlador() > -1) {
       if (open("jdbc:mysql://" + host + ":" + port + "/" + database, user, pass) > -1) {
         if (select(mySelect) > -1) {
           rs = getRs();
           rs.next();
           movie = new Movie();
           movie.id = (Integer) rs.getObject(Movie.COL_ID + 1);
           movie.title = (String) rs.getObject(Movie.COL_TITLE + 1);
           if (rs.getObject(Movie.COL_YEAR + 1) != null)
             movie.year = rs.getObject(Movie.COL_YEAR + 1).toString();
           movie.loc = (String) rs.getObject(Movie.COL_LOC + 1);
           movie.director = (String) rs.getObject(Movie.COL_DIR + 1);
           movie.other = (String) rs.getObject(Movie.COL_OTHER + 1);
         } else {
           Errors.writeError(Errors.DB_SELECT, mySelect + "\n");
         }
         close();
       }
     }
   } catch (Exception ex) {
     Errors.showError(Errors.DB_SELECT);
     Errors.writeError(Errors.DB_SELECT, mySelect + "\n");
   }
   return movie;
 }
  @Override
  @Test
  public void checkAnExtendedWidget() {
    assertTrue(rottenTomatoes.getExtendeddMovieCount() >= 1);
    Movie movie = rottenTomatoes.getAnExtendedMovie(0);
    assertTrue(!StringUtils.isBlank(movie.title()));
    assertTrue(!StringUtils.isBlank(movie.score()));
    assertNotNull(movie.getPoster());
    movie.goToReview();

    rottenTomatoes.checkExtendedReview();
  }
  @Test
  @Override
  public void checkACommonWidget() {
    assertTrue(rottenTomatoes.getSimpleMovieCount() >= 1);
    Movie movie = rottenTomatoes.getASimpleMovie(0);
    assertTrue(!StringUtils.isBlank(movie.title()));
    assertTrue(!StringUtils.isBlank(movie.score()));
    assertNotNull(movie.getPoster());
    movie.goToReview();

    rottenTomatoes.checkSimpleReview();
  }