All Downloads are FREE. Search and download functionalities are using the official Maven repository.

app.getxray.xray.junit.customjunitxml.XrayTestReporterImpl Maven / Gradle / Ivy

Go to download

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy