Examples of PowerMockTestListener


Examples of org.powermock.core.spi.PowerMockTestListener

  /**
   * {@inheritDoc}
   */
  public void notifyAfterTestMethod(Object testInstance, Method method, Object[] arguments, TestMethodResult testResult) {
    for (int i = 0; i < powerMockTestListeners.length; i++) {
      final PowerMockTestListener testListener = powerMockTestListeners[i];
      try {
        testListener.afterTestMethod(testInstance, method, arguments, testResult);
      } catch (Exception e) {
        throw new RuntimeException(String.format(ERROR_MESSAGE_TEMPLATE, "afterTestMethod", testListener), e);
      }
    }
  }
View Full Code Here

Examples of org.powermock.core.spi.PowerMockTestListener

  public void notifyBeforeTestMethod(Object testInstance, Method testMethod, Object[] arguments) {
    MockRepository.putAdditionalState(Keys.CURRENT_TEST_INSTANCE, testInstance);
    MockRepository.putAdditionalState(Keys.CURRENT_TEST_METHOD, testMethod);
    MockRepository.putAdditionalState(Keys.CURRENT_TEST_METHOD_ARGUMENTS, arguments);
    for (int i = 0; i < powerMockTestListeners.length; i++) {
      final PowerMockTestListener testListener = powerMockTestListeners[i];
      try {
        testListener.beforeTestMethod(testInstance, testMethod, arguments);
      } catch (Exception e) {
        throw new RuntimeException(String.format(ERROR_MESSAGE_TEMPLATE, "beforeTestMethod", testListener), e);
      }
    }
  }
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.