app.getxray.xray.junit.customjunitxml.XrayTestReporterImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xray-junit-extensions Show documentation
Show all versions of xray-junit-extensions Show documentation
Improvements for JUnit that allow you to take better advantage of JUnit 5 (jupiter engine) whenever using it together with Xray Test Management.
The newest version!
/*
* Copyright 2021-2021 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* https://www.eclipse.org/legal/epl-v20.html"
*/
package app.getxray.xray.junit.customjunitxml;
import java.util.ArrayList;
import org.junit.jupiter.api.extension.ExtensionContext;
public class XrayTestReporterImpl implements XrayTestReporter {
private final ExtensionContext extensionContext;
public XrayTestReporterImpl(ExtensionContext extensionContext) {
this.extensionContext = extensionContext;
}
public void addComment(String comment) {
this.extensionContext.publishReportEntry(TESTRUN_COMMENT, comment);
}
public void setTestRunCustomField(String field, String value) {
this.extensionContext.publishReportEntry(TESTRUN_CUSTOMFIELD_PREFIX + field, value);
}
public void setTestRunCustomField(String field, String[] values) {
ArrayList arrList = new ArrayList();
for (int i=0;i