Examples of Dvd


Examples of br.com.caelum.vraptor.mydvds.model.Dvd

  private Session session;
  private DvdDao dao;

  @Test
  public void shouldFindADvdWithSimilarTitle() throws Exception {
    Dvd dvd = new Dvd();
    dvd.setTitle("The last cruzade");
    dao.add(dvd);

    assertThat(dao.searchSimilarTitle("last"), hasItem(dvd));
    assertThat(dao.searchSimilarTitle("first"), not(hasItem(dvd)));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.mydvds.model.Dvd

    controller = new DvdsController(dao, userInfo, result, validator);
  }

  @Test
  public void addingAValidDvd() throws Exception {
    Dvd dvd = new Dvd();
    dvd.setDescription("A random description");
    dvd.setTitle("Once upon a time");
    dvd.setType(DvdType.VIDEO);

    willAddTheDvd(dvd);

    controller.add(dvd, null);
View Full Code Here

Examples of br.com.caelum.vraptor.mydvds.model.Dvd

    controller.add(dvd, null);

  }
  @Test(expected=ValidationException.class)
  public void addingAnInvalidDvd() throws Exception {
    Dvd dvd = new Dvd();
    dvd.setDescription("short");
    dvd.setTitle("Once upon a time");
    dvd.setType(DvdType.VIDEO);

    willNotAddTheDvd(dvd);

    controller.add(dvd, null);
View Full Code Here

Examples of br.com.caelum.vraptor.mydvds.model.Dvd

    controller = new DvdRentalsController(dao, userDao, userInfo, result, validator);
  }

  @Test
  public void addingAValidDvd() throws Exception {
    Dvd dvd = new Dvd();
    dvd.setId(2l);

    willAddTheDvdRental(dvd);

    controller.addToMyList(userInfo.getUser(), dvd);
View Full Code Here

Examples of br.com.caelum.vraptor.mydvds.model.Dvd

    controller.addToMyList(userInfo.getUser(), dvd);

  }
  @Test(expected=ValidationException.class)
  public void addingAnDvdCopyWhenUserIsNotLoggedIn() throws Exception {
    Dvd dvd = new Dvd();
    dvd.setId(2l);

    willNotAddTheDvdRental(dvd);

    User user = new User();
    user.setLogin("abbb");
View Full Code Here

Examples of simon.entities.DVD

        String price = rs.getString("PRICE");
        String genre = rs.getString("GENRE");
        String description = rs.getString("DESCRIPTION");
        String imageLink = rs.getString("IMAGELINK");
        Integer quantity = rs.getInt("QUANTITY");
        results.add(new DVD(id, name, genre, price, description, imageLink, quantity));
    }
      }
  }
 
  //if at least one result is found, return the first item in the list, else return null
View Full Code Here

Examples of simon.entities.DVD

        String price = rs.getString("PRICE");
        String genre = rs.getString("GENRE");
        String description = rs.getString("DESCRIPTION");
        String imageLink = rs.getString("IMAGELINK");
        Integer quantity = rs.getInt("QUANTITY");
        results.add(new DVD(id, name, genre, price, description, imageLink, quantity));
    }
      }
  }
  return results; //return the results
    }
View Full Code Here

Examples of simon.entities.DVD

        String price = rs.getString("PRICE");
        String genre = rs.getString("GENRE");
        String description = rs.getString("DESCRIPTION");
        String imageLink = rs.getString("IMAGELINK");
        Integer quantity = rs.getInt("QUANTITY");
        results.add(new DVD(id, name, genre, price, description, imageLink, quantity));
    }
      }
  }
  return results; //return the results
    }
View Full Code Here

Examples of simon.entities.DVD

            HttpServletResponse response)
            throws IOException, ServletException {

        RequestDispatcher view = null;
        ArrayList<DVD> randomDvds = null;
        DVD dvd = null;

        try {
            dvd = fetchEjb.GetSingleDvd(dbUrl, dbUsername, dbPassword, filmId);
            randomDvds = fetchEjb.GetFiveRandomFilms(dbUrl, dbUsername, dbPassword, dvd.getGenre());
        } catch (Exception ex) {
            throw new ServletException(ex);
        }
        request.setAttribute("name", request.getParameter("name"));
        request.setAttribute("dvd", dvd);
View Full Code Here

Examples of simon.entities.DVD

   
    //execute the query and parse the results into a list of OrderLine objects
    //add the object to the list
                ResultSet rs = ps.executeQuery();
                while (rs.next()) {
                    DVD dvd = fetchEjb.GetSingleDvd(dbUrl, dbUsername, dbPassword, rs.getInt("itemId"));
                    Integer quantity = rs.getInt("quantity");
                    dvdList.add(new OrderLine(dvd, quantity));
                }
            }
            return dvdList; //return the results
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.