Skip to content

Introduce org.junit.onramp module #4982

@sormuras

Description

@sormuras

In Paving the on-ramp Brian Goetz explains the goal and role of Java's on-ramp in great detail. Most of the topics were recently shipped in JDK 25:

  • JEP 511: Module Import Declarations
  • JEP 512: Compact Source Files and Instance Main Methods
void main() {
  IO.println("Hello World");
}

Let's introduce an org.junit.onramp module to allow users to write minimal HelloJUnit.java source programs:

import module org.junit.onramp;

void main() {
  JUnit.run(this);
}

@Test
void stringLength() {
  Assertions.assertEquals(11, "Hello JUnit".length());
}

Work-in-progress API definition:

module org.junit.onramp {
	requires static transitive org.apiguardian.api;
	requires static transitive org.jspecify;

	requires transitive org.junit.jupiter; // for writing tests
	requires org.junit.platform.launcher;  // for running tests

	exports org.junit.onramp; // with sole `JUnit` class
}

Deliverables

  • Commit to the module name org.junit.onramp or find a better one.
  • Include a minimal JUnit.java implementation and documentation.
  • Update User Guide describing the purpose and usage of the new module.
  • Update build to test and deploy the new module.

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions