use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class TestPageAction method testAddForAdminUser.
public void testAddForAdminUser() throws Throwable {
IPage root = this._pageManager.getDraftRoot();
String result = this.executeNewPage(root.getCode(), "admin");
assertEquals(Action.SUCCESS, result);
PageAction action = (PageAction) this.getAction();
assertEquals(action.getStrutsAction(), ApsAdminSystemConstants.ADD);
assertEquals(root.getCode(), action.getParentPageCode());
assertEquals(root.getGroup(), action.getGroup());
assertFalse(action.isGroupSelectLock());
assertTrue(action.isShowable());
assertTrue(action.isDefaultShowlet());
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class TestPageAction method testSavePage_Clone.
public void testSavePage_Clone() throws Throwable {
String copiedPageCode = "pagina_2";
IPage copiedPage = this._pageManager.getDraftPage(copiedPageCode);
assertNotNull(copiedPage);
String pageCode = "pagina_test";
assertNull(this._pageManager.getDraftPage(pageCode));
try {
Map<String, String> params = new HashMap<String, String>();
params.put("strutsAction", String.valueOf(ApsAdminSystemConstants.PASTE));
params.put("parentPageCode", "pagina_1");
params.put("copyPageCode", copiedPageCode);
params.put("langit", "Pagina Test 1");
params.put("langen", "Test Page 1");
params.put("model", "aaaa");
params.put("group", "aaaa");
params.put("pageCode", pageCode);
String result = this.executeSave(params, "admin");
assertEquals(Action.SUCCESS, result);
IPage addedPage = this._pageManager.getDraftPage(pageCode);
assertNotNull(addedPage);
IPage addedPublicPage = this._pageManager.getOnlinePage(pageCode);
assertNull(addedPublicPage);
assertEquals("Pagina Test 1", addedPage.getMetadata().getTitles().getProperty("it"));
assertEquals("Test Page 1", addedPage.getMetadata().getTitles().getProperty("en"));
PageMetadata addedMetadata = addedPage.getMetadata();
assertNotNull(addedMetadata);
PageMetadata expectedMetadata = copiedPage.getMetadata();
addedMetadata.setTitles(expectedMetadata.getTitles());
PageTestUtil.comparePageMetadata(expectedMetadata, addedMetadata, null);
} catch (Throwable t) {
throw t;
} finally {
this._pageManager.deletePage(pageCode);
}
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class TestPageAction method testNewPageByCoachUser.
public void testNewPageByCoachUser() throws Throwable {
IPage root = this._pageManager.getDraftRoot();
String result = this.executeNewPage(root.getCode(), "pageManagerCoach");
assertEquals("pageTree", result);
IPage coach_page = this._pageManager.getDraftPage("coach_page");
result = this.executeNewPage(coach_page.getCode(), "pageManagerCoach");
assertEquals(Action.SUCCESS, result);
PageAction action = (PageAction) this.getAction();
assertEquals(action.getStrutsAction(), ApsAdminSystemConstants.ADD);
assertEquals(coach_page.getCode(), action.getParentPageCode());
assertEquals(coach_page.getGroup(), action.getGroup());
assertTrue(action.isGroupSelectLock());
assertTrue(action.isShowable());
assertTrue(action.isDefaultShowlet());
IPage customers_page = this._pageManager.getDraftPage("customers_page");
result = this.executeNewPage(customers_page.getCode(), "pageManagerCoach");
assertEquals(Action.SUCCESS, result);
action = (PageAction) this.getAction();
assertEquals(action.getStrutsAction(), ApsAdminSystemConstants.ADD);
assertEquals(customers_page.getCode(), action.getParentPageCode());
assertEquals(customers_page.getGroup(), action.getGroup());
assertTrue(action.isGroupSelectLock());
assertTrue(action.isShowable());
assertTrue(action.isDefaultShowlet());
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class TestPageAction method testEditForCoachUser.
public void testEditForCoachUser() throws Throwable {
String selectedPageCode = this._pageManager.getDraftRoot().getCode();
String result = this.executeActionOnPage(selectedPageCode, "pageManagerCoach", "edit");
assertEquals("pageTree", result);
// PAGINA
IPage customers_page = this._pageManager.getDraftPage("customers_page");
// NON
// PREDISPOSTA
// PER
// LA
// PUBBLICAZIONE
// VOLANTE...
result = this.executeActionOnPage(customers_page.getCode(), "pageManagerCustomers", "edit");
assertEquals(Action.SUCCESS, result);
PageAction action = (PageAction) this.getAction();
assertEquals(action.getStrutsAction(), ApsAdminSystemConstants.EDIT);
assertEquals(customers_page.getCode(), action.getPageCode());
assertEquals(customers_page.getModel().getCode(), action.getModel());
assertTrue(action.isShowable());
assertTrue(action.isGroupSelectLock());
Widget widget = customers_page.getWidgets()[customers_page.getModel().getMainFrame()];
if (null != widget) {
assertEquals("content_viewer", widget.getType().getCode());
assertTrue(null != widget.getConfig() && !widget.getConfig().isEmpty());
}
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class TestPageAction method testCloneForCoachUser.
public void testCloneForCoachUser() throws Throwable {
IPage copied = this._pageManager.getDraftPage("coach_page");
String result = this.executeCopyPage(copied, "admin");
assertEquals(Action.SUCCESS, result);
PageAction action = (PageAction) this.getAction();
assertEquals(action.getStrutsAction(), ApsAdminSystemConstants.PASTE);
assertEquals(copied.getCode(), action.getCopyPageCode());
assertEquals(copied.getCode(), action.getParentPageCode());
assertEquals(copied.getModel().getCode(), action.getModel());
assertEquals(copied.getGroup(), action.getGroup());
assertEquals(copied.isShowable(), action.isShowable());
assertNull(action.getTitles().getProperty("it"));
assertNull(action.getTitles().getProperty("en"));
}
Aggregations