Package it.hotel.model.typology

Examples of it.hotel.model.typology.Typology


   
       
  }

  private void setUpExpectedRooms() {
    Typology t1=new Typology();
    t1.setId(1);
    t1.setHotelId(1);   
    Room r1= new Room();
    r1.setId(1);
    r1.setHotelid(1);
    r1.setTypology(t1);
    Room r2=new Room();
View Full Code Here


 
    }
   
    public void setTypology(){

    t=new Typology();
    t.setBeds(2);
    t.setStructure(hotel1);
    t.setHotelId(hotel1.getId());
    t.setName("MyTypology");
    localizedTypologyManager.add(t);
   
    // setTipology
    t1=new Typology();
    t1.setBeds(2);
    t1.setStructure(hotel2);
    t1.setHotelId(hotel2.getId());
    t1.setName("MyTypology1");
    localizedTypologyManager.add(t1);
   
    t2=new Typology();
    t2.setBeds(2);
    t2.setStructure(hotel2);
    t2.setHotelId(hotel2.getId());
    t2.setName("MyTypology2");
    localizedTypologyManager.add(t2);
View Full Code Here



  private void createModels() {
    hotel= new Hotel();
    typology=new Typology();
   
    customer=new Customer();
    room= new Room();
  }
View Full Code Here

  }



  public void setupExpectedPrice(){
      Typology typ= expectedTypologies.get(1);
    GregorianCalendar date = CalendarUtils.GetToday();
    price=new Price();
    price.setCalendarDate(date);
    price.setTypology_id(typ.getId());
    price.setPrice(new BigDecimal(120));
    expectedPrices= new HashSet<Price>();
    expectedPrices.add(price);
   
   
View Full Code Here

    assertTrue(mvc.getModel().containsKey("hotel"));
    assertTrue(mvc.getModel().containsKey("typologies"));
  }

  public void testRoomSimpleFormCreate() throws Exception {
    Typology typology = new Typology();
    Hotel hotel=new Hotel();
    List<Hotel> expectedHotels = new ArrayList<Hotel> ();
    Room room= new Room();
    roomFormController.setSuccessView("hotel.Room.list.htm");
    expect(roomManager.add(isA(Room.class))).andReturn(true);
View Full Code Here

   
  }
 
  public void setTypology(){

    typology = new Typology();
    typology.setBeds(2);
    typology.setStructure(hotel1);
    typology.setHotelId(hotel1.getId());
    typology.setName("MyTypology");
    localizedTypologyManager.add(typology);
View Full Code Here

    /**
     * @throws
     * @return
     */
  protected Object formBackingObject(HttpServletRequest request) throws Exception {
    Typology typologyForm = (Typology) super.formBackingObject(request);
    if(typologyForm.getHotelId() == 0){
      typologyForm.setHotelId(getUserHotelId());
    }
    return typologyForm;
  }
View Full Code Here

   * @return
   */
  @Override
  protected Map referenceData(HttpServletRequest request) throws Exception {
    Map map = new HashMap();
    Typology typology = new Typology();
    String locale = localeContainer.getLocale();
    typology.setLocale(locale);
    ArrayList<Structure> hotels = new ArrayList<Structure> ();
    Structure hotel = (Structure) structureManager.get(userContainer.getUser().getStructureId());
    hotels.add(hotel);
    map.put("hotels", hotels);
    return map;
View Full Code Here

   * @throws
   * @return
   */
  @Override
  protected ModelAndView onSubmit (HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception{
    Typology typology = (Typology) command;
    String locale = localeContainer.getLocale();
    String typologyLocale = (String)request.getParameter("locale");
    if (!typologyLocale.isEmpty()){
      typology.setLocale(typologyLocale);
    }
    else{
      typology.setLocale(locale);
    }
    boolean newTypology = (typology.getId() == 0);
    localeContainer.setLocale(typology.getLocale());
    typology.setStructure((Structure) structureManager.get(typology.getHotelId()));
    this.addTypology(typology);
    localeContainer.setLocale(locale);
    request.setAttribute("typology", typology);
    if(newTypology){
      return super.onSubmit(request, response, command, errors);
View Full Code Here

  }
 
  public void testTypology(){
   
    Typology typology=(Typology)localizedTypologyManager.get(t.getId());
    assertNotNull(typology);
   
   
    assertEquals(typology.getBeds(), 2);
    assertEquals(typology.getStructure(), hotel1);
    assertEquals(typology.getHotelId(), hotel1.getId());
    assertEquals(typology.getId(), t.getId());
    assertEquals(typology.getName(), "MyTypology");
    assertEquals(typology.toString(), "MyTypology");
    assertEquals(typology.getPriceList().size(), t.getPriceList().size());
    assertTrue(typology.isFromStructure(hotel1.getId()));
    assertTrue(typology.equals(t));
   
    localizedTypologyManager.remove(t.getId());
    Typology typology1=(Typology)localizedTypologyManager.get(t.getId());
    assertNull(typology1);
  }
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.