Version: 1.0
Status: ⚫⚪⚪
TestController plugin for Thunder framework.
This document describes purpose and functionality of the TestController plugin. It includes detailed specification of its configuration, methods and properties provided.
All identifiers on the interface described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
The table below provides and overview of acronyms used in this document and their definitions.
Acronym | Description |
---|---|
API | Application Programming Interface |
HTTP | Hypertext Transfer Protocol |
JSON | JavaScript Object Notation; a data interchange format |
JSON-RPC | A remote procedure call protocol encoded in JSON |
The table below provides and overview of terms and abbreviations used in this document and their definitions.
Term | Description |
---|---|
callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. |
Ref ID | Description |
---|---|
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
The TestController plugin enables executing of embedded test cases on the platform.
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].
The table below lists configuration options of the plugin.
Name | Type | Description |
---|---|---|
callsign | string | Plugin instance name (default: TestController) |
classname | string | Class name: TestController |
locator | string | Library name: libWPEFrameworkTestController.so |
autostart | boolean | Determines if the plugin is to be started automatically along with the framework |
The following methods are provided by the TestController plugin:
TestController interface methods:
Method | Description |
---|---|
run | Runs a single test or multiple tests |
Runs a single test or multiple tests.
Name | Type | Description |
---|---|---|
params | object | |
params?.category | string | (optional) Test category name, if omitted: all tests are executed |
params?.test | string | (optional) Test name, if omitted: all tests of category are executed |
params?.args | string | (optional) The test arguments in JSON format |
Name | Type | Description |
---|---|---|
result | array | List of test results |
result[#] | object | |
result[#].test | string | Test name |
result[#].status | string | Test status |
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Unknown category/test |
30 | ERROR_BAD_REQUEST |
Bad json param data format |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "TestController.1.run",
"params": {
"category": "JSONRPC",
"test": "JSONRPCTest",
"args": "{ }"
}
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": [
{
"test": "JSONRPCTest",
"status": "Success"
}
]
}
The following properties are provided by the TestController plugin:
TestController interface properties:
Property | Description |
---|---|
categories RO | List of test categories |
tests RO | List of tests for a category |
description RO | Description of a test |
Provides access to the list of test categories.
This property is read-only.
Name | Type | Description |
---|---|---|
(property) | array | List of test categories |
(property)[#] | string | Test category name |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "TestController.1.categories"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": [
"JSONRPC"
]
}
Provides access to the list of tests for a category.
This property is read-only.
Name | Type | Description |
---|---|---|
(property) | array | List of tests for a category |
(property)[#] | string | Test name |
The category shall be passed as the index to the property, e.g. TestController.1.tests@JSONRPC.
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Unknown category |
30 | ERROR_BAD_REQUEST |
Bad JSON param data format |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "TestController.1.tests@JSONRPC"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": [
"JSONRPCTest"
]
}
Provides access to the description of a test.
This property is read-only.
Name | Type | Description |
---|---|---|
(property) | object | Description of a test |
(property).description | string | Test description |
The test shall be passed as the index to the property, e.g. TestController.1.description@JSONRPC.
Code | Message | Description |
---|---|---|
2 | ERROR_UNAVAILABLE |
Unknown category/test |
30 | ERROR_BAD_REQUEST |
Bad JSON param data format |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "TestController.1.description@JSONRPC"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": {
"description": "Tests JSONRPC functionality"
}
}