Ejemplo n.º 1
0
 @Test
 public void selectNewClassInDropDown_shouldRenderNewEditorPanelThroughAjax() {
   selectEventType(1);
   fieldList =
       (RepeatingView) tester.getComponentFromLastRenderedPage("form:fieldContainer:fields");
   assertThat(fieldList.size(), is(2));
   Component attributeName = fieldList.get("1:row:name");
   assertThat(attributeName.getDefaultModelObjectAsString(), is("name"));
 }
 private Component getSingleLanguagePathLabel(LanguagePath[] paths)
     throws InvalidLanguageTagException {
   WebMarkupContainer container = new WebMarkupContainer("singleContainer");
   RepeatingView rv = new RepeatingView("singles");
   if (paths != null) {
     WebMarkupContainer wmc = new WebMarkupContainer(rv.newChildId());
     rv.add(
         wmc.add(
             new Label(
                     "singleLanguages",
                     LanguagePathUtil.makeLanguagePathString(
                         paths, MetaAttribute.SUPPORTEDLANGUAGES, getLocale()))
                 .setRenderBodyOnly(true)));
   }
   container.add(rv);
   container.setVisible(rv.size() != 0);
   addCount += rv.size();
   return container;
 }
 private Component getMultidirectionalPathViewComponent(Collection<LanguagePath[]> pathList)
     throws InvalidLanguageTagException {
   WebMarkupContainer container = new WebMarkupContainer("multidirectionalContainer");
   RepeatingView rv = new RepeatingView("multidirectionals");
   if (pathList != null) {
     for (LanguagePath[] paths : pathList) {
       WebMarkupContainer wmc = new WebMarkupContainer(rv.newChildId());
       rv.add(
           wmc.add(
               new Label(
                       "multidirectionalPairs",
                       LanguagePathUtil.makeLanguagePathString(
                           paths, MetaAttribute.SUPPORTEDLANGUAGEPAIRS_PAIRLIST, getLocale()))
                   .setRenderBodyOnly(true)));
     }
   }
   container.add(rv);
   container.setVisible(rv.size() != 0);
   addCount += rv.size();
   return container;
 }
 private Component getCombinationPathViewComponent(LanguagePath[] paths)
     throws InvalidLanguageTagException {
   WebMarkupContainer container = new WebMarkupContainer("combinationContainer");
   RepeatingView rv = new RepeatingView("combinations");
   if (paths != null) {
     for (LanguagePath path : paths) {
       WebMarkupContainer wmc = new WebMarkupContainer(rv.newChildId());
       rv.add(
           wmc.add(
               new Label(
                       "combinationPairs",
                       LanguagePathUtil.makeLanguagePathString(
                           new LanguagePath[] {path},
                           MetaAttribute.SUPPORTEDLANGUAGEPAIRS_ANYCOMBINATION,
                           getLocale()))
                   .setRenderBodyOnly(true)));
     }
   }
   container.add(rv);
   container.setVisible(rv.size() != 0);
   addCount += rv.size();
   return container;
 }
Ejemplo n.º 5
0
 @Test
 public void firstClassIsDefault_shouldCreateEditorFieldsBasedOnDefault() {
   assertThat(fieldList.size(), is(3));
   Component attributeName = fieldList.get("3:row:name");
   assertThat(attributeName.getDefaultModelObjectAsString(), is("testProperty"));
 }