Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
- Update README.md in root folder.
- Integrate new project in `build-all-samples` script.
- Use SLF4J NOP Logger implementation.
- Add missing licenses.
- Clean up Travis CI build script.
  • Loading branch information
sormuras committed Aug 8, 2018
1 parent 1876f6b commit 2c5caaa
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 30 deletions.
29 changes: 5 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,68 +11,49 @@ jobs:
# starter
- stage: starter
name: "Jupiter Starter Sample: Ant"
env: TOOL='Ant'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-ant && ./build.sh
- stage: starter
name: "Jupiter Starter Sample: Gradle & Java"
env: TOOL='Gradle'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-gradle && ./gradlew test --console plain
- stage: starter
name: "Jupiter Starter Sample: Gradle & Kotlin"
env: TOOL='Gradle'
env: TOPIC='Kotlin'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-gradle-kotlin && ./gradlew test --console plain
- stage: starter
name: "Jupiter Starter Sample: Gradle & Groovy"
env: TOOL='Gradle'
env: TOPIC='Groovy'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-gradle-groovy && ./gradlew test --console plain
- stage: starter
name: "Jupiter Starter Sample: Maven"
env: TOOL='Maven'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-maven && ./mvnw test
- stage: starter
name: "Jupiter Extension Samples"
env: TOPIC='Sample Extensions'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-extensions && ./gradlew test --console plain
# migration
- stage: migration
name: "Migration Samples: Gradle"
env: TOOL='Gradle'
script: cd $TRAVIS_BUILD_DIR/junit5-migration-gradle && ./gradlew build --console plain --scan
- stage: migration
name: "Migration Samples: Maven"
env: TOOL='Maven'
script: cd $TRAVIS_BUILD_DIR/junit5-migration-maven && ./mvnw test
- stage: migration
# platform
- stage: platform
name: "JUnit Platform running multiple TestEngine implementations"
jdk: openjdk11
env: TOOL='Gradle'
script: cd $TRAVIS_BUILD_DIR/junit5-multiple-engines && ./gradlew test --console plain
# java 10 and higher
- stage: java-10
name: "Running on JDK 10"
jdk: openjdk10
env: TOOL='Maven'
script: cd $TRAVIS_BUILD_DIR/junit5-migration-maven && ./mvnw test
- stage: java-10
- stage: platform
name: "Living in the Modular World..."
jdk: openjdk10
env: TOPIC='Java Platform Module System'
jdk: openjdk11
script: cd $TRAVIS_BUILD_DIR/junit5-modular-world && ./build.jsh
# snapshot -- use current junit master branch
- stage: snapshot
name: "JUnit 5 SNAPSHOT build: Gradle"
jdk: openjdk11
env: TOOL='Gradle'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-gradle && ./gradlew test --console plain --build-file build-SNAPSHOT.gradle
- stage: snapshot
name: "JUnit 5 SNAPSHOT build: Maven"
jdk: openjdk11
env: TOOL='Maven'
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-maven && ./mvnw test --file pom-SNAPSHOT.xml
# all samples, one-shot
# - stage: all
# name: "Build all samples"
# jdk: openjdk-ea
# env: TOPIC='Build all samples'
# script: ./build-all-samples.jsh
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the `build-all-samples.jsh` script.

## Jupiter Starter Samples

_Basic setups showing how to get started._
_Basic setups showing how to get started with JUnit Jupiter._

### Jupiter on Ant ![badge-jdk-8] ![badge-tool-ant] ![badge-junit-jupiter]

Expand Down Expand Up @@ -41,6 +41,8 @@ getting started with JUnit Jupiter using the Maven build system.

## Jupiter Feature Samples

_Extending JUnit Jupiter using its `Extension` API._

### Sample Extensions ![badge-jdk-8] ![badge-tool-gradle] ![badge-junit-jupiter]

The [junit5-jupiter-extensions] sample demonstrates how one can implement custom
Expand All @@ -63,11 +65,15 @@ The [junit5-migration-maven] sample demonstrates how to set up a Maven project
using the JUnit Platform, JUnit Jupiter, and JUnit Vintage.


## Java Platform Module System Samples
## Platform Samples
_Showing basic features of the JUnit Platform._

### Multiple Engines ![badge-jdk-11] ![badge-tool-gradle] ![badge-junit-platform] ![badge-junit-jupiter] ![badge-junit-vintage] ...

