Oleaster

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

com.mscharhag.oleaster
ArtifactId

ArtifactId

oleaster
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

pom
Description

Description

Oleaster
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project URL

Project URL

https://github.com/mscharhag/oleaster
Source Code Management

Source Code Management

https://github.com/mscharhag/oleaster

Download oleaster

Filename Size
oleaster-0.2.0.pom 2 KB
Browse

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • oleaster-runner
  • oleaster-matcher
  • oleaster-examples

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