use of com.epam.ta.reportportal.ws.model.log.SaveLogRQ in project agent-java-soapui by reportportal.
the class ResultLogger method prepareEntity.
protected final SaveLogRQ prepareEntity(String level, String message) {
SaveLogRQ logRQ = new SaveLogRQ();
logRQ.setLevel(level);
logRQ.setLogTime(Calendar.getInstance().getTime());
logRQ.setMessage(message);
return logRQ;
}
use of com.epam.ta.reportportal.ws.model.log.SaveLogRQ in project agent-java-soapui by reportportal.
the class TestBasedSoapUIServiceImpl method asFunctionFile.
public static Function<String, SaveLogRQ> asFunctionFile(final String message, final SaveLogRQ.File file, final String level, final Date time) {
return new Function<String, SaveLogRQ>() {
@Override
public SaveLogRQ apply(String id) {
SaveLogRQ rq = new SaveLogRQ();
rq.setLevel(level);
rq.setLogTime(time);
rq.setTestItemId(id);
rq.setMessage(message);
rq.setFile(file);
return rq;
}
};
}
use of com.epam.ta.reportportal.ws.model.log.SaveLogRQ in project agent-java-soapui by reportportal.
the class TestBasedSoapUIServiceImpl method finishTestStep.
public void finishTestStep(TestStepResult testStepContext, TestCaseRunContext paramTestCaseRunContext) {
LoggingContext loggingContext = CONTEXT_MAP.get(TEST_CASE_ID);
if (!RpServiceBuilder.REPORTER_DISABLE) {
String logStepData = getLogStepData(testStepContext);
if (!Strings.isNullOrEmpty(logStepData)) {
loggingContext.emit(asFunction(logStepData, LEVEL_INFO, Calendar.getInstance().getTime()));
}
for (final SaveLogRQ rq : getStepLogReport(testStepContext)) {
loggingContext.emit(new Function<String, SaveLogRQ>() {
@Override
public SaveLogRQ apply(String id) {
rq.setTestItemId(id);
return rq;
}
});
}
}
if (TestStepResult.TestStepStatus.FAILED.equals(testStepContext.getStatus())) {
loggingContext.emit(asFunction(getStepError(testStepContext), "ERROR", Calendar.getInstance().getTime()));
}
if (TestStepResult.TestStepStatus.CANCELED.equals(testStepContext.getStatus())) {
context.setTestCanceled(true);
}
if (!RpServiceBuilder.REPORTER_DISABLE) {
String log = asMarkdown(String.format("# ===========STEP '%s' %s===========", testStepContext.getTestStep().getName(), TestStatus.fromSoapUIStep(testStepContext.getStatus())));
loggingContext.emit(asFunction(log, LEVEL_INFO, Calendar.getInstance().getTime()));
}
}
use of com.epam.ta.reportportal.ws.model.log.SaveLogRQ in project agent-java-soapui by reportportal.
the class StepBasedSoapUIServiceImpl method finishTestStep.
public void finishTestStep(TestStepResult testStepContext, TestCaseRunContext paramTestCaseRunContext) {
if (null != launch) {
Maybe<String> testId = (Maybe<String>) paramTestCaseRunContext.getProperty(ID);
String logStepData = getLogStepData(testStepContext);
if (!Strings.isNullOrEmpty(logStepData)) {
ReportPortal.emitLog(logStepData, "INFO", Calendar.getInstance().getTime());
}
for (final SaveLogRQ rq : getStepLogReport(testStepContext)) {
ReportPortal.emitLog(new Function<String, SaveLogRQ>() {
@Override
public SaveLogRQ apply(String id) {
rq.setTestItemId(id);
return rq;
}
});
}
if (TestStepStatus.FAILED.equals(testStepContext.getStatus())) {
ReportPortal.emitLog(getStepError(testStepContext), "ERROR", Calendar.getInstance().getTime());
}
FinishTestItemRQ rq = new FinishTestItemRQ();
rq.setEndTime(Calendar.getInstance().getTime());
if (TestStepStatus.CANCELED.equals(testStepContext.getStatus())) {
context.setTestCanceled(true);
}
rq.setStatus(TestStatus.fromSoapUIStep(testStepContext.getStatus()));
this.launch.finishTestItem(testId, rq);
}
}
use of com.epam.ta.reportportal.ws.model.log.SaveLogRQ in project agent-java-soapui by reportportal.
the class TestBasedSoapUIServiceImpl method asFunction.
public static Function<String, SaveLogRQ> asFunction(final String message, final String level, final Date time) {
return new Function<String, SaveLogRQ>() {
@Override
public SaveLogRQ apply(String id) {
SaveLogRQ rq = new SaveLogRQ();
rq.setLevel(level);
rq.setLogTime(time);
rq.setTestItemId(id);
rq.setMessage(message);
return rq;
}
};
}
Aggregations