Examples of defineObject()


Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testLocalObjectFail1() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), "bogus", Scope.LOCAL ); //$NON-NLS-1$ 

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$

    try {
      factory.get( Object1.class, session1 );
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testThreadObject1() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), Object1.class.getName(), Scope.THREAD );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$

    Object1 obj1 = factory.get( Object1.class, session1 );
    assertNotNull( "Object is null", obj1 ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testThreadObject2() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object2.class.getSimpleName(), Object2.class.getName(), Scope.THREAD );

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$

    Object2 obj1 = factory.get( Object2.class, session1 );
    assertNotNull( "Object is null", obj1 ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void testThreadObjectFail1() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    factory.defineObject( Object1.class.getSimpleName(), "bogus", Scope.THREAD ); //$NON-NLS-1$

    IPentahoSession session1 = new StandaloneSession( "test user 1" ); //$NON-NLS-1$

    try {
      factory.get( Object1.class, session1 );
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

  public void test1() throws Exception {

    StandaloneObjectFactory factory = new StandaloneObjectFactory();

    TestOutputHandler.contentItem = new SimpleContentItem();
    factory.defineObject( "testoutut", TestOutputHandler.class.getName(), StandaloneObjectFactory.Scope.LOCAL );
    PentahoSystem.registerObjectFactory( factory );

    StandaloneSession session = new StandaloneSession();

    ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

    OutputStream out = new ByteArrayOutputStream();
    TestOutputHandler.contentItem = new SimpleContentItem( out );
    SimpleOutputHandler handler = new SimpleOutputHandler( out, false );

    StandaloneObjectFactory factory = new StandaloneObjectFactory();
    factory.defineObject( "contentrepo", TestOutputHandler.class.getName(), StandaloneObjectFactory.Scope.GLOBAL );
    PentahoSystem.registerObjectFactory( factory );

    IContentItem contentItem = handler.getOutputContentItem( "contentrepo", "myreport:contentrepo", null, null );
    assertNotNull( contentItem );
    assertEquals( out, contentItem.getOutputStream( null ) );
View Full Code Here

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory.defineObject()

    // this should not complain
    AuditEntry.auditJobDuration( jobId, instId, objId, objType, actor, messageType, messageName, messageTxtValue,
        duration );

    TestOutputHandler.contentItem = new SimpleContentItem();
    factory.defineObject( IAuditEntry.class.getSimpleName(), TestAuditEntry.class.getName(),
        StandaloneObjectFactory.Scope.GLOBAL );

    // this should not complain
    AuditEntry.auditJobDuration( jobId, instId, objId, objType, actor, messageType, messageName, messageTxtValue,
        duration );
View Full Code Here

Examples of org.pentaho.test.platform.engine.core.SimpleObjectFactory.defineObject()

    }
  }

  public void testCannotCreateCache() throws Exception {
    SimpleObjectFactory factory = new SimpleObjectFactory();
    factory.defineObject( "ICacheManager", MockDisabledCacheManager.class.getName() ); //$NON-NLS-1$
    // Swap in an object factory with a cache manager that doesn't allow creating new caches

    Set<IPentahoObjectFactory> facts = ( (AggregateObjectFactory) PentahoSystem.getObjectFactory() ).getFactories();
    PentahoSystem.clearObjectFactory();
    PentahoSystem.registerObjectFactory( factory );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.