Package com.google.common.testing

Examples of com.google.common.testing.TearDown


        final com.google.inject.testing.guiceberry.TestScopeListener instance,
        final TearDownAccepter tearDownAccepter) {
      return new TestWrapper() {

        public void toRunBeforeTest() {
          tearDownAccepter.addTearDown(new TearDown() {
            public void tearDown() throws Exception {
              instance.exitingScope();
            }
          });
          instance.enteringScope();
View Full Code Here


   
    Injector testInjector = Guice.createInjector(buildTestModule(icMaster));
   
    final MyTestCase injected = testInjector.getInstance(MyTestCase.class);
   
    addTearDown(new TearDown() {
     
      public void tearDown() throws Exception {
        injected.myEnumIc.resetOverride();
      }
    });

    addTearDown(new TearDown() {
     
      public void tearDown() throws Exception {
        injected.myGenericClassOfMyEnumIc.resetOverride();
      }
    });
View Full Code Here

   
    Injector testInjector = Guice.createInjector(buildTestModule(icMaster));
   
    final MyTestCase injected = testInjector.getInstance(MyTestCase.class);
   
    addTearDown(new TearDown() {
     
      public void tearDown() throws Exception {
        injected.myEnumIc.resetOverride();
      }
    });

    addTearDown(new TearDown() {
     
      public void tearDown() throws Exception {
        injected.myGenericClassOfMyEnumIc.resetOverride();
      }
    });
View Full Code Here

    @Provides
    TestWrapper getWrapper(final TearDownAccepter tearDownAccepter) {
     
      return new TestWrapper() {
        public void toRunBeforeTest() {
          tearDownAccepter.addTearDown(new TearDown() {
            public void tearDown() throws Exception {
              beforeTestTearDownHasRun = true;
            }
          });
          throw new RuntimeException("kaboom");
View Full Code Here

    envSelector = DefaultEnvSelector.of(MyEnvOne.class);
    assertEquals(MyEnvTwo.class, envSelector.guiceBerryEnvToUse(null));
  }

  private void override() {
    addTearDown(new TearDown() {
     
      public void tearDown() throws Exception {
        DefaultEnvSelector.clearOverride(MyEnvOne.class);
      }
    });
View Full Code Here

        final TearDownAccepter tearDownAccepter) {
     
      return new TestWrapper() {
       
        public void toRunBeforeTest() {
          tearDownAccepter.addTearDown(new TearDown() {
           
            public void tearDown() throws Exception {
              System.out.println("Ending: " + testId);
            }
          });
View Full Code Here

  public void testWhenDogIsFeatured() {
    Pet expected = Pet.DOG;
    PetStoreModuleWithGlobalStaticOverride.override = expected;
    // register a tearDown, so that at the end of the test,
    // the override is set to null again
    tearDownAccepter.addTearDown(new TearDown() {
      public void tearDown() {
        PetStoreModuleWithGlobalStaticOverride.override = null;
      }
    });
    welcomeTestPage
View Full Code Here

  public void testWhenCatIsFeatured() {
    Pet expected = Pet.CAT;
    PetStoreModuleWithGlobalStaticOverride.override = expected;
    // register a tearDown, so that at the end of the test,
    // the override is set to null again
    tearDownAccepter.addTearDown(new TearDown() {
      public void tearDown() {
        PetStoreModuleWithGlobalStaticOverride.override = null;
      }
    });
    welcomeTestPage
View Full Code Here

  public void testWhenDogIsFeatured() {
    Pet expected = Pet.DOG;
    PetStoreModuleWithGlobalStaticOverride.override = expected;
    // register a tearDown, so that at the end of the test,
    // the override is set to null again
    tearDownAccepter.addTearDown(new TearDown() {
      public void tearDown() {
        PetStoreModuleWithGlobalStaticOverride.override = null;
      }
    });
    welcomeTestPage
View Full Code Here

  public void testWhenCatIsFeatured() {
    Pet expected = Pet.CAT;
    PetStoreModuleWithGlobalStaticOverride.override = expected;
    // register a tearDown, so that at the end of the test,
    // the override is set to null again
    tearDownAccepter.addTearDown(new TearDown() {
      public void tearDown() {
        PetStoreModuleWithGlobalStaticOverride.override = null;
      }
    });
    welcomeTestPage
View Full Code Here

TOP

Related Classes of com.google.common.testing.TearDown

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.