Package com.google.guiceberry

Examples of com.google.guiceberry.TestScope


   * Builds a new instance of a {@link TestScope}.
   */
  // TODO: this will be unnecessary once this issue is fixed:
  // http://code.google.com/p/google-guice/issues/detail?id=687
  public Scope buildTestScope() {
    return new TestScope(universe);
  }
View Full Code Here


    this.universe = universe;
  }
 
  @Override
  protected void configure() {
    TestScope testScope = new TestScope(universe);
    bind(TestScope.class).toInstance(testScope);
    bindScope(TestScoped.class, testScope);
    bind(TearDownAccepter.class).to(ToTearDown.class);
  }
View Full Code Here

   
    assertNull(
      currentUniverse.gbeClassToInjectorMap.get(
        Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE)));
    guiceBerryJunit3.doSetUp(test);
    TestScope testScope =
      currentUniverse.gbeClassToInjectorMap.get(
        Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE))
        .getInstance(TestScope.class);
    assertNotNull(testScope);
 
View Full Code Here

    TestWithGbeOne testOne = TestWithGbeOne.createInstance();
    assertNull(
        getTestScopeForGbe(
            Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE)));
    guiceBerryJunit3.doSetUp(testOne);
    TestScope testScopeOne =
      getTestScopeForGbe(
          Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE));
    assertNotNull(testScopeOne);
   
    testOne.run();
  
    AnotherTestWithGbeOne testTwo =
      AnotherTestWithGbeOne.createInstance();
    guiceBerryJunit3.doSetUp(testTwo);
    assertNotNull(getTestScopeForGbe(
        Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE)));
   
    TestScope testScopeTwo =
      getTestScopeForGbe(
          Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE));
    assertSame(testScopeOne, testScopeTwo);
    assertEquals(1, currentUniverse.gbeClassToInjectorMap.size());
 
View Full Code Here

    TestWithGbeOne testOne = TestWithGbeOne.createInstance();
  
    assertNull(getTestScopeForGbe(
        Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE)));
    guiceBerryJunit3.doSetUp(testOne);
    TestScope testScopeOne =
      getTestScopeForGbe(
          Class.forName(GuiceBerryEnvOne.GUICE_BERRY_ENV_ONE));
    assertNotNull(testScopeOne);
 
    testOne.run();
   
    TestWithGbeTwo testTwo = TestWithGbeTwo.createInstance();
    guiceBerryJunit3.doSetUp(testTwo);
    assertNotNull(getTestScopeForGbe(
        Class.forName(GuiceBerryEnvTwo.GUICE_BERRY_ENV_TWO)));
    TestScope testScopeTwo =
      getTestScopeForGbe(
          Class.forName(GuiceBerryEnvTwo.GUICE_BERRY_ENV_TWO));
   
    assertNotSame(testScopeOne, testScopeTwo);
  }
View Full Code Here

TOP

Related Classes of com.google.guiceberry.TestScope

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.