https://github.com/mscharhag/oleaster
Write Java JUnit tests in Jasmine style
https://github.com/mscharhag/oleaster
Last synced: about 2 months ago
JSON representation
Write Java JUnit tests in Jasmine style
- Host: GitHub
- URL: https://github.com/mscharhag/oleaster
- Owner: mscharhag
- License: apache-2.0
- Created: 2014-06-18T20:09:46.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-09-23T13:05:08.000Z (over 7 years ago)
- Last Synced: 2023-12-21T21:07:42.453Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 297 KB
- Stars: 120
- Watchers: 7
- Forks: 15
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - Oleaster
README
Oleaster
=====Oleaster allows you to write JUnit tests like you would write [Jasmine](http://jasmine.github.io/) tests.
An Oleaster JUnit test looks like this:
```java
@RunWith(OleasterRunner.class)
public class OleasterIntroductionTest {{
describe("A suite", () -> {
it("contains a spec with an expectation", () -> {
expect(40 + 2).toEqual(42);
});
});
}}
```Oleaster consists out of two independent libraries:
The [Oleaster JUnit Runner](https://github.com/mscharhag/oleaster/tree/master/oleaster-runner) gives you the option
to write JUnit tests in the format shown above. Java 8 Lambda expressions are used to structure a test in suites
and specifications.
[Oleaster-Matcher](https://github.com/mscharhag/oleaster/tree/master/oleaster-matcher)
provides Jasmine-like Matchers (`expect(..).toEqual(..)`) to validate test results. These Matchers can be used
as a replacement (or extension) for standard JUnit assertions.## Documentation and examples
[Oleaster JUnit Runner Documentation](https://github.com/mscharhag/oleaster/blob/master/oleaster-runner/README.md)
[Oleaster Matcher Documentation](https://github.com/mscharhag/oleaster/blob/master/oleaster-matcher/README.md)
[Source of the AudioPlayer example](https://github.com/mscharhag/oleaster/blob/master/oleaster-examples/src/test/java/com/mscharhag/oleaster/examples/AudioPlayerExampleTest.java) from the Oleaster Runner documentation.
Oleaster tests are (mostly) written with Oleaster (see: [Oleaster JUnit Runner Tests](https://github.com/mscharhag/oleaster/tree/master/oleaster-runner/src/test/java/com/mscharhag/oleaster/runner) and [Oleaster Matcher Tests](https://github.com/mscharhag/oleaster/tree/master/oleaster-matcher/src/test/java/com/mscharhag/oleaster/matcher/matchers)).
Travis CI builds can be found [here](https://travis-ci.org/mscharhag/oleaster)
## Maven dependencies
```xml
com.mscharhag.oleaster
oleaster-matcher
0.2.0
com.mscharhag.oleaster
oleaster-runner
0.2.0
junit
junit
4.11
```
## License
This software is licensed under the Apache 2 license, quoted below.
Copyright 2017 Michael Scharhag
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.