Package it.hotel.model.hotel

Examples of it.hotel.model.hotel.Hotel


   
    replay(localeContainer);
    replay(labelManager);
   
   
    Hotel hotel = new Hotel();
    hotel.setBriefdescription("Questo è un bedlkfj");
   
    try {
      expect(invoke.getArguments()).andReturn(new Object[] {(Object)hotel});
      expect(invoke.proceed()).andReturn(null);
      replay(invoke);
View Full Code Here


  public void onSetUpInTransaction() throws Exception {
   
  }
 
  private Hotel addHotel(String locale) {
    Hotel hotel = new Hotel();
    hotel.setLocale(locale);
    localeContainer.setLocale(locale);
    hotel.setAddress("adrres");
    hotel.setBankaccount("343343");
    hotel.setBriefdescription("this is something else");
    hotel.setCap("08098");
    hotel.setCity("caglaira");
    hotel.setCodicefiscale("232323");
    hotel.setDescription("Questo è un descrizione in italiano");
    hotel.setFax("334344");
    hotel.setName("3erekjkle");
    hotel.setStar(5);
    hotel.setLatitude(54.4545);
    hotel.setLongitude(54.4545);
   
    localizedHotelManager.add(hotel);
   
   
    return hotel;
View Full Code Here

    return hotel;
  }
 

  public void testFacility() throws Exception {
    Hotel hotel = addHotel("it");
    Facility facility = new Facility();
    facility.setCode("Swimming Pool");
    hotel.addFacility(facility);
    facility.addStructure(hotel);
    localizedHotelManager.add(hotel);
    Hotel sameHotel = (Hotel) localizedHotelManager.get(hotel.getId());
    assertEquals(1, sameHotel.getFacilities().size());
    Facility sameFacility = (Facility) sameHotel.getFacilities().iterator().next();
    assertEquals("Swimming Pool", sameFacility.getCode());
    Hotel facilityHotel = (Hotel) sameFacility.getStructures().iterator().next();
    assertEquals(hotel.getId(),facilityHotel.getId());
  }
View Full Code Here

   
    RemoveMultiLingualInterceptor interceptor = new RemoveMultiLingualInterceptor();
    interceptor.setLabelManager(labelManager);
    interceptor.setLocaleContainer(localeContainer);
   
    Hotel h = new Hotel();
    h.setBriefdescription("Hotel.Briefdescription");
    h.setDescription("Hotel.Description");
    h.setId(1);
    HotelManager hmanager = new HotelManager();
    Class cls = HotelManager.class;
    Method m = cls.getMethod("remove", new Class[] {Object.class});
   
    Label label = new Label();
View Full Code Here

  }
 
  public void testHotelAdd() {
   
    int size = getNumberOfHotels();
    Hotel hotel = addHotel("it");
    assertEquals(getNumberOfLabels(),2);
    Hotel hotel2 = (Hotel) localizedHotelManager.get(hotel.getId());
    assertNotNull(hotel2);
    assertEquals(size + 1, getNumberOfHotels());
    assertEquals("Questo è un descrizione in italiano",hotel2.getDescription().toString());
    assertEquals("this is something else",hotel2.getBriefdescription());
   
  }
View Full Code Here

   
    RemoveMultiLingualInterceptor interceptor = new RemoveMultiLingualInterceptor();
    interceptor.setLabelManager(labelManager);
    interceptor.setLocaleContainer(localeContainer);
   
    Hotel h = new Hotel();
    h.setBriefdescription("Hotel.Briefdescription");
    h.setDescription("Hotel.Description");
    h.setId(1);
    HotelManager hmanager = new HotelManager();
    Class cls = HotelManager.class;
    Method m = cls.getMethod("remove", new Class[] {int.class});
   
    Label label = new Label();
View Full Code Here

  }
 
  public void testHotelUpdate() throws Exception {
    int size = getNumberOfHotels();
    assertEquals(0,size);
    Hotel hotel = addHotel("it");
    size = getNumberOfHotels();
    assertEquals(1,size);
    hotel.setLocale("it");
    Hotel hotel2 = (Hotel) localizedHotelManager.get(hotel.getId());
   
    int numLabels = getNumberOfLabels();
   
    assertEquals("Questo è un descrizione in italiano",hotel2.getDescription().toString());
    assertEquals("this is something else",hotel2.getBriefdescription());
    assertEquals(5,hotel.getStar());
    assertEquals(54.4545,hotel.getLatitude());
    hotel2.setDescription("something else");
    hotel2.setBriefdescription("this is another brief description");
    localizedHotelManager.add(hotel2);
   
   
   
    Hotel hotel3 = (Hotel) localizedHotelManager.get(hotel2.getId());
   
    assertEquals("something else",hotel3.getDescription().toString());
    assertEquals("this is another brief description",hotel3.getBriefdescription());
   
   
    assertEquals(numLabels, getNumberOfLabels());
   
   
View Full Code Here

 
  public void testHotelUpdateWithDifferentLanguages() throws Exception {
   
    int size = getNumberOfHotels();
    assertEquals(0,size);
    Hotel hotel = addHotel("it");
    size = getNumberOfHotels();
    assertEquals(1,size);
   
    Hotel hotel2 = (Hotel) localizedHotelManager.get(hotel.getId());
   
    int numLabels = getNumberOfLabels();
   
    assertEquals(numLabels, 2);
   
    assertEquals("Questo è un descrizione in italiano",hotel2.getDescription().toString());
    assertEquals("this is something else",hotel2.getBriefdescription());
   
    hotel2.setLocale("en");
    localeContainer.setLocale("en");
    hotel2.setDescription("something else");
    hotel2.setBriefdescription("in another language");
   
    localizedHotelManager.add(hotel2);
   
   
   
    assertEquals(4, getNumberOfLabels());
   
    Hotel hotel3 = (Hotel) localizedHotelManager.get(hotel2.getId());
   
    hotel3.setLocale("en");
   
    assertEquals("something else",hotel3.getDescription().toString());
    assertEquals("in another language", hotel3.getBriefdescription());
   
   
  }
View Full Code Here

   
   
  }
 
  public void testHotelRemove() throws Exception {
    Hotel hotel = addHotel("it");
    assertEquals(2,getNumberOfLabels());
    localizedHotelManager.remove(hotel);
   
    assertEquals(0,getNumberOfLabels());
  }
View Full Code Here

   
    assertEquals(0,getNumberOfLabels());
  }
 
  public void testGetAllHotelsWithoutTranslation() throws Exception {
    Hotel hotel = addHotel("it");
    Collection<Structure> hotels = localizedHotelManager.fastGetAll();
    assertEquals(hotels.size(),1);
    localeContainer.setLocale("en");
    for (Structure tempHotel : hotels){
      assertEquals(tempHotel.getBriefdescription(),"this is something else");
View Full Code Here

TOP

Related Classes of it.hotel.model.hotel.Hotel

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.