本文整理了Java中com.qaprosoft.zafira.listener.ZafiraListener
类的一些代码示例,展示了ZafiraListener
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZafiraListener
类的具体详情如下:
包路径:com.qaprosoft.zafira.listener.ZafiraListener
类名称:ZafiraListener
[英]TestNG listener that provides integration with Zafira reporting web-service. Accumulates test results and handles rerun failures logic.
[中]TestNG listener,提供与Zafira reporting web服务的集成。累积测试结果并处理重新运行失败逻辑。
代码示例来源:origin: qaprosoft/zafira
AppenderTask(LoggingEvent loggingEvent)
{
this.loggingEvent = loggingEvent;
String testId;
if(loggingEvent.getLevel().equals(MetaInfoLevel.META_INFO) && ((MetaInfoMessage) loggingEvent.getMessage()).getHeaders().get("CI_TEST_ID") != null) {
testId = ((MetaInfoMessage) loggingEvent.getMessage()).getHeaders().get("CI_TEST_ID");
} else {
testId = ZafiraListener.getThreadCiTestId();
}
this.correlationId = testId != null ? routingKey + "_" + String.valueOf(testId) : routingKey;
}
代码示例来源:origin: com.qaprosoft/zafira-client
@Override
public void onFinish(ISuite suiteContext)
{
if(!ZAFIRA_ENABLED) return;
try
{
// Reset configuration to store for example updated at run-time app_version etc
this.run.setConfigXML(convertToXML(configurator.getConfiguration()));
zc.registerTestRunResults(this.run);
}
catch (Throwable e)
{
LOGGER.error("Unable to finish test run correctly", e);
}
}
代码示例来源:origin: com.qaprosoft/zafira-client
@Override
public void onTestSuccess(ITestResult result)
{
if(!ZAFIRA_ENABLED) return;
try
{
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.PASSED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
{
throw new RuntimeException("Unable to register test " + rs.getObject().getName() + " for zafira service: " + ZAFIRA_URL);
}
}
catch (Throwable e) {
LOGGER.error("Undefined error during test case/method finish!", e);
}
}
代码示例来源:origin: com.qaprosoft/zafira-client
test = zc.registerTestStart(testName, group, Status.SKIPPED, testArgs, run.getId(), testCase.getId(), configurator.getRunCount(result), convertToXML(configurator.getConfiguration()), dependsOnMethods, getThreadCiTestId(), configurator.getTestTags(result));
threadTest.set(test);
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.SKIPPED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
代码示例来源:origin: com.qaprosoft/zafira-client
startedTest.setCiTestId(getThreadCiTestId());
startedTest.setTags(configurator.getTestTags(result));
startedTest = zc.registerTestRestart(startedTest);
startedTest = zc.registerTestStart(testName, group, Status.IN_PROGRESS, testArgs, run.getId(), testCase.getId(), configurator.getRunCount(result), convertToXML(configurator.getConfiguration()), dependsOnMethods, getThreadCiTestId(), configurator.getTestTags(result));
代码示例来源:origin: com.qaprosoft/zafira-client
@Override
public void onStart(ISuite suiteContext)
boolean initialized = initializeZafira(suiteContext);
this.run.setConfigXML(convertToXML(configurator.getConfiguration()));
this.run = zc.registerTestRunUPSTREAM_JOB(suite.getId(), convertToXML(configurator.getConfiguration()), job.getId(), parentJob.getId(), ci, Initiator.UPSTREAM_JOB, JIRA_SUITE_ID);
break;
case TIMERTRIGGER:
case SCMTRIGGER:
this.run = zc.registerTestRunBySCHEDULER(suite.getId(), convertToXML(configurator.getConfiguration()), job.getId(), ci, Initiator.SCHEDULER, JIRA_SUITE_ID);
break;
case MANUALTRIGGER:
this.run = zc.registerTestRunByHUMAN(suite.getId(), user.getId(), convertToXML(configurator.getConfiguration()), job.getId(), ci, Initiator.HUMAN, JIRA_SUITE_ID);
break;
default:
代码示例来源:origin: qaprosoft/zafira
test = zc.registerTestStart(testName, group, Status.SKIPPED, testArgs, run.getId(), testCase.getId(), configurator.getRunCount(result), convertToXML(configurator.getConfiguration()), dependsOnMethods, getThreadCiTestId(), configurator.getTestTags(result));
threadTest.set(test);
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.SKIPPED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
代码示例来源:origin: qaprosoft/zafira
startedTest.setCiTestId(getThreadCiTestId());
startedTest.setTags(configurator.getTestTags(result));
startedTest = zc.registerTestRestart(startedTest);
startedTest = zc.registerTestStart(testName, group, Status.IN_PROGRESS, testArgs, run.getId(), testCase.getId(), configurator.getRunCount(result), convertToXML(configurator.getConfiguration()), dependsOnMethods, getThreadCiTestId(), configurator.getTestTags(result));
代码示例来源:origin: qaprosoft/zafira
@Override
public void onStart(ISuite suiteContext)
boolean initialized = initializeZafira(suiteContext);
this.run.setConfigXML(convertToXML(configurator.getConfiguration()));
this.run = zc.registerTestRunUPSTREAM_JOB(suite.getId(), convertToXML(configurator.getConfiguration()), job.getId(), parentJob.getId(), ci, Initiator.UPSTREAM_JOB, JIRA_SUITE_ID);
break;
case TIMERTRIGGER:
case SCMTRIGGER:
this.run = zc.registerTestRunBySCHEDULER(suite.getId(), convertToXML(configurator.getConfiguration()), job.getId(), ci, Initiator.SCHEDULER, JIRA_SUITE_ID);
break;
case MANUALTRIGGER:
this.run = zc.registerTestRunByHUMAN(suite.getId(), user.getId(), convertToXML(configurator.getConfiguration()), job.getId(), ci, Initiator.HUMAN, JIRA_SUITE_ID);
break;
default:
代码示例来源:origin: com.qaprosoft/zafira-client
@Override
public void onTestFailure(ITestResult result)
{
if(!ZAFIRA_ENABLED) return;
try
{
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.FAILED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
{
throw new RuntimeException("Unable to register test " + rs.getObject().getName() + " for zafira service: " + ZAFIRA_URL);
}
}
catch (Throwable e) {
LOGGER.error("Undefined error during test case/method finish!", e);
}
}
代码示例来源:origin: com.qaprosoft/zafira-client
AppenderTask(LoggingEvent loggingEvent)
{
this.loggingEvent = loggingEvent;
String testId;
if(loggingEvent.getLevel().equals(MetaInfoLevel.META_INFO) && ((MetaInfoMessage) loggingEvent.getMessage()).getHeaders().get("CI_TEST_ID") != null) {
testId = ((MetaInfoMessage) loggingEvent.getMessage()).getHeaders().get("CI_TEST_ID");
} else {
testId = ZafiraListener.getThreadCiTestId();
}
this.correlationId = testId != null ? routingKey + "_" + String.valueOf(testId) : routingKey;
}
代码示例来源:origin: qaprosoft/zafira
@Override
public void onFinish(ISuite suiteContext)
{
if(!ZAFIRA_ENABLED) return;
try
{
// Reset configuration to store for example updated at run-time app_version etc
this.run.setConfigXML(convertToXML(configurator.getConfiguration()));
zc.registerTestRunResults(this.run);
}
catch (Throwable e)
{
LOGGER.error("Unable to finish test run correctly", e);
}
}
代码示例来源:origin: qaprosoft/zafira
@Override
public void onTestSuccess(ITestResult result)
{
if(!ZAFIRA_ENABLED) return;
try
{
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.PASSED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
{
throw new RuntimeException("Unable to register test " + rs.getObject().getName() + " for zafira service: " + ZAFIRA_URL);
}
}
catch (Throwable e) {
LOGGER.error("Undefined error during test case/method finish!", e);
}
}
代码示例来源:origin: qaprosoft/carina
final String ciTestId = ZafiraListener.getThreadCiTestId();
try {
ZafiraMessager.<MetaInfoMessage>custom(MetaInfoLevel.META_INFO, new MetaInfoMessage()
代码示例来源:origin: com.qaprosoft/zafira-client
test.setConfigXML(convertToXML(configurator.getConfiguration()));
test.setArtifacts(configurator.getArtifacts(result));
代码示例来源:origin: qaprosoft/zafira
@Override
public void onTestFailedButWithinSuccessPercentage(ITestResult result)
{
if(!ZAFIRA_ENABLED) return;
try
{
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.FAILED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
{
throw new RuntimeException("Unable to register test " + rs.getObject().getName() + " for zafira service: " + ZAFIRA_URL);
}
}
catch (Throwable e) {
LOGGER.error("Undefined error during test case/method finish!", e);
}
}
代码示例来源:origin: qaprosoft/zafira
test.setConfigXML(convertToXML(configurator.getConfiguration()));
test.setArtifacts(configurator.getArtifacts(result));
代码示例来源:origin: qaprosoft/zafira
@Override
public void onTestFailure(ITestResult result)
{
if(!ZAFIRA_ENABLED) return;
try
{
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.FAILED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
{
throw new RuntimeException("Unable to register test " + rs.getObject().getName() + " for zafira service: " + ZAFIRA_URL);
}
}
catch (Throwable e) {
LOGGER.error("Undefined error during test case/method finish!", e);
}
}
代码示例来源:origin: com.qaprosoft/zafira-client
@Override
public void onTestFailedButWithinSuccessPercentage(ITestResult result)
{
if(!ZAFIRA_ENABLED) return;
try
{
Response<TestType> rs = zc.finishTest(populateTestResult(result, Status.FAILED, getFullStackTrace(result)));
if(rs.getStatus() != 200 && rs.getObject() == null)
{
throw new RuntimeException("Unable to register test " + rs.getObject().getName() + " for zafira service: " + ZAFIRA_URL);
}
}
catch (Throwable e) {
LOGGER.error("Undefined error during test case/method finish!", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!