Package com.foreach.across.core

Examples of com.foreach.across.core.EmptyAcrossModule


  public void destroyAcrossContextDirectly() {
    AcrossContext across = new AcrossContext();
    across.setInstallerAction( InstallerAction.DISABLED );
    across.setDataSource( mock( DataSource.class ) );

    AcrossModule moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleOne.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    AcrossModule moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

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

    across.bootstrap();
View Full Code Here


    AcrossContext across = new AcrossContext( parent );
    across.setInstallerAction( InstallerAction.DISABLED );
    across.setDataSource( mock( DataSource.class ) );

    AcrossModule moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleOne.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    AcrossModule moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

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

    across.bootstrap();
View Full Code Here

    across.setDataSource( mock( DataSource.class ) );

    // AcrossContext configuration is bean in the parent and should be destroyed
    ( (DefaultListableBeanFactory) parent.getBeanFactory() ).registerDisposableBean( "acrossContext", across );

    AcrossModule moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleOne.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

    AcrossModule moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleTwo.addApplicationContextConfigurer( new AnnotatedClassConfigurer( Config.class ) );

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

    across.bootstrap();
View Full Code Here

      context.addModule( new AcrossWebModule() );
      context.addModule( testModule() );
    }

    private AcrossModule testModule() {
      AcrossModule module = new EmptyAcrossModule( "TestModule" );
      module.addApplicationContextConfigurer( ComponentConfig.class );

      return module;
    }
View Full Code Here

  private AcrossModule moduleOne, moduleTwo, moduleThree, moduleFour;

  @Before
  public void prepareContextAndModules() {
    context = new AcrossContext();
    moduleOne = new EmptyAcrossModule( "moduleOne" );
    moduleTwo = new EmptyAcrossModule( "moduleTwo" );
    moduleThree = new EmptyAcrossModule( "moduleThree" );
    moduleFour = new EmptyAcrossModule( "moduleFour" );
  }
View Full Code Here

    order( added );
  }

  @Test
  public void emptyAcrossModuleForDependencySatisfying() {
    EmptyAcrossModule fakeTwo = new EmptyAcrossModule( two.getName() );

    Collection<AcrossModule> added = list( one, requiresTwo, fakeTwo );
    Collection<AcrossModule> ordered = order( added );

    assertEquals( list( one, fakeTwo, requiresTwo ), ordered );
View Full Code Here

    assertEquals( list( one, fakeTwo, requiresTwo ), ordered );
  }

  @Test
  public void complexRuntimeDependencies() {
    EmptyAcrossModule one = new EmptyAcrossModule( "one" );

    EmptyAcrossModule two = new EmptyAcrossModule( "two" );
    two.addRuntimeDependency( "five" );

    EmptyAcrossModule three = new EmptyAcrossModule( "three" );
    three.addRuntimeDependency( "one" );
    three.addRuntimeDependency( "six" );

    EmptyAcrossModule four = new EmptyAcrossModule( "four" );
    four.addRuntimeDependency( "three" );

    EmptyAcrossModule five = new EmptyAcrossModule( "five" );
    five.addRuntimeDependency( "three" );
    five.addRuntimeDependency( "four" );

    EmptyAcrossModule six = new EmptyAcrossModule( "six" );
    six.addRuntimeDependency( "one" );

    Collection<AcrossModule> added = list( one, two, three, four, five, six );
    Collection<AcrossModule> ordered = order( added );

    assertEquals( list( one, six, three, four, five, two ), ordered );
View Full Code Here

TOP

Related Classes of com.foreach.across.core.EmptyAcrossModule

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.