Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkuhn/asynctest
Minimalistic JUnit-style framework for testing asynchronous components
https://github.com/rkuhn/asynctest
Last synced: about 2 months ago
JSON representation
Minimalistic JUnit-style framework for testing asynchronous components
- Host: GitHub
- URL: https://github.com/rkuhn/asynctest
- Owner: rkuhn
- License: other
- Created: 2014-09-06T14:26:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-06T14:43:34.000Z (over 10 years ago)
- Last Synced: 2023-03-23T17:26:42.321Z (almost 2 years ago)
- Language: Scala
- Size: 90.8 KB
- Stars: 37
- Watchers: 9
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AsyncTest
Testing asynchronous code requires the implementor to jump through hoops to fit things into the traditional synchronous unit-testing corset. It should be possible to write test cases that return Futures for their results and which are then inspected asynchronously by the test framework.
## Rough Idea
The process should be:
* spawn off test procedures wrapped in Future (asynchronously) to get them all off the ground as fast as possible
* test cases that return a Future will be flattened, meaning that the resulting Future holds the asynchronous value that is produced by the test case; the value itself is irrelevant, only that it is not a failure counts
* each test case Future is bounded by a timeout and recovered wrap failures in a dedicated ADT
* all resulting Futures are sequenced into the overall test suite result; no further timeout is necessary assuming that the sequencing operation is reliableThis is in a first rough cut attached to a JUnit Runner, which means that the runner will synchronously await the completion of all these Futures and feed the results back into the RunNotifier. Since this means spending one main thread per test suite this is not optimal and will later be replaced by a purely asynchronous mechanism.
## Contributing
I am very much interested in feedback and suggestions, please open issues. Concerning code contributions I’ll have to figure out the CLA mechanism first.
## License
This code is open source software licensed under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).