T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1

Interface ReportProvider

All Superinterfaces:
All Known Implementing Classes:
DefaultReportProvider, XSLReportProvider

public interface ReportProvider
extends Plugin

Exposed functional interface of report providers. A report provider is an object which typically registers to script (ScriptListener and command CommandEvent events and generates a report on the script execution. Report providers are instantiated through ReportProviderFactory, usually by a call of the Report command.

T-Plan Robot Enterprise, (C) 2009-2019 T-Plan Limited. All rights reserved.

Method Summary
 int create(ScriptingContext context, java.util.Map params)
          Create a report using the scripting context.
 java.lang.String getCode()
          Get report provider code.
 java.lang.String[] getSupportedFormats()
          Get formats supported by this particular provider.
Methods inherited from interface com.tplan.robot.plugin.Plugin
checkDependencies, getDate, getDescription, getDisplayName, getImplementedInterface, getLowestSupportedVersion, getMessageAfterInstall, getMessageBeforeInstall, getSupportContact, getUniqueId, getVendorHomePage, getVendorName, getVersion, requiresRestart

Method Detail


java.lang.String getCode()
Get report provider code. It serves as identifier in the scripting language. For example, the default report provider implementation returns "default".

Specified by:
getCode in interface Plugin
report provider code.


java.lang.String[] getSupportedFormats()

Get formats supported by this particular provider. The formats are not case sensitive and they must correspond to the supported file extensions. For example, a provider able to generate XML, HTML and Excel formats should return new String[] {"xml", "html", "htm", "xls"}.

The method is used by the calling Report instance to validate file name provided by the script command. If the file doesn't have one of the extensions supported by the selected provider, a syntax error is reported.

array of supported formats (file extensions).


int create(ScriptingContext context,
           java.util.Map params)

Create a report using the scripting context. This method is called just once right after an instance of this provider is created through the Report command or it's associated Java test script method. It is up to the implementing class whether it prefers to generate one-time report and finish or register as ScriptListener and/or CommandListener and stay alive refreshing the report with updates until the script execution finishes.

The context provides access to all necessary objects associated with the script and execution.

context - scripting context of the currently executed script.
params - Report command parameters parsed from the command. They typically contain at least the output file name together with an optional description and scope. See the Report command specification for more information.
exit code to be returned by the Report command - 0 means success, other value means failure.

T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1