Name |
Ceylon test tool extension: asynchronous code testing |
---|---|
Backends | JVM |
Maven coordinates | |
Compatible Ceylon release |
JVM: 1.2.x, 1.3.x (latest) |
Published | Mar 12, 2016 |
Stats |
Downloads (JVM): 194 Source downloads: 330 |
Authors |
Lis |
License | The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Description |
asyncTestis an extension to SDK
The extension is based on:
Basically:
Test procedure
>Test executor blocks the thread until >If a number of test functions are declared within some class
just a one instance of the class is used for the overall test runcycle. Test suiteTest suite can be used in order to organize test functions into a one suite and to perform common
test initialization / disposing. >Executor blocks current thread until >If initialization is aborted using >Use >Arguments of test suite class can be specified using Example: // initialization parameters [String, Integer] serverParameters => ["host", 123]; // test suite is instantiated just once for the overall test runcycle arguments(`value serverParameters`) class TestServer(String host, Integer port) satisfies TestSuite { variable Server? server = null; // initializer - binds to server specified by host:port, // if successfull proceeds with test or aborted if some error occured shared actual void initialize(TestInitContext context) { Server().bind(host, port).onComplete ( (Server createdServer) { // storing server on context and notifying to continue with testing server = createdServer; context.proceed(); }, (Throwable err) { // abort initialization since server binding errored context.abort(err, "server ``host``:``port`` binding error"); } ); } // test functions test testExecutor(`class AsyncTestExecutor`) void firstTest(AsyncTestContext context) { assert (exists s = server); ... } test testExecutor(`class AsyncTestExecutor`) void secondTest(AsyncTestContext context) { assert (exists s = server); ... } } Test GroupTest functions are collected into groups, which are defined by:
The groups are executed in sequential order. While functions in each group are executed concurrently using
thread pool with fixed number of threads eqauls to number of available processors (cores). >Test class can be instantiated with arguments using Test maintainerCombines a number of test groups into a one assembly and indented to sort the test groups execution order
(by default test groups are executed in alphabetical order). This can be used to execute more important tests before
less important ones. Only one maintainer of a given type is instantiated for any number of maintainer( `class MyMaintainer`) package xxx ... maintainer( `class MyMaintainer`) package yyy ... maintainer( `class MyMaintainer`) package zzz ... >Test maintainer can be instantiated with arguments using Conditional executionTest condition can be specified via custom annotation which satisfies Parameterized testingCan be performed using staff provided by MatchersMatchers are intended to organize complex test conditions into a one flexible expression. Details of matching API are described in Reporting test results using chartsChart is simply a set of plots, where each plot is a sequence of 2D points. |
Change Log |
Ceylon 1.2.2 |
Dependencies |
ceylon.promise/1.2.2
shared
ceylon.test/1.2.2
shared
java.base/8 JDK
|
Usage |
import herd.asynctest "0.5.1"; |
Module links |
Members Imported By Home Code repository Issue tracker Browse Download .car No .js archive Download source archive Download module documentation View API documentation |