Skip to content

Latest commit

 

History

History
288 lines (215 loc) · 7.46 KB

TestControllerPlugin.md

File metadata and controls

288 lines (215 loc) · 7.46 KB

Test Controller Plugin

Version: 1.0

Status: ⚫⚪⚪

TestController plugin for Thunder framework.

Table of Contents

Introduction

Scope

This document describes purpose and functionality of the TestController plugin. It includes detailed specification of its configuration, methods and properties provided.

Case Sensitivity

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.

Acronyms, Abbreviations and Terms

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.

References

Ref ID Description
HTTP HTTP specification
JSON-RPC JSON-RPC 2.0 specification
JSON JSON specification
Thunder Thunder API Reference

Description

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].

Configuration

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

Methods

The following methods are provided by the TestController plugin:

TestController interface methods:

Method Description
run Runs a single test or multiple tests

run method

Runs a single test or multiple tests.

Parameters

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

Result

Name Type Description
result array List of test results
result[#] object
result[#].test string Test name
result[#].status string Test status

Errors

Code Message Description
2 ERROR_UNAVAILABLE Unknown category/test
30 ERROR_BAD_REQUEST Bad json param data format

Example

Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "TestController.1.run",
    "params": {
        "category": "JSONRPC",
        "test": "JSONRPCTest",
        "args": "{ }"
    }
}

Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": [
        {
            "test": "JSONRPCTest",
            "status": "Success"
        }
    ]
}

Properties

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

categories property

Provides access to the list of test categories.

This property is read-only.

Value

Name Type Description
(property) array List of test categories
(property)[#] string Test category name

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "TestController.1.categories"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": [
        "JSONRPC"
    ]
}

tests property

Provides access to the list of tests for a category.

This property is read-only.

Value

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.

Errors

Code Message Description
2 ERROR_UNAVAILABLE Unknown category
30 ERROR_BAD_REQUEST Bad JSON param data format

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "TestController.1.tests@JSONRPC"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": [
        "JSONRPCTest"
    ]
}

description property

Provides access to the description of a test.

This property is read-only.

Value

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.

Errors

Code Message Description
2 ERROR_UNAVAILABLE Unknown category/test
30 ERROR_BAD_REQUEST Bad JSON param data format

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "TestController.1.description@JSONRPC"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": {
        "description": "Tests JSONRPC functionality"
    }
}