Package services.entities

Examples of services.entities.HotelBooking


     */
    @Test
    public void testBooking() throws Exception
    {
      Long referenceNumber = hbm.book("john", "doe", "21-09-1987", "single", "28-12-2012", "30-12-2012");
        HotelBooking booking = hbm.getBookingByReference(referenceNumber);
        Assert.assertTrue("Expected first name to be 'john', but it wasn't", booking.getCustomer().getFirstName().equals("john"));
        Assert.assertTrue("Expected last name to be 'doe', but it wasn't", booking.getCustomer().getLastName().equals("doe"));
        Assert.assertTrue("Expected date of birth to be '21-09-1987', but it wasn't", booking.getCustomer().getDateOfBirth().equals("21-09-1987"));
        Assert.assertTrue("Expected room type to be 'single', but it wasn't", booking.getRoom().getRoomType().equals("single"));
        Assert.assertTrue("Expected check-in date to be '28-12-2012', but it wasn't", booking.getCheckInDate().equals("28-12-2012"));
        Assert.assertTrue("Expected check-out date to be '30-12-2012', but it wasn't", booking.getCheckOutDate().equals("30-12-2012"));
    }
View Full Code Here


      referenceNumber = System.currentTimeMillis();
     
      HotelCustomer customer = cmb.createCustomer(firstName, lastName, dateOfBirth);
      em.persist(customer);
       
      HotelBooking booking = new HotelBooking(customer, room, referenceNumber, checkInDate, checkOutDate);
       em.persist(booking);
    }
   
    /* Crash scenario 1. Triggers if firstName = Crash and lastName = Now */
    if(firstName.equals("Crash") && lastName.equals("Now"))
View Full Code Here

   */
  @Override
  public boolean cancel(Long referenceNumber)
  {
   
    HotelBooking booking = getBookingByReference(referenceNumber);
    if(booking == null) return false;
   
    em.remove(booking);
    return true;
  }
View Full Code Here

TOP

Related Classes of services.entities.HotelBooking

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.