Package com.google.common.testing

Examples of com.google.common.testing.TearDown


    storageUtil = new StorageTestUtil(this);
    storageUtil.expectOperations();
    backoffStrategy = createMock(BackoffStrategy.class);
    final ScheduledExecutorService executorMock = createMock(ScheduledExecutorService.class);
    clock = FakeScheduledExecutor.scheduleExecutor(executorMock);
    addTearDown(new TearDown() {
      @Override
      public void tearDown() {
        clock.assertEmpty();
      }
    });
View Full Code Here


  private abstract class RegisteredFixture {
    private final AtomicBoolean runCalled = new AtomicBoolean(false);

    RegisteredFixture() throws Exception {
      // Prevent otherwise silent noop tests that forget to call run().
      addTearDown(new TearDown() {
        @Override
        public void tearDown() {
          assertTrue(runCalled.get());
        }
      });
View Full Code Here

  public void setUp() {
    driver = createMock(Driver.class);
    ScheduledExecutorService executorMock = createMock(ScheduledExecutorService.class);
    clock = FakeScheduledExecutor.scheduleExecutor(executorMock);

    addTearDown(new TearDown() {
      @Override
      public void tearDown() throws Exception {
        clock.assertEmpty();
      }
    });
View Full Code Here

  protected void replayAndStart() {
    control.replay();

    final ShutdownRegistryImpl shutdownRegistry = injector.getInstance(ShutdownRegistryImpl.class);
    addTearDown(new TearDown() {
      @Override
      public void tearDown() {
        shutdownRegistry.execute();
      }
    });
View Full Code Here

  @Before
  public void setUp() {
    executor = Executors.newCachedThreadPool(
        new ThreadFactoryBuilder().setNameFormat("SlowRead-%d").setDaemon(true).build());
    addTearDown(new TearDown() {
      @Override
      public void tearDown() {
        new ExecutorServiceShutdown(executor, Amount.of(1L, Time.SECONDS)).execute();
      }
    });
View Full Code Here

  abstract class StorageTestFixture {
    private final AtomicBoolean runCalled = new AtomicBoolean(false);

    StorageTestFixture() {
      // Prevent otherwise silent noop tests that forget to call run().
      addTearDown(new TearDown() {
        @Override
        public void tearDown() {
          assertTrue(runCalled.get());
        }
      });
View Full Code Here

          }
          final IcStrategy.ClientSupport icClientStrategy =
            clientControllerSupportProvider.get();
          final ControllableId<T> controllableId =
            new ControllableId<T>(testIdProvider.get(), key);
          tearDownAccepterProvider.get().addTearDown(new TearDown() {
            public void tearDown() throws Exception {
              icClientStrategy.resetOverride(controllableId);
            }
          });
          icClientStrategy.setOverride(controllableId, override);
View Full Code Here

      GuiceBerryEnvSelector guiceBerryEnvSelector) {
    final GuiceBerryWrapper setUpAndTearDown =
      GuiceBerry.INSTANCE.buildWrapper(buildTestDescription(testCase, testCase.getName()),
          guiceBerryEnvSelector);
    setUpAndTearDown.runBeforeTest();
    return new TearDown() {
     
      public void tearDown() throws Exception {
        setUpAndTearDown.runAfterTest();
      }
    };
View Full Code Here

      GuiceBerryEnvSelector guiceBerryEnvSelector) {
    final GuiceBerryWrapper toTearDown =
      GuiceBerry.INSTANCE.buildWrapper(
          ManualTearDownGuiceBerry.buildTestDescription(testCase, testCase.getName()),
          guiceBerryEnvSelector);
    testCase.addTearDown(new TearDown() {
     
      public void tearDown() throws Exception {
        toTearDown.runAfterTest();
      }
    })  ;
View Full Code Here

        guiceBerryEnvSelector.guiceBerryEnvToUse(testDescription);
     
      universe.currentTestDescriptionThreadLocal.set(testDescription);
      injector = getAndSetInjector(gbeClass);

      stack.addTearDown(new TearDown() {
        public void tearDown() throws Exception {
          doTearDown();
        }
      });
     
      stack.addTearDown(new TearDown() {
        public void tearDown() throws Exception {
          ToTearDown toTearDown = injector.getInstance(ToTearDown.class);
          toTearDown.runTearDown();
        }
      });
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.