Package com.foreach.across.core

Examples of com.foreach.across.core.AcrossContext.bootstrap()


    }

    context.addModule( new TestModule( "one" ) );
    context.addModule( new TestModule( "two" ) );

    context.bootstrap();

    return context;
  }

  protected static class TestModule extends AcrossModule
View Full Code Here


  private AcrossContext createContext() {
    AcrossContext context = new AcrossContext();
    context.setDataSource( uniqueDataSource() );

    context.bootstrap();

    return context;
  }

  private DataSource uniqueDataSource() {
View Full Code Here

    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    across.addModule( moduleOne );
    across.addModule( moduleTwo );

    across.bootstrap();

    AbstractApplicationContext acrossApplicationContext = AcrossContextUtils.getApplicationContext( across );
    ConfigurableListableBeanFactory acrossFactory = AcrossContextUtils.getBeanFactory( across );
    ConfigurableListableBeanFactory moduleOneFactory = AcrossContextUtils.getBeanFactory( moduleOne );
    ConfigurableListableBeanFactory moduleTwoFactory = AcrossContextUtils.getBeanFactory( moduleTwo );
View Full Code Here

    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    across.addModule( moduleOne );
    across.addModule( moduleTwo );

    across.bootstrap();

    AbstractApplicationContext acrossApplicationContext = AcrossContextUtils.getApplicationContext( across );
    ConfigurableListableBeanFactory acrossFactory = AcrossContextUtils.getBeanFactory( across );
    ConfigurableListableBeanFactory moduleOneFactory = AcrossContextUtils.getBeanFactory( moduleOne );
    ConfigurableListableBeanFactory moduleTwoFactory = AcrossContextUtils.getBeanFactory( moduleTwo );
View Full Code Here

    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    across.addModule( moduleOne );
    across.addModule( moduleTwo );

    across.bootstrap();

    AbstractApplicationContext acrossApplicationContext = AcrossContextUtils.getApplicationContext( across );
    ConfigurableListableBeanFactory acrossFactory = AcrossContextUtils.getBeanFactory( across );
    ConfigurableListableBeanFactory moduleOneFactory = AcrossContextUtils.getBeanFactory( moduleOne );
    ConfigurableListableBeanFactory moduleTwoFactory = AcrossContextUtils.getBeanFactory( moduleTwo );
View Full Code Here

    NamingModule lastModule = new NamingModule( "LastModule" );

    AcrossContext context = new AcrossContext();
    context.addModule( firstModule );
    context.addModule( lastModule );
    context.bootstrap();

    NamingConfig first = AcrossContextUtils.getApplicationContext( firstModule ).getBean( NamingConfig.class );
    assertSame( context, first.getAutoAcrossContext() );
    assertSame( context, first.getSpecificAcrossContext() );
    assertSame( firstModule, first.getCurrentModule() );
View Full Code Here

  public void beansShouldBeReturnedInTheRegisteredOrderOfTheModules() {
    AcrossContext context = new AcrossContext();
    context.addModule( new ModuleOne() );
    context.addModule( new ModuleTwo() );
    context.addModule( new ModuleThree() );
    context.bootstrap();

    AcrossContextBeanRegistry registry = AcrossContextUtils.getBeanRegistry( context );
    List<MyBeanConfig> beans = registry.getBeansOfType( MyBeanConfig.class );
    assertTrue( beans.isEmpty() );
View Full Code Here

  public void internalGenericBeanResolving() {
    AcrossContext context = new AcrossContext();
    context.addModule( new ModuleOne() );
    context.addModule( new ModuleTwo() );
    context.addModule( new ModuleThree() );
    context.bootstrap();

    AcrossContextBeanRegistry registry = AcrossContextUtils.getBeanRegistry( context );
    List<GenericBean> beans = registry.getBeansOfType( GenericBean.class, true );

    assertEquals( 6, beans.size() );
View Full Code Here

  @Test
  public void refreshableCollectionTesting() {
    AcrossContext context = new AcrossContext();
    context.addModule( new ModuleOne() );
    context.addModule( new ModuleTwo() );
    context.bootstrap();

    AcrossContextBeanRegistry registry = AcrossContextUtils.getBeanRegistry( context );
    MyBeanConfig one = registry.getBeanOfTypeFromModule( "ModuleOne", MyBeanConfig.class );
    MyBeanConfig two = registry.getBeanOfTypeFromModule( "ModuleTwo", MyBeanConfig.class );
View Full Code Here

    context.addModule( moduleTwo );

    ModuleThree moduleThree = new ModuleThree();
    context.addModule( moduleThree );

    context.bootstrap();

    AcrossContextBeanRegistry registry = AcrossContextUtils.getBeanRegistry( context );
    List<MyBeanConfig> beans = registry.getBeansOfType( MyBeanConfig.class, true );
    assertEquals( 3, beans.size() );
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.