Package com.foreach.across.test.modules.module1

Examples of com.foreach.across.test.modules.module1.SomeInterface


      return context;
    }

    @Bean
    public TestModule1 testModule1() {
      return new TestModule1();
    }
View Full Code Here


public class TestAcrossContext
{
  @Test
  public void getModuleByName() {
    TestModule1 module = new TestModule1();
    ExposingModule other = new ExposingModule( "my module" );

    AcrossContext context = new AcrossContext();
    context.addModule( module );
    context.addModule( other );

    assertNull( context.getModule( "not present" ) );
    assertSame( module, context.getModule( module.getName() ) );
    assertSame( other, context.getModule( "my module" ) );
    assertSame( other, context.getModule( "com.foreach.across.test.modules.exposing.ExposingModule" ) );
  }
View Full Code Here

  @Test
  public void moduleWithTheSameNameIsNotAllowedWhenBootstrapping() {
    AcrossContext context = new AcrossContext();
    context.setInstallerAction( InstallerAction.DISABLED );

    TestModule1 module = new TestModule1();
    context.addModule( module );
    context.addModule( new TestModule2() );
    context.addModule( new ExposingModule( module.getName() ) );

    boolean failed = false;

    try {
      context.bootstrap();
View Full Code Here

  @Test
  public void dataSourceIsNotRequiredIfNoInstallers() {
    AcrossContext context = new AcrossContext();
    context.setInstallerAction( InstallerAction.EXECUTE );
    context.addModule( new TestModule1() );

    context.bootstrap();
  }
View Full Code Here

  @Test
  public void sameModuleIsNotAllowed() {
    AcrossContext context = new AcrossContext();

    TestModule1 duplicate = new TestModule1();

    context.addModule( duplicate );
    context.addModule( new TestModule2() );

    boolean failed = false;
View Full Code Here

    assertTrue( "Adding same module instance should not be allowed", failed );
  }

  @Test
  public void sameModuleCanOnlyBeInOneAcrossContext() {
    TestModule1 module = new TestModule1();

    AcrossContext contextOne = new AcrossContext();
    contextOne.addModule( module );

    AcrossContext contextTwo = new AcrossContext();
View Full Code Here

        SomeSubClassInAnotherPackage.pleaseCallm(new SomeSubSubClassInAnotherPackage()));

    assertEquals("ClassExposingM",
        aCaller.callPackagePrivatem(new ClassExposingM()));

    SomeInterface i = new ClassExposingM();
    assertEquals("ClassExposingM", i.m());
    assertEquals("live at ClassExposingM", new ClassExposingM().f());

    // Confirm that both calling m through SomeInterface and through SomeParentParentParent
    // dispatch to the right implementation.
    SomeInterface i1 = new SubClassExposingM();
    assertEquals("SubClassExposingM", i1.m());

    assertEquals("SubClassExposingM",
        SomeParentParentParent.callSomeParentParentParentM(new SubClassExposingM()));

    assertEquals("SomeParentParentParent",
View Full Code Here

TOP

Related Classes of com.foreach.across.test.modules.module1.SomeInterface

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.