Package org.pentaho.platform.engine.core.system

Examples of org.pentaho.platform.engine.core.system.StandaloneSession


  private IRuntimeContext context;

  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks( this );
    session = new StandaloneSession( SESSION_NAME );
    factory = new StandaloneObjectFactory();
    PentahoSystem.registerObjectFactory( factory );
    factory.defineObject( IAuditEntry.class.getSimpleName(), TestAuditEntry.class.getName(),
        StandaloneObjectFactory.Scope.GLOBAL );
  }
View Full Code Here


  }

  @Test
  public void testGetWInitializer() throws Exception {

    StandaloneSession session = new StandaloneSession();
    BundleContext mockContext = Mockito.mock( BundleContext.class );

    ServiceReference<IPentahoInitializer> ref = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( IPentahoInitializer.class, null ) )
View Full Code Here


  @Test
  public void testGetAll() throws Exception {

    StandaloneSession session = new StandaloneSession();
    BundleContext mockContext = Mockito.mock( BundleContext.class );
    ServiceReference<String> ref = Mockito.mock( ServiceReference.class );
    ServiceReference<String> ref2 = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, null ) ).thenReturn( Arrays.asList( ref, ref2 ) );
View Full Code Here

  }

  @Test
  public void testGetObjectReference() throws Exception {

    StandaloneSession session = new StandaloneSession();
    BundleContext mockContext = Mockito.mock( BundleContext.class );
    ServiceReference<String> ref = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, null ) ).thenReturn( Collections.singletonList( ref ) );
    when( mockContext.getServiceReferences( Integer.class, null ) )
View Full Code Here

  }

  @Test
  public void testGetObjectReferenceWithQuery() throws Exception {

    StandaloneSession session = new StandaloneSession();
    BundleContext mockContext = Mockito.mock( BundleContext.class );
    ServiceReference<String> ref = Mockito.mock( ServiceReference.class );
    ServiceReference<String> ref2 = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, "(&(name=foo))" ) )
View Full Code Here

  }

  @Test
  public void testGetObjectReferencesWithQuery() throws Exception {

    StandaloneSession session = new StandaloneSession();
    BundleContext mockContext = Mockito.mock( BundleContext.class );

    ServiceReference<String> ref = (ServiceReference<String>) Mockito.mock( ServiceReference.class );
    ServiceReference<String> ref2 = Mockito.mock( ServiceReference.class );
View Full Code Here

public class OSGIBootTest {
  @Test
  public void testStartup() throws Exception {
    PentahoSystem.setApplicationContext( new StandaloneApplicationContext( "test-res/osgiSystem", "test-res/osgiSystem" ) );
    OSGIBoot boot = new OSGIBoot();
    boot.startup( new StandaloneSession() );
    assertEquals( org.osgi.framework.Bundle.ACTIVE, boot.framework.getState() );
  }
View Full Code Here

  public void testSolutionPublish() {
    startTest();

    SolutionPublisher publisher = new SolutionPublisher();
    publisher.setLoggingLevel( getLoggingLevel() );
    StandaloneSession session =
        new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) ); //$NON-NLS-1$
    String result = publisher.publish( session, getLoggingLevel() );
    assertEquals( Messages.getInstance().getString( "SolutionPublisher.USER_SOLUTION_REPOSITORY_UPDATED" ), result );
    finishTest();
  }
View Full Code Here

      }
    }

    SolutionPublisher publisher = new SolutionPublisher();
    publisher.setLoggingLevel( getLoggingLevel() );
    StandaloneSession session =
        new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) );
    String result = publisher.publish( session, getLoggingLevel() );
    assertEquals( Messages.getInstance().getString( "SolutionPublisher.USER_SOLUTION_REPOSITORY_UPDATED" ), result );
    // now set the locale back again
    LocaleHelper.setLocale( tmpLocale );
    finishTest();
View Full Code Here

@SuppressWarnings( { "all" } )
public class StandaloneSpringPentahoObjectFactoryTest extends TestCase {

  public void testInitFromXml() throws Exception {

    StandaloneSession session = new StandaloneSession();
    StandaloneSession session2 = new StandaloneSession();

    StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
    factory.init( "test-res/solution/system/pentahoObjects.spring.xml", null );

    GoodObject goodObject = factory.get( GoodObject.class, session );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.core.system.StandaloneSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.