DEV Community

hiclab
hiclab

Posted on

2 3

Create a custom report for RCPTT

RCPTT (RCP Testing Tool) includes a functionality that allows to generate reports in multiple formats based on the results obtained from executing test cases. However, the default reports might be insufficient for our needs but fortunately; RCPTT is flexible because it supports generating custom reports.

In this post, we illustrate the basic steps needed to create a custom report renderer so it can be used in RCPTT whether IDE or Test Runner. We use Maven to configure and build the plugin and other related artifacts. By the way, we use a specific project to build an update site for our plugin.

The full code is available at the following repository rcptt-reporting.

Create a report renderer

RCPTT provides the interface IReportRenderer which is the entry point for report generation. Renderers implementing this interface receive a Report iterable object to iterate over all internal reports generated for a given test execution.

public class XMLCustomReportRenderer implements IReportRenderer {

    @Override
    public IStatus generateReport(IContentFactory factory, String reportName, Iterable<Report> reports) {

        // iterate over reports, process their information and create a file in your preferred format ...
        return Status.OK_STATUS;
    }

    @Override
    public String[] getGeneratedFileNames(String reportName) {
        return new String[] { reportName };
    }
}

To access to the results of executed tests, we have to iterate over a collection of Report objects and retrieve the information as follows:

Iterator<Report> reportIterator = reports.iterator();
while (reportIterator.hasNext()) {
    Report report = reportIterator.next();
    Node item = report.getRoot();
    Q7Info info = (Q7Info) item.getProperties().get(IQ7ReportConstants.ROOT);

    // Q7Info object contains the information of an executed test case
}

Add an extension

Once the report renderer is implemented, we have to add an extension for this plugin to be able to use it. The following entry must be added to plugin.xml.

<extension point="org.eclipse.rcptt.reporting.reportRenderer">
    <reportRenderer
        class="com.hiclab.rcptt.reporting.XMLCustomReportRenderer"
        description="XML Custom Report Renderer"
        extension="xml"
        id="XmlReport"
        name="Xml Custom Report">
    </reportRenderer>
</extension>

The id is needed especially when using Test Runner. For more details, check the description of the argument report in Test Runner documentation.

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay