当前位置: 首页>>代码示例>>Java>>正文


Java IHookCallBack类代码示例

本文整理汇总了Java中org.testng.IHookCallBack的典型用法代码示例。如果您正苦于以下问题:Java IHookCallBack类的具体用法?Java IHookCallBack怎么用?Java IHookCallBack使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IHookCallBack类属于org.testng包,在下文中一共展示了IHookCallBack类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.testng.IHookCallBack; //导入依赖的package包/类
/**
 * Delegates to the {@link IHookCallBack#runTestMethod(ITestResult) test
 * method} in the supplied {@code callback} to execute the actual test
 * and then tracks the exception thrown during test execution, if any.
 *
 * @see org.testng.IHookable#run(org.testng.IHookCallBack,
 * org.testng.ITestResult)
 */
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
	callBack.runTestMethod(testResult);

	Throwable testResultException = testResult.getThrowable();
	if (testResultException instanceof InvocationTargetException) {
		testResultException = ((InvocationTargetException) testResultException).getCause();
	}
	this.testException = testResultException;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:19,代码来源:AbstractTestNGSpringContextTests.java

示例2: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
    super.run(callBack, testResult);
    if (testResult.getThrowable() != null) {
        try {
            final Throwable testResultThrowable = testResult.getThrowable();
            String message = testResultThrowable.getMessage() != null ? testResultThrowable.getMessage() :
                    testResultThrowable.getCause().getMessage();

            if (message == null) {
                message = "Test failed";
            }

            new Screenshoter().takeScreenshot(message, TestUtils.getTestName(testResult));
        } catch (Exception e) {
            log("Couldn't take screenshot. Error: " + e.getMessage());
        }
    }
}
 
开发者ID:WileyLabs,项目名称:teasy,代码行数:20,代码来源:AbstractSeleniumTest.java

示例3: run

import org.testng.IHookCallBack; //导入依赖的package包/类
/**
 * 测试方法拦截器、所有测试方法在执行开始、执行中、执行完成都会在此方法中完成
 * @param callBack
 * @param testResult
 */
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
    // 如果测试方法上有@Ignore注解,则跳过测试框架直接执行测试方法
    if (isIgnoreAnnotation(getTestMethod(testResult))) {
        callBack.runTestMethod(testResult);
    }
}
 
开发者ID:DreamYa0,项目名称:zeratul,代码行数:13,代码来源:AbstractDubbo.java

示例4: run

import org.testng.IHookCallBack; //导入依赖的package包/类
/**
 * Delegates to the {@link IHookCallBack#runTestMethod(ITestResult) test
 * method} in the supplied {@code callback} to execute the actual test
 * and then tracks the exception thrown during test execution, if any.
 *
 * @see org.testng.IHookable#run(org.testng.IHookCallBack,
 * org.testng.ITestResult)
 */
public void run(IHookCallBack callBack, ITestResult testResult) {
	callBack.runTestMethod(testResult);

	Throwable testResultException = testResult.getThrowable();
	if (testResultException instanceof InvocationTargetException) {
		testResultException = ((InvocationTargetException) testResultException).getCause();
	}
	this.testException = testResultException;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:18,代码来源:AbstractTestNGSpringContextTests.java

示例5: prepareTest

import org.testng.IHookCallBack; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void prepareTest(IHookCallBack callBack, ITestResult testResult) {
    Optional<Map<String, Object>> paramOptional = ofNullable(getParameters(testResult));
    Map<String, Object> param;
    if (paramOptional.isPresent()) {
        param = paramOptional.get();
    } else {
        throw new ParameterException("---------------获取测试入参失败!---------------");
    }
    Class<T> clazz = (Class<T>) getInterfaceClass(this);
}
 
开发者ID:DreamYa0,项目名称:zeratul,代码行数:12,代码来源:AbstractDubbo.java

示例6: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
    long time = System.currentTimeMillis();
    LOGGER.info("###>>> run start");
    super.run(callBack, testResult);
    LOGGER.info("###>>> run end ({}ms)", new Object[]{(System.currentTimeMillis() - time)});
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:AbstractConfiguredModelIntegrationTest.java

示例7: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(final IHookCallBack callBack,
                final ITestResult testResult) {

    try {
        injectTestResult(testResult);
    } catch (final ReflectiveOperationException roe) {
        testResult.setThrowable(roe);
        return;
    }

    callBack.runTestMethod(testResult);
}
 
开发者ID:jinahya,项目名称:dagger-testng,代码行数:14,代码来源:DaggerTestNGListener.java

示例8: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack callback, ITestResult res) {
  System.out.println("Starting " +  res.getName());
  callback.runTestMethod(res);
  if (res.getThrowable() != null) {
    res.setThrowable(null);
    System.out.println("Second attempt " +  res.getName());
    callback.runTestMethod(res);
  }
}
 
开发者ID:barancev,项目名称:testng_samples,代码行数:11,代码来源:RunTwiceInterceptor.java

示例9: run

import org.testng.IHookCallBack; //导入依赖的package包/类
public void run(IHookCallBack hookCallBack) {
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:3,代码来源:ServiceTestBase.java

示例10: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
	this.method = testResult.getMethod().getMethodName();
	super.run(callBack, testResult);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:ProgrammaticTxMgmtTestNGTests.java

示例11: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack iHookCallBack,
        ITestResult iTestResult) {
    super.run(iHookCallBack, iTestResult);
}
 
开发者ID:mkolisnyk,项目名称:aerial,代码行数:6,代码来源:AerialTestNGRunner.java

示例12: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack iHookCallBack, ITestResult iTestResult) {
  iHookCallBack.runTestMethod(iTestResult);
  this.tearDownStack.runTearDown();
}
 
开发者ID:krishnanand,项目名称:test-libraries-for-java,代码行数:6,代码来源:TearDownTestCase.java

示例13: run

import org.testng.IHookCallBack; //导入依赖的package包/类
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {

}
 
开发者ID:DreamYa0,项目名称:zeratul,代码行数:5,代码来源:AbstractHttp.java


注:本文中的org.testng.IHookCallBack类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。