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
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ are always welcome!
- Implements in-memory file management compatible with the NIO Path and
FileSystem API, enabling tests to run without write access to the host
system, and without awkward resource-cleanup logic.
- Ability to run compilation on combinations of real files, class path
resources, and in-memory files.
- Enables running compilations on combinations of real files, class path
resources, in-memory files, JARs, WARs, EARs, ZIP files, etc.
- Supports Java 9 JPMS modules as intended.
- Ability to customise a large assortment of configuration parameters
to enable you to test exactly what you need to test.
Expand All @@ -52,14 +52,15 @@ are always welcome!
- Implements a fully functional JSR-199 Path JavaFileManager.
- Fluent syntax for creating configurations, executing them, and
inspecting the results.
- Integration with AssertJ for fluent assertions on compilation
results.
- Integration with [AssertJ](https://joel-costigliola.github.io/assertj/)
for fluent assertions on compilation results.
- Ability to have multiple source roots, just like when using
`javac` normally.
- Diagnostic reporting includes stacktraces, so you can find out
- Diagnostic reporting includes stack traces, so you can find out
exactly what triggered a diagnostic and begin debugging any
issues in your applications quickly.
- Helpful error messages to assist in annotation processor development
- Null-safe API (using [JSpecify](https://jspecify.dev/))

```
[main] ERROR io.github.ascopes.jct.diagnostics.TracingDiagnosticListener - cannot find symbol
Expand Down
13 changes: 6 additions & 7 deletions java-compiler-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
</description>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
Expand All @@ -66,6 +59,12 @@
<artifactId>assertj-core</artifactId>
</dependency>

<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<!-- Used to provide convenience annotations -->
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
import io.github.ascopes.jct.containers.ContainerGroup;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.AbstractListAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.ObjectAssert;
import org.jspecify.annotations.Nullable;

/**
* Base assertions that can be performed on a container group.
Expand All @@ -40,7 +38,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public abstract class AbstractContainerGroupAssert<I extends AbstractContainerGroupAssert<I, C>, C extends ContainerGroup>
extends AbstractAssert<I, C> {

Expand Down Expand Up @@ -68,7 +65,6 @@ protected AbstractContainerGroupAssert(@Nullable C containerGroup, Class<?> self
* @return the assertions to perform.
* @throws AssertionError if the object being asserted upon is null.
*/
@CheckReturnValue
public LocationAssert location() {
isNotNull();
return new LocationAssert(actual.getLocation());
Expand All @@ -83,7 +79,6 @@ public LocationAssert location() {
* @throws AssertionError if the object being asserted upon is null.
* @throws NullPointerException if the provided class parameter is null.
*/
@CheckReturnValue
public <T> AbstractListAssert<?, List<? extends T>, T, ? extends ObjectAssert<T>> services(
Class<T> clazz
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
import io.github.ascopes.jct.utils.IterableUtils;
import java.util.List;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.assertj.core.api.AbstractAssert;
import org.jspecify.annotations.Nullable;

/**
* Abstract base class for an assertion on an {@link Enum}.
Expand All @@ -37,7 +36,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public abstract class AbstractEnumAssert<A extends AbstractEnumAssert<A, E>, E extends Enum<E>>
extends AbstractAssert<A, E> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
import java.nio.charset.CharsetDecoder;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import javax.tools.JavaFileObject;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
Expand All @@ -37,6 +34,7 @@
import org.assertj.core.api.AbstractInstantAssert;
import org.assertj.core.api.AbstractStringAssert;
import org.assertj.core.api.AbstractUriAssert;
import org.jspecify.annotations.Nullable;

/**
* Abstract assertions for {@link JavaFileObject Java file objects}.
Expand All @@ -47,7 +45,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public abstract class AbstractJavaFileObjectAssert<I extends AbstractJavaFileObjectAssert<I, A>, A extends JavaFileObject>
extends AbstractAssert<I, A> {

Expand All @@ -67,7 +64,6 @@ protected AbstractJavaFileObjectAssert(@Nullable A actual, Class<?> selfType) {
* @return the URI assertion.
* @throws AssertionError if the actual value is null.
*/
@CheckReturnValue
public AbstractUriAssert<?> uri() {
isNotNull();
return assertThat(actual.toUri());
Expand All @@ -79,7 +75,6 @@ public AbstractUriAssert<?> uri() {
* @return the string assertion.
* @throws AssertionError if the actual value is null.
*/
@CheckReturnValue
public AbstractStringAssert<?> name() {
isNotNull();
return assertThat(actual.getName());
Expand All @@ -91,7 +86,6 @@ public AbstractStringAssert<?> name() {
* @return the byte array assertion.
* @throws AssertionError if the actual value is null.
*/
@CheckReturnValue
public AbstractByteArrayAssert<?> binaryContent() {
isNotNull();
return assertThat(rawContent());
Expand All @@ -105,7 +99,6 @@ public AbstractByteArrayAssert<?> binaryContent() {
* @throws AssertionError if the actual value is null.
* @throws UncheckedIOException if an IO error occurs reading the file content.
*/
@CheckReturnValue
public AbstractStringAssert<?> content() {
return content(StandardCharsets.UTF_8);
}
Expand All @@ -119,7 +112,6 @@ public AbstractStringAssert<?> content() {
* @throws NullPointerException if the charset parameter is null.
* @throws UncheckedIOException if an IO error occurs reading the file content.
*/
@CheckReturnValue
public AbstractStringAssert<?> content(Charset charset) {
requireNonNull(charset, "charset must not be null");
return content(charset.newDecoder());
Expand All @@ -134,7 +126,6 @@ public AbstractStringAssert<?> content(Charset charset) {
* @throws NullPointerException if the charset decoder parameter is null.
* @throws UncheckedIOException if an IO error occurs reading the file content.
*/
@CheckReturnValue
public AbstractStringAssert<?> content(CharsetDecoder charsetDecoder) {
requireNonNull(charsetDecoder, "charsetDecoder must not be null");
isNotNull();
Expand All @@ -155,7 +146,6 @@ public AbstractStringAssert<?> content(CharsetDecoder charsetDecoder) {
* @return the instant assertion.
* @throws AssertionError if the actual value is null.
*/
@CheckReturnValue
public AbstractInstantAssert<?> lastModified() {
isNotNull();

Expand All @@ -169,7 +159,6 @@ public AbstractInstantAssert<?> lastModified() {
* @return the assertions for the kind.
* @throws AssertionError if the actual value is null.
*/
@CheckReturnValue
public JavaFileObjectKindAssert kind() {
isNotNull();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/
package io.github.ascopes.jct.assertions;

import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.assertj.core.api.AbstractAssert;
import org.jspecify.annotations.Nullable;

/**
* Assertions to perform on a classloader.
Expand All @@ -31,7 +30,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public final class ClassLoaderAssert extends AbstractAssert<ClassLoaderAssert, ClassLoader> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
package io.github.ascopes.jct.assertions;

import java.util.Set;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import javax.tools.Diagnostic.Kind;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.jspecify.annotations.Nullable;

/**
* Assertions for an individual diagnostic kind.
Expand All @@ -29,7 +28,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public final class DiagnosticKindAssert
extends AbstractEnumAssert<DiagnosticKindAssert, Kind> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/
package io.github.ascopes.jct.assertions;

import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import javax.tools.JavaFileObject;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.jspecify.annotations.Nullable;

/**
* Assertions for {@link JavaFileObject Java file objects}.
Expand All @@ -28,7 +27,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public final class JavaFileObjectAssert
extends AbstractJavaFileObjectAssert<JavaFileObjectAssert, JavaFileObject> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@

import static org.assertj.core.api.Assertions.assertThat;

import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import javax.tools.JavaFileObject.Kind;
import org.apiguardian.api.API;
import org.apiguardian.api.API.Status;
import org.assertj.core.api.AbstractStringAssert;
import org.jspecify.annotations.Nullable;

/**
* Assertions for an individual {@link Kind Java file object kind}.
Expand All @@ -32,7 +30,6 @@
* @since 0.0.1
*/
@API(since = "0.0.1", status = Status.STABLE)
@NotThreadSafe
public final class JavaFileObjectKindAssert
extends AbstractEnumAssert<JavaFileObjectKindAssert, Kind> {

Expand Down Expand Up @@ -91,7 +88,6 @@ public JavaFileObjectKindAssert isOther() {
* @return the assertions for the file extension of the kind.
* @throws AssertionError if the kind is null.
*/
@CheckReturnValue
public AbstractStringAssert<?> extension() {
isNotNull();

Expand Down
Loading