&& PentahoSessionHolder.getSession().isAuthenticated() ) { if ( inProcess() ) {
@Test public void testSessionStartup() throws ObjectFactoryException { int oldLogLevel = Logger.getLogLevel(); Logger.setLogLevel( ILogger.TRACE ); final ISolutionEngine engine = mock( ISolutionEngine.class ); pentahoObjectFactory = mock( IPentahoObjectFactory.class ); when( pentahoObjectFactory.objectDefined( anyString() ) ).thenReturn( true ); when( pentahoObjectFactory.get( this.anyClass(), anyString(), any( IPentahoSession.class ) ) ).thenAnswer( new Answer<Object>() { @Override public ISolutionEngine answer( InvocationOnMock invocation ) throws Throwable { return engine; } } ); PentahoSystem.registerObjectFactory( pentahoObjectFactory ); ISessionStartupAction action = mock( ISessionStartupAction.class ); when( action.getActionOutputScope() ).thenReturn( PentahoSystem.SCOPE_SESSION ); when( action.getSessionType() ).thenReturn( session.getClass().getName() ); when( session.isAuthenticated() ).thenReturn( true ); PentahoSystem.setSessionStartupActions( Arrays.asList( action ) ); PentahoSystem.sessionStartup( session, null ); System.out.flush(); assertNotNull( baos ); assertTrue( baos.toString().contains( "Process session startup actions" ) ); Logger.setLogLevel( oldLogLevel ); } /**
if ( !session.isAuthenticated() ) { return;