use of com.hack23.cia.model.internal.application.system.impl.ApplicationSession in project cia by Hack23.
the class AdminApplicationSessionPageModContentFactoryImpl method createContent.
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout content = createPanelContent();
final String pageId = getPageId(parameters);
final int pageNr = getPageNr(parameters);
getMenuItemFactory().createMainPageMenuBar(menuBar);
LabelFactory.createHeader2Label(content, ADMIN_APPLICATION_SESSION);
final DataContainer<ApplicationSession, Long> dataContainer = getApplicationManager().getDataContainer(ApplicationSession.class);
final List<ApplicationSession> pageOrderBy = dataContainer.getPageOrderBy(pageNr, DEFAULT_RESULTS_PER_PAGE, ApplicationSession_.createdDate);
createPagingControls(content, NAME, pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);
getGridFactory().createBasicBeanItemGrid(content, ApplicationSession.class, pageOrderBy, APPLICATION_SESSION, COLUMN_ORDER, HIDE_COLUMNS, new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "hjid"), null, new ListPropertyConverter[] { new ListPropertyConverter("page", "events", "actionName") });
if (pageId != null && !pageId.isEmpty()) {
final ApplicationSession applicationSession = dataContainer.load(Long.valueOf(pageId));
if (applicationSession != null) {
final VerticalLayout rightLayout = new VerticalLayout();
rightLayout.setSizeFull();
final HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setWidth(ContentSize.FULL_SIZE);
content.addComponent(horizontalLayout);
content.setExpandRatio(horizontalLayout, ContentRatio.GRID);
getFormFactory().addFormPanelTextFields(horizontalLayout, applicationSession, ApplicationSession.class, AS_LIST);
horizontalLayout.addComponent(rightLayout);
horizontalLayout.setExpandRatio(rightLayout, ContentRatio.GRID);
getGridFactory().createBasicBeanItemGrid(rightLayout, ApplicationActionEvent.class, applicationSession.getEvents(), APPLICATION_ACTION_EVENT, COLUMN_ORDER2, HIDE_COLUMNS2, new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME, "hjid"), null, null);
}
}
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_APPLICATION_SESSION_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
return content;
}
use of com.hack23.cia.model.internal.application.system.impl.ApplicationSession in project cia by Hack23.
the class DestroyApplicationSessionServiceITest method serviceDestroyApplicationSessionRequestSuccessTest.
/**
* Service destroy application session request success test.
*
* @throws Exception
* the exception
*/
@Test
@PerfTest(threads = 4, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 600, percentile95 = 850, throughput = 10)
public void serviceDestroyApplicationSessionRequestSuccessTest() throws Exception {
setAuthenticatedAnonymousUser();
final CreateApplicationSessionRequest createTestApplicationSession = createTestApplicationSession();
final DestroyApplicationSessionRequest destroyApplicationSessionRequest = new DestroyApplicationSessionRequest();
destroyApplicationSessionRequest.setSessionId(createTestApplicationSession.getSessionId());
final ServiceResponse response = applicationManager.service(destroyApplicationSessionRequest);
assertNotNull(EXPECT_A_RESULT, response);
assertEquals(EXPECT_SUCCESS, ServiceResult.SUCCESS, response.getResult());
final ApplicationSession applicationSession = applicationSessionDAO.findFirstByProperty(ApplicationSession_.sessionId, createTestApplicationSession.getSessionId());
assertNotNull(EXPECT_A_RESULT, applicationSession);
assertNotNull(EXPECT_A_RESULT, applicationSession.getDestroyedDate());
}
use of com.hack23.cia.model.internal.application.system.impl.ApplicationSession in project cia by Hack23.
the class CreateApplicationEventServiceITest method serviceCreateApplicationEventRequestSuccessTest.
/**
* Service create application event request success test.
*
* @throws Exception
* the exception
*/
@Test
@PerfTest(threads = 4, duration = 3000, warmUp = 1500)
@Required(max = 1000, average = 400, percentile95 = 450, throughput = 10)
public void serviceCreateApplicationEventRequestSuccessTest() throws Exception {
setAuthenticatedAnonymousUser();
final CreateApplicationSessionRequest createSessionRequest = createTestApplicationSession();
final CreateApplicationEventRequest serviceRequest = new CreateApplicationEventRequest();
serviceRequest.setSessionId(createSessionRequest.getSessionId());
serviceRequest.setApplicationMessage("applicationMessage");
serviceRequest.setEventGroup(ApplicationEventGroup.USER);
serviceRequest.setApplicationOperation(ApplicationOperationType.CREATE);
serviceRequest.setPage("Test");
serviceRequest.setPageMode("PageMode");
serviceRequest.setElementId("ElementId");
serviceRequest.setActionName("Content");
serviceRequest.setApplicationMessage("applicationMessage");
serviceRequest.setErrorMessage("errorMessage");
final CreateApplicationEventResponse response = (CreateApplicationEventResponse) applicationManager.service(serviceRequest);
assertNotNull(EXPECT_A_RESULT, response);
assertEquals(EXPECT_SUCCESS, ServiceResult.SUCCESS, response.getResult());
final List<ApplicationSession> findListByProperty = applicationSessionDAO.findListByProperty(ApplicationSession_.sessionId, serviceRequest.getSessionId());
assertEquals(1, findListByProperty.size());
final ApplicationSession applicationSession = findListByProperty.get(0);
assertNotNull(applicationSession);
assertEquals(1, applicationSession.getEvents().size());
}
use of com.hack23.cia.model.internal.application.system.impl.ApplicationSession in project cia by Hack23.
the class ApplicationSessionDAOITest method getAllTest.
/**
* Gets the all test.
*
* @return the all test
* @throws Exception
* the exception
*/
@Test
public void getAllTest() throws Exception {
final ApplicationSession applicationSession = createApplicationSession();
final List<ApplicationSession> all = applicationSessionDAO.getAll();
assertNotNull(all);
assertFalse(all.isEmpty());
}
use of com.hack23.cia.model.internal.application.system.impl.ApplicationSession in project cia by Hack23.
the class ApplicationSessionDAOITest method getPageOrderByTest.
/**
* Gets the page order by test.
*
* @return the page order by test
* @throws Exception
* the exception
*/
@Test
public void getPageOrderByTest() throws Exception {
final ApplicationSession applicationSession = createApplicationSession();
final int resultPerPage = 1;
final List<ApplicationSession> pageList = applicationSessionDAO.getPageOrderBy(1, resultPerPage, ApplicationSession_.createdDate);
assertNotNull(pageList);
assertFalse(pageList.isEmpty());
assertEquals(resultPerPage, pageList.size());
}
Aggregations