diff --git a/api/src/main/java/org/itsallcode/openfasttrace/api/core/SpecificationItemId.java b/api/src/main/java/org/itsallcode/openfasttrace/api/core/SpecificationItemId.java index 1ac7c91b..39d35b93 100644 --- a/api/src/main/java/org/itsallcode/openfasttrace/api/core/SpecificationItemId.java +++ b/api/src/main/java/org/itsallcode/openfasttrace/api/core/SpecificationItemId.java @@ -32,8 +32,10 @@ public final class SpecificationItemId implements Comparable serviceLoader when(serviceLoaderMock.stream()).thenReturn(Stream.of(providerMock)); when(providerMock.get()).thenReturn(service); when(originMock.getClassLoader()).thenReturn(DummyServiceImpl.class.getClassLoader()); - final List services = new ClassPathServiceLoader<>(originMock, serviceLoaderMock) - .load().toList(); - assertThat(services, contains(sameInstance(service))); + try (ClassPathServiceLoader loader = new ClassPathServiceLoader<>(originMock, serviceLoaderMock)) + { + final List services = loader.load().toList(); + assertThat(services, contains(sameInstance(service))); + } } @Test void loadingIgnoresServicesFromOtherClassLoaders(@Mock final ServiceLoader serviceLoaderMock, @Mock final Provider providerMock, @Mock final ServiceOrigin originMock, - @Mock ClassLoader classLoaderMock) + @Mock final ClassLoader classLoaderMock) { final DummyServiceImpl service = new DummyServiceImpl(); when(serviceLoaderMock.stream()).thenReturn(Stream.of(providerMock)); when(providerMock.get()).thenReturn(service); when(originMock.getClassLoader()).thenReturn(classLoaderMock); - final List services = new ClassPathServiceLoader<>(originMock, serviceLoaderMock) - .load().toList(); - assertThat(services, empty()); + try (ClassPathServiceLoader loader = new ClassPathServiceLoader<>(originMock, serviceLoaderMock)) + { + final List services = loader.load().toList(); + assertThat(services, empty()); + } } interface DummyService diff --git a/core/src/test/java/org/itsallcode/openfasttrace/core/serviceloader/ServiceMock.java b/core/src/test/java/org/itsallcode/openfasttrace/core/serviceloader/ServiceMock.java deleted file mode 100644 index 6f511181..00000000 --- a/core/src/test/java/org/itsallcode/openfasttrace/core/serviceloader/ServiceMock.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.itsallcode.openfasttrace.core.serviceloader; - -public @interface ServiceMock -{ - // Service mock interface -} diff --git a/doc/changes/changes_4.12.0.md b/doc/changes/changes_4.12.0.md index 1be6217e..4efa6cc9 100644 --- a/doc/changes/changes_4.12.0.md +++ b/doc/changes/changes_4.12.0.md @@ -1,6 +1,6 @@ -# OpenFastTrace 4.12.0, released 2026-11-26 +# OpenFastTrace 4.12.0, released 2026-11-27 -Code name: Syntax usability and JSX and TSX tag importer +Code name: Native images, syntax usability, JSX and TSX tag importer ## Summary diff --git a/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java b/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java index df5fd6a8..f7cb4437 100644 --- a/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java +++ b/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java @@ -48,7 +48,7 @@ void testIdentifyNonId(final String text) // [utest->dsn~md.specification-item-title~1] @ParameterizedTest @CsvSource( - { "#Title", "# Title", "###### Title", "# Title", "# Änderung" }) + { "'#Title'", "'# Title'", "'###### Title'", "'# Title'", "'# Änderung'" }) void testIdentifyTitle(final String text) { MarkdownAsserts.assertMatch(MdPattern.TITLE, text); @@ -73,7 +73,7 @@ void testIdentifyNeeds(final String text) @ParameterizedTest @CsvSource( - { "Needs:", "#Needs: abc", "' Needs: abc'", "Needs: önderung" }) + { "Needs:", "'#Needs: abc'", "' Needs: abc'", "Needs: önderung" }) void testIdentifyNonNeeds(final String text) { MarkdownAsserts.assertMismatch(MdPattern.NEEDS_INT, text); @@ -90,7 +90,7 @@ void testIdentifyTags(final String text) // Note that this test does not evaluate the validity of the tags themselves. Only if the tags-marker is present. @ParameterizedTest @CsvSource( - { "Tags:", "#Needs: abc", "' Needs: abc'", "Needs: änderung", }) + { "Tags:", "'#Needs: abc'", "' Needs: abc'", "Needs: änderung", }) void testIdentifyNonTags(final String text) { MarkdownAsserts.assertMismatch(MdPattern.TAGS_INT, text); @@ -98,7 +98,8 @@ void testIdentifyNonTags(final String text) // [utest->dsn~md.covers-single-line~1] @ParameterizedTest - @ValueSource(strings = { "Covers: req~foo~1", "Covers: `req~foo~1`", "Covers:req~foo~1", + @ValueSource(strings = + { "Covers: req~foo~1", "Covers: `req~foo~1`", "Covers:req~foo~1", "Covers: \treq~foo~1 ", "Covers: req~foo~1, req~bar~2", "Covers: `req~foo~1`, `req~bar~2`" }) void testIdentifyCoversInline(final String text) { @@ -107,7 +108,8 @@ void testIdentifyCoversInline(final String text) // [utest->dsn~md.covers-single-line~1] @ParameterizedTest - @ValueSource(strings = { "Covers:", "#Covers: req~foo~1", " Covers: req~foo~1", "Covers: abc", + @ValueSource(strings = + { "Covers:", "#Covers: req~foo~1", " Covers: req~foo~1", "Covers: abc", "Covers; req~foo~1", "Covers req~foo~1", "Covers: req~foo~1 req~bar~2", "Covers: req~foo~1; req~bar~2", "Covers: someone~forgot~1a~comma-1", "Covers: `req~foo~1", "Covers: req~foo~1`" }) diff --git a/native-image/pom.xml b/native-image/pom.xml index 10f84ede..34bcf4a8 100644 --- a/native-image/pom.xml +++ b/native-image/pom.xml @@ -75,7 +75,7 @@ org.graalvm.buildtools native-maven-plugin - 1.1.19 + 1.1.20 build-native-image diff --git a/parent/pom.xml b/parent/pom.xml index 1a31f23b..f9718d04 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -9,9 +9,8 @@ pom https://github.com/itsallcode/openfasttrace - 4.11.0 + 4.12.0 17 - 6.1.0-M1 6.1.3 3.6.1 UTF-8 @@ -223,7 +222,7 @@ org.mockito mockito-junit-jupiter - 5.24.0 + 5.25.0 test @@ -538,6 +537,23 @@ org.codehaus.mojo versions-maven-plugin 2.23.0 + + + + + net.sourceforge.plantuml + plantuml + + + regex + + [0-9]{4,}(\..*)? + + + + + + @@ -677,9 +693,9 @@ - com.github.jeluard + org.itsallcode plantuml-maven-plugin - 1.2 + 0.2 ${basedir}/model/diagrams @@ -694,7 +710,7 @@ net.sourceforge.plantuml plantuml - 1.2026.9 + 1.2026.10 diff --git a/pom.xml b/pom.xml index 0f1e0bcc..d1172961 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 5.8.0.7211 + 5.9.0.7382 diff --git a/testutil/src/main/java/module-info.java b/testutil/src/main/java/module-info.java index ab554b94..f0a661b9 100644 --- a/testutil/src/main/java/module-info.java +++ b/testutil/src/main/java/module-info.java @@ -18,7 +18,7 @@ requires transitive org.junit.jupiter.params; requires transitive org.mockito; requires transitive org.mockito.junit.jupiter; - requires java.logging; + requires transitive java.logging; requires transitive java.xml; - requires org.itsallcode.openfasttrace.api; + requires transitive org.itsallcode.openfasttrace.api; } diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/core/ItemBuilderFactory.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/core/ItemBuilderFactory.java index 84117f59..6c79a229 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/core/ItemBuilderFactory.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/core/ItemBuilderFactory.java @@ -1,54 +1,65 @@ package org.itsallcode.openfasttrace.testutil.core; import org.itsallcode.openfasttrace.api.core.SpecificationItem; +import org.itsallcode.openfasttrace.api.core.SpecificationItem.Builder; import org.itsallcode.openfasttrace.api.core.SpecificationItemId; /** - * The {@link ItemBuilderFactory} class provides convenience methods for creating instances of {@link SpecificationItem}. + * The {@link ItemBuilderFactory} class provides convenience methods for creating instances of + * {@link SpecificationItem}. */ -public final class ItemBuilderFactory { - private ItemBuilderFactory() { +public final class ItemBuilderFactory +{ + private ItemBuilderFactory() + { // prevent instantiation. } /** - * Creates a new instance of {@link SpecificationItem.Builder}. + * Creates a new instance of {@link Builder}. * - * @return a new instance of {@link SpecificationItem.Builder} + * @return a new instance of {@link Builder} */ - public static SpecificationItem.Builder item() { + public static Builder item() + { return SpecificationItem.builder(); } /** - * Creates a new instance of {@link SpecificationItem.Builder} with the specified ID. + * Creates a new instance of {@link Builder} with the specified ID. * - * @param id ID of the specification item + * @param id + * ID of the specification item * - * @return a new instance of {@link SpecificationItem.Builder} with the specified ID + * @return a new instance of {@link Builder} with the specified ID */ - public static SpecificationItem.Builder itemWithId(SpecificationItemId id) { + public static Builder itemWithId(final SpecificationItemId id) + { return SpecificationItem.builder().id(id); } /** - * Returns a new instance of {@link SpecificationItem.Builder} with the default filename and the specified line. + * Returns a new instance of {@link Builder} with the default filename and the specified line. * - * @param line line number of the specification item in the file + * @param line + * line number of the specification item in the file * - * @return a new instance of {@link SpecificationItem.Builder} with the default filename and the specified line + * @return a new instance of {@link Builder} with the default filename and the specified line */ - public static SpecificationItem.Builder itemWithDefaultFilenameInLine(final int line) { + public static Builder itemWithDefaultFilenameInLine(final int line) + { return SpecificationItem.builder().location("file", line); } /** * Creates a copy of an item without source locations on its IDs. * - * @param item item to copy + * @param item + * item to copy * @return copy without source locations on its IDs */ - public static SpecificationItem withoutIdLocations(final SpecificationItem item) { + public static SpecificationItem withoutIdLocations(final SpecificationItem item) + { return item.toBuilder() .id(item.getId()) .coveredIds(item.getCoveredIds())