Package it.hotel.model.hotel

Examples of it.hotel.model.hotel.Hotel


    }
   
  public void testModelAndView() throws Exception {
    req.addParameter("id", "1")
    String idString = req.getParameter("id");
    Hotel hotel=expectedHotels.get(1);
    expect(structureManager.get(Integer.parseInt(idString))).andReturn(hotel);
    replay(structureManager);
      mvc = mapcontroller.handleRequest(req, resp);
    verify(structureManager);
View Full Code Here


   
   
   
   
    HotelValidator validator = new HotelValidator();
    Hotel hotel = new Hotel();
    validator.setType(hotel);
    hotelFormController.setValidator(validator);
   
    req.setMethod("POST");
    req.setRequestURI("http://localhost:8080/hotel/Hotel/new.htm");
    req.addParameter("name", "name");
    req.addParameter("companytype", "ltd");
    req.addParameter("address", "indirizzo");
    req.addParameter("city", "cagliari");
    req.addParameter("companytaxnumber", "iva");
    req.addParameter("codicefiscale", "codice");
    req.addParameter("telephone", "1");
    req.addParameter("fax", "fax");
    req.addParameter("province", "ca");
    req.addParameter("description", "descrizione");
    req.addParameter("briefdescription", "brevedescrizione");
    req.addParameter("image", "");
    req.addParameter("bankaccount", "2131239");
    req.addParameter("cap", "09020");
    req.addParameter("locale","en");
    req.addParameter("mail","mail@mail.com");
    req.addParameter("star", "2");
   
   
   
   
    expect(localeContainer.getLocale()).andReturn("it");
   
    localeContainer.setLocale("en");
   
   
   
    expect(structureManager.get(0)).andReturn(null);
    expect(structureManager.add(isA(Hotel.class))).andReturn(true);
    localeContainer.setLocale("it");
   
    replay(localeContainer);
    replay(structureManager);
   
    ModelAndView mvc = hotelFormController.handleRequest(req, resp);
   
    verify(localeContainer);
    verify(structureManager);
   
    assertModelAttributeAvailable(mvc, "hotel");
    Hotel hotel2 = (Hotel) mvc.getModelMap().get("hotel");
   
    assertNotNull(hotel2);
   
    assertTrue(hotel2.getName().equals("name"));
    assertTrue(hotel2.getCompanytype().equals("ltd"));
    assertTrue(hotel2.getAddress().equals("indirizzo"));
    assertTrue(hotel2.getCity().equals("cagliari"));
    assertTrue(hotel2.getCompanytaxnumber().equals("iva"));
    assertTrue(hotel2.getCodicefiscale().equals("codice"));
    assertTrue(hotel2.getTelephone().equals("1"));
    assertTrue(hotel2.getFax().equals("fax"));
    assertTrue(hotel2.getProvince().equals("ca"));
    assertTrue(hotel2.getDescription().equals("descrizione"));
    assertTrue(hotel2.getBriefdescription().equals("brevedescrizione"));
    assertTrue(hotel2.getImageLink().equals("/hotel/Image/view.htm?type=hotel&id=0"));
    assertTrue(hotel2.getBankaccount().equals("2131239"));
    assertTrue(hotel2.getCap().equals("09020"));
    assertTrue(hotel2.getLocale().equals("en"));
    assertTrue(hotel2.getMail().equals("mail@mail.com"));
   
  }
View Full Code Here

   */
  @Override
  protected Map referenceData (HttpServletRequest req) throws Exception{

    Map map = super.referenceData(req);
    Hotel hotel = new Hotel();
    map.put("structure", hotel);
    return map;
   
   
  }
View Full Code Here

   
    MultiLingualInterceptor interceptor = new MultiLingualInterceptor();
    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("get", new Class[] {int.class});
   
    expect(localeContainer.getLocale()).andReturn("it");
    expectLastCall().anyTimes();
   
    Label label = new Label();
    label.setCode("Hotel.Briefdescription");
    label.setId(1);
    label.setLanguage("it");
    label.setText("this is something");
   
    expect(labelManager.getLabel(1, "Hotel.Briefdescription", "it")).andReturn(label);
    expect(labelManager.getLabel(1, "Hotel.Description", "it")).andReturn(label);
   
   
    replay(localeContainer);
    replay(labelManager);
   
    Integer i = new Integer(1);
    try {
      interceptor.afterReturning(h, m, new Object[] {i}, hmanager)
    }catch (Throwable t){
      assertTrue(false);
    }
   
    assertEquals(h.getBriefdescription(),"this is something");
   
    verify(labelManager);
    verify(localeContainer);
   
  }
View Full Code Here

 
 
  public void testGetStructure() {
   
   
    Hotel hotel = addHotel();
   
    int id = hotel.getId();
   
    Structure structure = (Structure) localizedStructureManager.get(id);
   
    assertEquals(hotel, structure);
   
View Full Code Here

  }



  private void setupExpectedHotels() {
    Hotel h1=new Hotel();
       h1.setId(1);
       Hotel h2=new Hotel();
       h2.setId(2);
       expectedHotels.add(h1);
       expectedHotels.add(h2);
      
  }
View Full Code Here

    price2.setPrice(new BigDecimal(120));
    expectedPrices1.add(price2);
    t1.setPriceList(expectedPrices1);
    room1 = new Room();
    room1.setTypology(t1);
    Hotel h1 = new Hotel();
    h1.setId(4);
    room1.setStructure(h1);
   
       
  }
View Full Code Here

  }



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

    localizedHotelManager.add(structure1);
    return structure1;
  }
 
  public Hotel addHotel(){
    Hotel hotel1=new Hotel();
    hotel1.setAddress("via garibaldi");
    hotel1.setBankaccount("76876587658687");
    hotel1.setBriefdescription("breve descrizione");
    hotel1.setCap("09800");
    hotel1.setCity("Cagliari");
    hotel1.setCodicefiscale("070429589304");
    hotel1.setDescription("lunga descrizione");
    hotel1.setFax("0898080");
    hotel1.setName("setar");
    hotel1.setCompanytaxnumber("62349562ncb982y5");
    hotel1.setProvince("CA");
    hotel1.setCompanytype("setar");
    hotel1.setTelephone("070429589304");
    localizedHotelManager.add(hotel1);
    return hotel1;
  }
View Full Code Here

   
  }
 
    public void setHotel(){
     
      hotel1=new Hotel();
    hotel1.setAddress("via garibaldi");
    hotel1.setBankaccount("76876587658687");
    hotel1.setBriefdescription("breve descrizione");
    hotel1.setCap("09800");
    hotel1.setCity("Cagliari");
    hotel1.setCodicefiscale("070429589304");
    hotel1.setDescription("lunga descrizione");
    hotel1.setFax("0898080");
    hotel1.setName("setar");
    hotel1.setCompanytaxnumber("62349562ncb982y5");
    hotel1.setProvince("CA");
    hotel1.setCompanytype("setar");
    hotel1.setTelephone("070429589304");
    localizedHotelManager.add(hotel1);

    hotel2=new Hotel();
    hotel2.setAddress("via fiume");
    hotel2.setBankaccount("76876587658687");
    hotel2.setBriefdescription("breve descrizione");
    hotel2.setCap("09800");
    hotel2.setCity("Cagliari");
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.