Package it.hotel.model.label

Examples of it.hotel.model.label.Label


  public void onSetUpInTransaction() throws Exception {
   
  }
 
  public void testLabel() throws Exception {
    Label label = new Label();
    label.setCode("hotel.description");
    label.setText("questo è italiano");
    label.setLanguage("it");
    label.setOwnerId(1);
    labelRawManager.add(label);
    sessionFactory.getCurrentSession().flush();
    sessionFactory.getCurrentSession().clear();
    assertTrue(label.getId() > 0);
    Label l2 = (Label) labelRawManager.get(label.getId());
    assertNotNull(l2);
    assertEquals(1, label.getOwnerId());
   
  }
View Full Code Here


  }
 
  public void testLabelFactoryManager() throws Exception {
   
    int numLabels = getNumberOfLabels();
    Label label = new Label();
    label.setCode("hotel.description");
    label.setLanguage("it");
    label.setText("hello");
    label.setOwnerId(1);
    labelRawManager.add(label);
    assertEquals( numLabels+1, getNumberOfLabels());
   
  }
View Full Code Here

   
  }
 
  public void testGetLabelFromParams() {
    int numLabels = getNumberOfLabels();
    Label label = new Label();
    label.setCode("hotel.description");
    label.setLanguage("it");
    label.setText("hello");
    label.setOwnerId(1);
   
    labelRawManager.add(label);
    Label label2 = labelRawManager.getLabel(1,"hotel.description","it");
    assertNotNull(label2);
    assertEquals("hotel.description", label.getCode());
    assertEquals(1, label.getOwnerId());
    assertEquals("it",label.getLanguage());
   
View Full Code Here

    assertEquals("it",label.getLanguage());
   
  }
 
  public void testRemoveLabel() throws Exception {
    Label label = new Label();
    label.setCode("hotel.description");
    label.setLanguage("it");
    label.setText("hello");
    label.setOwnerId(1);
    labelRawManager.add(label);
    assertEquals(getNumberOfLabels(), 1);
    labelRawManager.removeLabel(1,"hotel.description","it");
    assertEquals(getNumberOfLabels(),0);
  }
View Full Code Here

    assertEquals(getNumberOfLabels(),0);
  }
 
  public void testGetLabelsForHotelDescription() throws Exception {
   
    Label label = new Label();
    label.setCode("hotel.description");
    label.setLanguage("it");
    label.setText("Descrizione in italiano");
    label.setOwnerId(1);
   
    labelRawManager.add(label);
    Label labelEnglish = new Label();
    labelEnglish.setCode("hotel.description");
    labelEnglish.setLanguage("en");
    labelEnglish.setText("Description in english");
    labelEnglish.setOwnerId(1);
    labelRawManager.add(labelEnglish);
    assertEquals(2, getNumberOfLabels());
   
    HashMap<String,Label> labels = labelRawManager.getLabels(1,"hotel.description");
    assertNotNull(labels);
View Full Code Here

   
  }
 
  public void testNotGetLabelReturnsNull() {
    int numLabels = getNumberOfLabels();
    Label label = new Label();
    label.setCode("hotel.description");
    label.setLanguage("it");
    label.setText("hello");
    label.setOwnerId(1);
 
    labelRawManager.add(label);
    Label label2 = labelRawManager.getLabel(1,"hotel.description","en");
    assertNull(label2);
   
   
  }
View Full Code Here

    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);
   
   
View Full Code Here

   
    ArrayList<Hotel> hotellist = new ArrayList<Hotel>();
    hotellist.add(h);
    hotellist.add(h1);
   
    Label label = new Label();
    label.setCode("Hotel.Briefdescription");
    label.setId(1);
    label.setLanguage("it");
    label.setText("this is something");
   
    Label label2 = new Label();
    label2.setCode("Hotel.Briefdescription");
    label2.setId(2);
    label2.setLanguage("it");
    label2.setText("this is something else");
   
   
    HotelManager hmanager = new HotelManager();
    Class cls = HotelManager.class;
   
View Full Code Here

    Method m = cls.getMethod("get", new Class[] {int.class});
   
    expect(localeContainer.getLocale()).andReturn("it");
    expectLastCall().anyTimes();
   
    Label label = new Label();
    label.setCode("Typology.Name");
    label.setId(1);
    label.setLanguage("it");
    label.setText("Doppia");
   
    expect(labelManager.getLabel(1, "Typology.Name", "it")).andReturn(label);
   
    replay(localeContainer);
    replay(labelManager);
View Full Code Here

        rval = invocation.proceed();
        for (String field: localisedFieldNames){
          String text = fieldValues.get(field);
          String descriptor = MultiLingualInterceptor.createDescriptorCode(model, field);
         
          Label label = createLabel(descriptor, model);
          label.setText(text);
          labelManager.add(label);
        }
      } catch (Throwable t) {
       
      }
View Full Code Here

TOP

Related Classes of it.hotel.model.label.Label

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.