_Living in the Modular World..._
The [junit5-multiple-engines] sample demonstrates how to set up a Gradle project
using the JUnit Platform with various [TestEngine][guide-custom-engine] implementations.

### Platform on JShell ![badge-jdk-9] ![badge-jdk-10] ![badge-jdk-11] ![badge-tool-console] ![badge-junit-platform]
### Living in the Modular World ![badge-jdk-11] ![badge-tool-console] ![badge-junit-platform]

The [junit5-modular-world] sample demonstrates how to test code organized in modules.
This sample also demonstrates how to implement a custom [TestEngine][guide-custom-engine]
Expand All @@ -81,6 +87,7 @@ for the JUnit Platform using the Java Platform Module System.
[junit5-jupiter-starter-maven]: junit5-jupiter-starter-maven
[junit5-migration-gradle]: junit5-migration-gradle
[junit5-migration-maven]: junit5-migration-maven
[junit5-multiple-engines]: junit5-multiple-engines
[junit5-modular-world]: junit5-modular-world

[badge-jdk-8]: https://img.shields.io/badge/jdk-8-lightgray.svg "JDK-8"
Expand Down
19 changes: 19 additions & 0 deletions junit5-multiple-engines/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# junit5-multiple-engines

The `junit5-multiple-engines` sample demonstrates how to set up a Gradle project
using the JUnit Platform with various [TestEngine][guide-custom-engine] implementations.

## Provided by junit.org

* [JUnit Jupiter](https://junit.org/junit5/docs/current/user-guide)
* [JUnit Vintage](https://junit.org/junit5/docs/current/user-guide)

## 3rd-party test engines

* [Brahms Maingine](https://github.com/sormuras/brahms)
* [Brahms Single-File Source-Code Engine (JEP 330)](https://github.com/sormuras/brahms)
* [JQwik Test Engine](http://jqwik.net)
* [KotlinTest](https://github.com/kotlintest/kotlintest)
* [Spek](https://github.com/spekframework/spek)

[guide-custom-engine]: http://junit.org/junit5/docs/current/user-guide/#launcher-api-engines-custom "Plugging in Your Own Test Engine"
4 changes: 3 additions & 1 deletion junit5-multiple-engines/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ dependencies {
testCompile('org.jetbrains.kotlin:kotlin-reflect')

// KotlinTest
testCompile 'io.kotlintest:kotlintest-runner-junit5:3.1.9'
testCompile('io.kotlintest:kotlintest-runner-junit5:3.1.9')
testRuntime('org.slf4j:slf4j-nop:1.7.25')
// testRuntime('org.slf4j:slf4j-simple:1.7.25')
}

task consoleLauncherTest(type: JavaExec) {
Expand Down
10 changes: 10 additions & 0 deletions junit5-multiple-engines/src/test/java/brahms/MaingineTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright 2015-2018 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/

package brahms;

public class MaingineTest {
Expand Down
10 changes: 10 additions & 0 deletions junit5-multiple-engines/src/test/java/jqwik/JQwikTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright 2015-2018 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/

package jqwik;

import net.jqwik.api.Example;
Expand Down
10 changes: 10 additions & 0 deletions junit5-multiple-engines/src/test/kotlin/kotlintest/KotlinTest.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright 2015-2018 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/

package kotlintest

import io.kotlintest.shouldBe
Expand Down
10 changes: 10 additions & 0 deletions junit5-multiple-engines/src/test/kotlin/spek/SpekTest.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright 2015-2018 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/

package spek

import org.jetbrains.spek.api.Spek
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
/*
* Copyright 2015-2018 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/

/** @see http://openjdk.java.net/jeps/330 */
class SingleFileSourceCodeProgram {

public static void main(String... args) {
System.out.println("http://openjdk.java.net/jeps/330");
}
}
}
1 change: 1 addition & 0 deletions src/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ int build() {
// migration
run("junit5-migration-gradle", "gradlew", "clean", "test");
run("junit5-migration-maven", "mvnw", "clean", "test");
run("junit5-multiple-engines", "gradlew", "clean", "test");

// modular
run("junit5-modular-world", "jshell", "build.jsh");
Expand Down

0 comments on commit 2c5caaa

Please sign in to comment.