Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-all-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Set up JDK 21'
- name: 'Set up JDK 24'
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: 21
java-version: 24
distribution: temurin
- uses: sbt/setup-sbt@a9d38be6cfa0c7bfb8be93b4cc4e1edaa6351728 # v1.1.10
- name: 'Build all examples using JShell'
- name: 'Build all examples'
run: java src/Builder.java
- name: 'Check automation for updating versions'
run: java src/Updater.java 42
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
build-mode: manual
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Set up JDK 21'
- name: 'Set up JDK 24'
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: 21
java-version: 24
distribution: temurin
- uses: sbt/setup-sbt@a9d38be6cfa0c7bfb8be93b4cc4e1edaa6351728 # v1.1.10
- name: Initialize CodeQL
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
Welcome to _JUnit Examples_, a collection of example applications and extensions
using JUnit Jupiter, JUnit Vintage, and the JUnit Platform on various build systems.

CI builds for example projects are performed by [GitHub Actions][ci-actions]. Using JDK 11+'s
`jshell` tool, you may build all examples via the `build-all-examples.jsh` script.
CI builds for example projects are performed by [GitHub Actions][ci-actions]. Using JDK 24+'s
`java` multi-file source-code launcher feature, you may build all examples by running
`java src/Builder.java` in the main directory of this project.

## Jupiter Starter Examples

Expand Down
2 changes: 1 addition & 1 deletion junit-jupiter-starter-ant/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# junit-jupiter-starter-ant

The `junit-jupiter-starter-ant` project demonstrates how to execute JUnit Jupiter
tests using [Apache Ant](https://ant.apache.org/) 1.10.4 or higher.
tests using [Apache Ant](https://ant.apache.org/) 1.10.15 or higher.

This example project does not aim to demonstrate how to use the JUnit Jupiter APIs.

Expand Down
2 changes: 1 addition & 1 deletion junit-jupiter-starter-ant/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
# Set constants.
#
junit_platform_version='1.13.2'
ant_version='1.10.13'
Comment thread
marcphilipp marked this conversation as resolved.
ant_version='1.10.15'
ant_folder="apache-ant-${ant_version}"
ant_archive="${ant_folder}-bin.tar.gz"
standalone_jar="${ant_folder}/lib/junit-platform-console-standalone-${junit_platform_version}.jar"
Expand Down
4 changes: 2 additions & 2 deletions junit-jupiter-starter-ant/build.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="junit-jupiter-starter-ant" default="build" basedir=".">

<fail message="Ant 1.10.4+ is required!">
<fail message="Ant 1.10.15+ is required!">
<condition>
<not>
<antversion atleast="1.10.4"/>
<antversion atleast="1.10.15"/>
</not>
</condition>
</fail>
Expand Down
7 changes: 7 additions & 0 deletions junit-jupiter-starter-bazel/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build --java_language_version=21
build --java_runtime_version=remotejdk_21

build --tool_java_language_version=21
build --tool_java_runtime_version=remotejdk_21

test --test_output=all
1 change: 1 addition & 0 deletions junit-modular-world/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bin/
lib/
!src/build/
.jqwik-database
20 changes: 9 additions & 11 deletions junit-modular-world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

The project layout structure and command line tools usages are based on proposals
introduced by the [**Module System Quick-Start Guide**](https://openjdk.java.net/projects/jigsaw/quick-start).
Invoke the [jshell](https://docs.oracle.com/javase/9/tools/jshell.htm) script
`./build.jsh` (Windows: `jshell build.jsh`) to build this example project.
Invoke [java](https://openjdk.org/jeps/458)'s source launcher
`java src/build/Build.java` to build this example project.

This example project does not aim to demonstrate how to use the JUnit Platform APIs.
For detailed information on the JUnit Platform programming and extension models,
This example project does not aim to demonstrate how to use the JUnit Framework APIs.
For detailed information on the JUnit Framework programming and extension models,
please consult the [User Guide](https://docs.junit.org/current/user-guide/).

## Source Layout
Expand All @@ -22,7 +22,7 @@ It tests the exported packages and types of the main modules.

## Binary Layout

Main binaries are compiled and packaged using `./compile.jsh`.
Main binaries are compiled and packaged using `java src/build/Compile.java`.

For example, here are the commands to compile and package the `com.example.tool` module.
This and the `com.example.application` module don't need external module dependencies.
Expand Down Expand Up @@ -57,18 +57,16 @@ jar
.
```

Here is the partly expanded tree of the `bin/` directory after running `./compile.jsh`:
Here is the partly expanded tree of the `bin/` directory after running `java src/build/Compile.java`:

![junit-modular-world/bin](doc/screenshot-bin.png)


## Running Tests

Compiling and running tests is achieved by calling the following test scripts:
Compiling and running tests is achieved by calling the following Java program:

- `test-classpath.jsh`
- `test-patch-compile.jsh`
- `test-patch-runtime.jsh`
- `java src/build/Build.java`

```
Expand Down Expand Up @@ -116,7 +114,7 @@ Compiling and running tests is achieved by calling the following test scripts:
## Ice Cream Test Engine

The `ice.cream` module demonstrates how to write and register your own `TestEngine`
implementation using the Java Platform Module System.
implementation using a Java module descriptor.
This engine does not find any tests in containers, but _discovers_ a configurable
amount of ice cream scoops.

Expand Down
18 changes: 0 additions & 18 deletions junit-modular-world/build.jsh

This file was deleted.

57 changes: 0 additions & 57 deletions junit-modular-world/compile.jsh

This file was deleted.

20 changes: 20 additions & 0 deletions junit-modular-world/src/build/Build.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2015-2025 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
*
* https://www.eclipse.org/legal/epl-v20.html
*/

// default package

public class Build {
public static void main(String[] args) throws Exception {
Comment thread
marcphilipp marked this conversation as resolved.
var project = Project.ofCurrentWorkingDirectory();
project.clean();
project.compile();
project.test();
}
}
17 changes: 17 additions & 0 deletions junit-modular-world/src/build/Compile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2015-2025 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
*
* https://www.eclipse.org/legal/epl-v20.html
*/

// default package

public class Compile {
public static void main(String[] args) throws Exception {
Project.ofCurrentWorkingDirectory().compile();
}
}
Loading