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

Examples of org.pentaho.platform.engine.core.system.objfac.AggregateObjectFactory


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

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory );

    GoodObject info = aggFactory.get( GoodObject.class, "GoodObject", session );
    assertNotNull( info );
  }
View Full Code Here


    StandaloneObjectFactory factory3 = new StandaloneObjectFactory();
    factory3.init( null, null );
    factory3.defineObject( "MimeTypeListener", MimeTypeListener.class.getName(),
      IPentahoDefinableObjectFactory.Scope.GLOBAL );

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory3 );
    aggFactory.registerObjectFactory( factory2 );
    aggFactory.registerObjectFactory( factory );

    List<MimeTypeListener> mimes = aggFactory.getAll( MimeTypeListener.class, session );
    assertEquals( 11, mimes.size() );

  }
View Full Code Here

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

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory );

    MimeTypeListener info =
      aggFactory.get( MimeTypeListener.class, session, Collections.singletonMap( "id", "someID" ) );
    assertNotNull( info );

  }
View Full Code Here

    factory.init( null, context );

    StandaloneSpringPentahoObjectFactory factory2 = new StandaloneSpringPentahoObjectFactory();
    factory2.init( null, context );

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory );
    aggFactory.registerObjectFactory( factory2 );

    List<MimeTypeListener> mimes = aggFactory.getAll( MimeTypeListener.class, session );
    assertEquals( 5, mimes.size() );
  }
View Full Code Here

      new FileSystemXmlApplicationContext( "test-res/solution/system/registeredButNotPublishing.spring.xml" );

    // this was causing an exception.
    factory.init( null, context );

    AggregateObjectFactory aggFactory = new AggregateObjectFactory();
    aggFactory.registerObjectFactory( factory );
    assertEquals( 0, PublishedBeanRegistry.getRegisteredFactories().size() );

  }
View Full Code Here

*/
public class PentahoOSGIActivatorTest {

  @Test
  public void testActivation() throws Exception {
    AggregateObjectFactory agg = (AggregateObjectFactory) PentahoSystem.getObjectFactory();
    int originalSize = agg.getFactories().size();
    BundleContext context = Mockito.mock( BundleContext.class );
    PentahoOSGIActivator activator = new PentahoOSGIActivator();
    activator.setBundleContext( context );
    assertEquals( 1, agg.getFactories().size() - originalSize );
//    assertTrue( agg.getFactories()
//      .toArray( new IPentahoObjectFactory[ agg.getFactories().size() ] )[ 1 ] instanceof OSGIObjectFactory );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.core.system.objfac.AggregateObjectFactory

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.