Search in sources :

Example 6 with UserSession

use of org.pentaho.platform.engine.core.system.UserSession in project pentaho-platform by pentaho.

the class SessionIT method testUserSessionWithOutAuthentication.

public void testUserSessionWithOutAuthentication() {
    startTest();
    SimpleParameterProvider parameters = new SimpleParameterProvider();
    // $NON-NLS-1$ //$NON-NLS-2$
    parameters.setParameter("actionname", "ViewAction");
    // $NON-NLS-1$
    UserSession usession = new UserSession("Admin", Locale.US, parameters);
    Log log = usession.getLogger();
    usession.setActionName("ViewAction");
    usession.doStartupActions(parameters);
    // $NON-NLS-1$
    log.info("Session is active");
    // $NON-NLS-1$
    assertEquals(usession.getActionName(), "ViewAction");
    finishTest();
}
Also used : Log(org.apache.commons.logging.Log) UserSession(org.pentaho.platform.engine.core.system.UserSession) SimpleParameterProvider(org.pentaho.platform.engine.core.solution.SimpleParameterProvider)

Aggregations

UserSession (org.pentaho.platform.engine.core.system.UserSession)6 SimpleParameterProvider (org.pentaho.platform.engine.core.solution.SimpleParameterProvider)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ITenant (org.pentaho.platform.api.mt.ITenant)2 Authentication (org.springframework.security.core.Authentication)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 Locale (java.util.Locale)1 Log (org.apache.commons.logging.Log)1 SubActionAction (org.pentaho.actionsequence.dom.actions.SubActionAction)1 IActionParameter (org.pentaho.platform.api.engine.IActionParameter)1 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)1 ISolutionEngine (org.pentaho.platform.api.engine.ISolutionEngine)1 ITenantedPrincipleNameResolver (org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver)1 SimpleOutputHandler (org.pentaho.platform.engine.core.output.SimpleOutputHandler)1 PentahoSessionParameterProvider (org.pentaho.platform.engine.core.solution.PentahoSessionParameterProvider)1 StandaloneSession (org.pentaho.platform.engine.core.system.StandaloneSession)1 BaseRequestHandler (org.pentaho.platform.engine.services.BaseRequestHandler)1