use of com.haulmont.cuba.core.app.execution.Executions in project cuba by cuba-platform.
the class ExecutionsTest method testExceptionOnUserSession.
@Test
public void testExceptionOnUserSession() {
Executions executions = AppBeans.get(Executions.NAME);
executions.startExecution("key", "group");
UserSessionSource userSessionSource = AppBeans.get(UserSessionSource.NAME);
try {
((TestUserSessionSource) userSessionSource).setExceptionOnGetUserSession(true);
} finally {
try {
executions.endExecution();
} catch (Exception e) {
// Do nothing
}
}
assertNull(ExecutionContextHolder.getCurrentContext());
((TestUserSessionSource) userSessionSource).setExceptionOnGetUserSession(false);
executions.startExecution("key", "group");
try {
executions.endExecution();
} catch (Exception e) {
// Do nothing
}
assertNull(ExecutionContextHolder.getCurrentContext());
}
Aggregations