Search in sources :

Example 1 with PageChangedEvent

use of com.agiletec.aps.system.services.page.events.PageChangedEvent in project entando-core by entando.

the class CacheInfoManagerTest method updateFromPageChanged.

@Test
public void updateFromPageChanged() throws Throwable {
    PageChangedEvent event = new PageChangedEvent();
    Page page = new Page();
    page.setCode("code");
    event.setPage(page);
    cacheInfoManager.updateFromPageChanged(event);
    Mockito.verify(cache, Mockito.times(1)).get(Mockito.anyString());
    Mockito.verify(cache, Mockito.times(1)).put(Mockito.anyString(), Mockito.any(Map.class));
    Object requiredMap = cacheInfoManager.getFromCache(ICacheInfoManager.CACHE_INFO_MANAGER_CACHE_NAME, ICacheInfoManager.GROUP_CACHE_NAME_PREFIX + ICacheInfoManager.CACHE_INFO_MANAGER_CACHE_NAME);
    Assert.assertTrue(requiredMap instanceof Map);
    Assert.assertNotNull(requiredMap);
    Assert.assertEquals(2, ((Map) requiredMap).size());
}
Also used : PageChangedEvent(com.agiletec.aps.system.services.page.events.PageChangedEvent) Page(com.agiletec.aps.system.services.page.Page) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.junit.Test)

Example 2 with PageChangedEvent

use of com.agiletec.aps.system.services.page.events.PageChangedEvent in project entando-core by entando.

the class PageManager method notifyPageChangedEvent.

private void notifyPageChangedEvent(IPage page, int operationCode, Integer framePos) {
    PageChangedEvent event = buildEvent(page, operationCode, framePos);
    this.notifyEvent(event);
}
Also used : PageChangedEvent(com.agiletec.aps.system.services.page.events.PageChangedEvent)

Example 3 with PageChangedEvent

use of com.agiletec.aps.system.services.page.events.PageChangedEvent in project entando-core by entando.

the class PageManager method buildEvent.

private PageChangedEvent buildEvent(IPage page, int operationCode, Integer framePos) {
    PageChangedEvent event = new PageChangedEvent();
    event.setPage(page);
    event.setOperationCode(operationCode);
    if (null != framePos) {
        event.setFramePosition(framePos);
    }
    return event;
}
Also used : PageChangedEvent(com.agiletec.aps.system.services.page.events.PageChangedEvent)

Example 4 with PageChangedEvent

use of com.agiletec.aps.system.services.page.events.PageChangedEvent in project entando-core by entando.

the class PageManager method notifyPageChangedEvent.

private void notifyPageChangedEvent(IPage page, int operationCode, Integer framePos, String eventType) {
    PageChangedEvent event = buildEvent(page, operationCode, framePos);
    event.setEventType(eventType);
    this.notifyEvent(event);
}
Also used : PageChangedEvent(com.agiletec.aps.system.services.page.events.PageChangedEvent)

Aggregations

PageChangedEvent (com.agiletec.aps.system.services.page.events.PageChangedEvent)4 Page (com.agiletec.aps.system.services.page.Page)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Test (org.junit.Test)1