{
new UnitTest()
{
public void execute() throws Exception
{
Page page = new Page();
page.setOwnerType("group");
page.setOwnerId("/platform/administrators");
page.setName("newAccount");
page.setShowMaxWindow(true);
page.setTitle("newAccount title");
assertTrue(events.isEmpty());
storage_.create(page);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.PAGE_CREATED, event.getEventName());
Page p = ((Page)event.getData());
assertEquals("group", p.getOwnerType());
assertEquals("/platform/administrators", p.getOwnerId());
assertEquals("newAccount", p.getName());
assertEquals("newAccount title", p.getTitle());
assertTrue(p.isShowMaxWindow());
p.setShowMaxWindow(false);
storage_.save(p);
p = userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertFalse(p.isShowMaxWindow());
p.setShowMaxWindow(true);
storage_.save(p);
p = userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertTrue(p.isShowMaxWindow());
p.setShowMaxWindow(false);
storage_.save(p);
p = userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertFalse(p.isShowMaxWindow());
p.setShowMaxWindow(true);
storage_.save(p);
p = userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertTrue(p.isShowMaxWindow());
Page p2 = userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertEquals("group", p2.getOwnerType());
assertEquals("/platform/administrators", p2.getOwnerId());
assertEquals("newAccount", p2.getName());
// assertFalse(p2.isShowMaxWindow());
p2.setTitle("newAccount title 1");
p2.setShowMaxWindow(true);
storage_.save(p2);
Page p3 = userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertEquals("newAccount title 1", p3.getTitle());
// assertTrue(p3.isShowMaxWindow());
}
}.execute(null);
}