Package it.hotel.model.typology

Examples of it.hotel.model.typology.Typology


  }
 
 
  public void testGetPrice() throws Exception {
    GregorianCalendar day = CalendarUtils.GetToday();
    Typology typology = (Typology) localizedTypologyManager.get(t.getId());
    assertEquals(typology.getId(), t.getId());
    assertEquals(typology.getPriceList().size(), t.getPriceList().size());
    assertEquals(typology.getPriceList().size(), 2);
    BigDecimal priceValue = typology.getPrice(day);
    assertNotNull(priceValue);
    assertEquals(priceValue, new BigDecimal(120));
    day = CalendarUtils.GetGregorianCalendar("01/01/2008");
    priceValue = typology.getPrice(day);
    assertEquals(priceValue, new BigDecimal(100));
    day = CalendarUtils.GetGregorianCalendar("01/01/2018");
    assertEquals(typology.getPrice(day), null);
  }
View Full Code Here


    /**
     * @param
     */
  protected void doSubmitAction (Object command){
    Room room = (Room)command;
    Typology typology = (Typology)typologyManager.get(room.getTypology_id());
    room.setTypology(typology);
    Structure hotel = (Structure) structureManager.get(room.getHotelid());
    room.setStructure(hotel);
    roomManager.add(room);
  }
View Full Code Here

  }
 
  public void testGetPriceListOnDateRange() throws Exception {
    GregorianCalendar endDate = CalendarUtils.GetToday();
    GregorianCalendar startDate = CalendarUtils.GetGregorianCalendar("01/01/2008");
    Typology typology = (Typology) localizedTypologyManager.get(t.getId());
    ArrayList<Price> priceList = typology.getPriceListOnDataRange(startDate, endDate);
    assertNotNull(priceList);
    assertEquals(priceList.size(),t.getPriceList().size());
    startDate = CalendarUtils.GetGregorianCalendar("02/01/2008");
    priceList = typology.getPriceListOnDataRange(startDate, endDate);
    assertNotNull(priceList);
    assertEquals(priceList.size(), t.getPriceList().size()-1);
  }
View Full Code Here

   
    if(id != null){
      if (locale != null){
        localeContainer.setLocale(locale);
      }
      Typology typology = (Typology) manager.get(Integer.parseInt(id));
      typology.setLocale(oldLocale);
      typology.setHotelId(typology.getStructure().getId());
      typology.setId(Integer.parseInt(id));
      localeContainer.setLocale(oldLocale);
          return new ModelAndView("hotel.typology.new", "typology", typology);     
    }
    return new ModelAndView("redirect:/Typology/list.html");
    }
View Full Code Here

  protected void setUp()  {
    manager = new TypologyManager();
      dao = EasyMock.createMock(ITypologyDAO.class);
      manager.setDAO(dao);
      o = new Typology();
      o1 = new Typology();
      lista= new ArrayList<Typology>();
      hotel=new Hotel();
      hotel.setId(1);
   
   
View Full Code Here

   
    Room room = new Room();
    room.setId(1);
    room.setStructure(h);
   
    Typology typology = new Typology();
    typology.setId(1);
    typology.setName("something");
   
    room.setTypology(typology);
   
    RoomManager rmanager = new RoomManager();
    Class cls = RoomManager.class;
View Full Code Here

    Room room = new Room();
    room.setId(1);
    room.setStructure(h);
   
    //Typology has no values set to simulate hibernate not populating the object
    Typology typology = new Typology();
    typology.setId(1);
   
    room.setTypology(typology);
   
    RoomManager rmanager = new RoomManager();
    Class cls = RoomManager.class;
View Full Code Here


    }
 
  public void testTypologySimpleFormCreate() throws Exception {
    Typology actual = expectedTypologies.get(1);
    ArrayList<Hotel> hotels = (ArrayList<Hotel>) expectedHotels;
    typologyFormController.setSuccessView("hotel.Typology.list.html");
    expect(typologyManager.add(isA(Typology.class))).andReturn(true);
 
   
View Full Code Here

    List<Room> freeRooms = new ArrayList<Room>();
    Map toSearch = new HashMap();
    Map typologies = new HashMap<String, Typology>();
    Room room = new Room();
   
    Typology typology = (Typology) typologyManager.get(typologyId);
    room.setTypology(typology);
   
    typologies.put("typology", typology);
    Collection<Room> rooms = roomManager.searchAll(typologies);
    Collection<Room> roomsOccupied = ((IBookingDAO)super.getDAO()).searchRoomNotAvailable(beginDate, finishDate, toSearch);
View Full Code Here

   
    booking= new BookingFrontendDTO();
    booking.setBeginDate(CalendarUtils.GetGregorianCalendar("21/07/2009"));
    booking.setFinishDate(CalendarUtils.GetGregorianCalendar("22/07/2009"));
   
    Typology t= new Typology();
    t.setBeds(1);
    t.setId(2);
    t.setHotelId(1);
    t.setName("myTypology");
   
    Typology t1= new Typology();
    t1.setBeds(1);
    t1.setId(2);
    t1.setHotelId(1);
    t1.setName("myTypology1");
   
    Price p= new Price();
    p.setCalendarDate(CalendarUtils.GetGregorianCalendar(("21/07/2009")));
    p.setId(1);
    p.setTypology_id(1);
    p.setPrice(new BigDecimal(100));
   
    Price p1= new Price();
    p1.setCalendarDate(CalendarUtils.GetGregorianCalendar(("22/07/2009")));
    p1.setId(2);
    p1.setTypology_id(1);
    p1.setPrice(new BigDecimal(200));
   
    Price p2= new Price();
    p2.setCalendarDate(CalendarUtils.GetGregorianCalendar(("21/07/2009")));
    p2.setId(3);
    p2.setTypology_id(2);
    p2.setPrice(new BigDecimal(300));
   
    Price p3= new Price();
    p3.setCalendarDate(CalendarUtils.GetGregorianCalendar(("22/07/2009")));
    p3.setId(4);
    p3.setTypology_id(2);
    p3.setPrice(new BigDecimal(400));
   
    Set<Price> pricelist= new HashSet<Price>();
    pricelist.add(p1);
    pricelist.add(p);
    Set<Price> pricelist1= new HashSet<Price>();
    pricelist1.add(p3);
    pricelist1.add(p2);
    t.setPriceList(pricelist);
    t1.setPriceList(pricelist1);
   
    Room room= new Room();
    room.setFloor(1);
    room.setHotelid(1);
    room.setId(1);
    room.setName("myRoom");
    room.setNumber(1);
    room.setTypology_id(t.getId());
    room.setTypology(t);
   
    Room room1= new Room();
    room1.setFloor(1);
    room1.setHotelid(1);
    room1.setId(1);
    room1.setName("myRoom");
    room1.setNumber(1);
    room1.setTypology_id(t1.getId());
    room1.setTypology(t1);
   
      List<Room> rooms= new ArrayList<Room>();
      rooms.add(room);
      List<Room> rooms1= new ArrayList<Room>();
View Full Code Here

TOP

Related Classes of it.hotel.model.typology.Typology

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.