Package services.entities

Examples of services.entities.HotelRoom


     * @throws Exception
     */
    @Test
    public void testRoom() throws Exception
    {
      HotelRoom room = hrm.createRoom("large", 2);
        Assert.assertTrue("Expected room type to be 'large', but it wasn't", room.getRoomType().equals("large"));
        Assert.assertTrue("Expected available rooms to be 2, but it wasn't", room.getAvailableRooms() == 2);
    }
View Full Code Here


   * @see services.beans.HotelRoomManager#createRoom(java.lang.String, int)
   */
  @Override
  public HotelRoom createRoom(String roomType, int availableRooms)
  {
    HotelRoom r = new HotelRoom(roomType, availableRooms);
    em.persist(r);
    return r;
  }
View Full Code Here

   */
  @Override
  public Long book(String firstName, String lastName, String dateOfBirth, String roomType, String checkInDate, String checkOutDate)
  {
    Long referenceNumber = null;
    HotelRoom room = validateParams(roomType, checkInDate, checkOutDate, firstName, lastName, dateOfBirth);
   
    if(room != null && checkAvailability(room, checkInDate, checkOutDate))
    {
      referenceNumber = System.currentTimeMillis();
     
View Full Code Here

      || lastName.trim().equals(""))
      return null;
   
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
    String today = sdf.format(new Date());
    HotelRoom room = getRoomByType(roomType);
   
    return (room != null
        && isDateAfter(today, checkOutDate) && isDateAfter(today, checkInDate)
        && isDateAfter(dateOfBirth, today) && isDateAfter(checkOutDate, checkInDate))
        ? room
View Full Code Here

TOP

Related Classes of services.entities.HotelRoom

Copyright © 2018 www.massapicom. 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.