Examples of GuiceBerryWrapper


Examples of com.google.guiceberry.GuiceBerry.GuiceBerryWrapper

   * @see #setUp(TestCase, Class)
   */
  public static TearDown setUp(
      TestCase testCase,
      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

Examples of com.google.guiceberry.GuiceBerry.GuiceBerryWrapper

   * @see #setUp(TestCase, Class)
   */
  public static <T extends TestCase & TearDownAccepter> void setUp(
      /* TeaDownTestCase */ T testCase,
      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();
      }
    })  ;
    toTearDown.runBeforeTest();
  }
View Full Code Here

Examples of com.google.guiceberry.GuiceBerry.GuiceBerryWrapper

  public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
    return new Statement() {
     
      @Override
      public void evaluate() throws Throwable {
        final GuiceBerryWrapper setupAndTearDown =
          GuiceBerry.INSTANCE.buildWrapper(buildTestDescription(target, method.getName()), guiceBerryEnvSelector);
        try {
          setupAndTearDown.runBeforeTest();
          base.evaluate();
        } finally {
          setupAndTearDown.runAfterTest();
        }
      }
    };
  }
View Full Code Here

Examples of com.google.guiceberry.GuiceBerry.GuiceBerryWrapper

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

Examples of com.google.guiceberry.GuiceBerry.GuiceBerryWrapper

  public synchronized void doSetUp(final TestCase testCase) {
   
    TestDescription testDescription = buildDescription(testCase);

    final GuiceBerryWrapper wrapper = guiceBerry.buildWrapper(testDescription,
        new VersionTwoBackwardsCompatibleGuiceBerryEnvSelector());

    //add a tear down before setting up so that if an exception is thrown there,
    //we still do the tear down.
    maybeAddGuiceBerryTearDown(testDescription, new TearDown() {
     
      public void tearDown() throws Exception {
        wrapper.runAfterTest();
      }
    });
   
    wrapper.runBeforeTest();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.