use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class DataObjectMapperCacheWrapperTest method createMockWidget.
private Widget createMockWidget() {
Widget widget = new Widget();
WidgetType type = new WidgetType();
type.setCode("type");
WidgetTypeParameter param1 = new WidgetTypeParameter();
param1.setName("dataId");
WidgetTypeParameter param2 = new WidgetTypeParameter();
param2.setName("testParam");
List<WidgetTypeParameter> params = Arrays.asList(new WidgetTypeParameter[] { param1, param2 });
type.setTypeParameters(params);
widget.setType(type);
ApsProperties props = new ApsProperties();
props.put("dataId", "id1");
props.put("testParam", "test");
widget.setConfig(props);
return widget;
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class TestApiWidgetTypeInterface method addMockWidget.
private void addMockWidget(String widgetTypeCode) throws Throwable {
WidgetType type = new WidgetType();
type.setCode(widgetTypeCode);
ApsProperties titles = new ApsProperties();
titles.setProperty("en", "English title");
titles.setProperty("it", "Italian title");
type.setTitles(titles);
this._widgetTypeManager.addWidgetType(type);
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class TestApiWidgetTypeInterface method testUpdateJaxbWidgetType.
public void testUpdateJaxbWidgetType() throws Throwable {
ApsProperties titles = new ApsProperties();
titles.setProperty("en", "English title");
titles.setProperty("it", "Italian title");
this.testInvokeUpdateJaxbNoLogicWidgetType("login_form", titles, true, null, true);
this.testInvokeUpdateJaxbNoLogicWidgetType("login_form", titles, true, "Gui of login_form", true);
this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", null, false, null, false);
this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", titles, false, null, false);
this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", titles, true, null, true);
this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", titles, true, "new gui", true);
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class TestCategoryManager method createCategory.
private Category createCategory() {
Category cat = new Category();
cat.setDefaultLang("it");
cat.setCode("tempCode");
Category parent = _categoryManager.getCategory("cat1");
cat.setParent(parent);
cat.setParentCode(parent.getCode());
ApsProperties titles = new ApsProperties();
titles.put("it", "Titolo in Italiano");
titles.put("en", "Titolo in Inglese");
cat.setTitles(titles);
return cat;
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class I18nManagerIntegrationTest method testUpdateLabels.
public void testUpdateLabels() throws Throwable {
String key = "TEST_KEY";
ApsProperties labels = new ApsProperties();
labels.put("it", "Testo Italiano");
labels.put("en", "English Text");
try {
assertNull(_i18nManager.getLabelGroups().get(key));
_i18nManager.addLabelGroup(key, labels);
ApsProperties toUpdate = (ApsProperties) _i18nManager.getLabelGroups().get(key);
assertNotNull(toUpdate);
toUpdate.put("it", "Testo Italiano Modificato");
toUpdate.put("en", "Modified English Text");
_i18nManager.updateLabelGroup(key, toUpdate);
ApsProperties extracted = (ApsProperties) _i18nManager.getLabelGroups().get(key);
assertNotNull(extracted);
assertEquals("Testo Italiano Modificato", extracted.getProperty("it"));
assertEquals("Modified English Text", extracted.getProperty("en"));
} catch (Throwable t) {
throw t;
} finally {
_i18nManager.deleteLabelGroup(key);
assertNull(_i18nManager.getLabelGroups().get(key));
}
}
Aggregations