Oleaster Runner

A JUnit runner to write Jasmine like JUnit tests

License

License

GroupId

GroupId

com.mscharhag.oleaster
ArtifactId

ArtifactId

oleaster-runner
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Oleaster Runner
A JUnit runner to write Jasmine like JUnit tests

Download oleaster-runner

How to add to project

<!-- https://jarcasting.com/artifacts/com.mscharhag.oleaster/oleaster-runner/ -->
<dependency>
    <groupId>com.mscharhag.oleaster</groupId>
    <artifactId>oleaster-runner</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.mscharhag.oleaster/oleaster-runner/
implementation 'com.mscharhag.oleaster:oleaster-runner:0.2.0'
// https://jarcasting.com/artifacts/com.mscharhag.oleaster/oleaster-runner/
implementation ("com.mscharhag.oleaster:oleaster-runner:0.2.0")
'com.mscharhag.oleaster:oleaster-runner:jar:0.2.0'
<dependency org="com.mscharhag.oleaster" name="oleaster-runner" rev="0.2.0">
  <artifact name="oleaster-runner" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.mscharhag.oleaster', module='oleaster-runner', version='0.2.0')
)
libraryDependencies += "com.mscharhag.oleaster" % "oleaster-runner" % "0.2.0"
[com.mscharhag.oleaster/oleaster-runner "0.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Oleaster

Oleaster allows you to write JUnit tests like you would write Jasmine tests.

An Oleaster JUnit test looks like this:

@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 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 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

Oleaster Matcher Documentation

Source of the AudioPlayer example from the Oleaster Runner documentation.

Oleaster tests are (mostly) written with Oleaster (see: Oleaster JUnit Runner Tests and Oleaster Matcher Tests).

Travis CI builds can be found here

Maven dependencies

<dependencies>

	<!-- Oleaster Matchers -->
	<dependency>
		<groupId>com.mscharhag.oleaster</groupId>
		<artifactId>oleaster-matcher</artifactId>
		<version>0.2.0</version>
    	</dependency>
    
	<!-- Oleaster JUnit runner -->
	<dependency>
		<groupId>com.mscharhag.oleaster</groupId>
		<artifactId>oleaster-runner</artifactId>
		<version>0.2.0</version>
	</dependency>

	<!-- Of course a JUnit runner can only be used with JUnit -->
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.11</version>
	</dependency>
	
</dependencies>

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 at

http://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.

Versions

Version
0.2.0
0.1.2
0.1.1
0.1.0