Skip to content

Commit 861331a

Browse files
authored
refactoring/javadoc_for_testutils (#458)
* #431: Attempt to fix new Maven deployment. * #431: Removed upload of reproducible artifacts. Considered automatic with new deployment plugin. * #431: Fixed JavaDoc in testutils.
1 parent 6ddd95f commit 861331a

File tree

9 files changed

+58
-46
lines changed

9 files changed

+58
-46
lines changed

api/src/main/java/org/itsallcode/openfasttrace/api/core/LinkedSpecificationItem.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public List<String> getNeedsArtifactTypes()
247247
/**
248248
* Get the artifact type which are covered.
249249
*
250-
* @return the list of covered artifact types.
250+
* @return the set of covered artifact types.
251251
*/
252252
public Set<String> getCoveredArtifactTypes()
253253
{
@@ -265,9 +265,9 @@ public Set<String> getCoveredApprovedArtifactTypes()
265265
}
266266

267267
/**
268-
* Get a list of all artifact types that have unwanted coverage.
268+
* Get a set of all artifact types that have unwanted coverage.
269269
*
270-
* @return list of over-covered artifact types.
270+
* @return set of over-covered artifact types.
271271
*/
272272
public Set<String> getOverCoveredArtifactTypes()
273273
{
@@ -400,9 +400,9 @@ private List<LinkedSpecificationItem> getIncomingItems()
400400

401401
/**
402402
* Check if the item is defect.
403-
*
404-
* An item counts a defect if the following applies:
405-
*
403+
* <p>
404+
* An item counts as a defect if the following applies:
405+
* </p>
406406
* <pre>
407407
* has duplicates
408408
* or (not rejected

doc/changes/changes_4.2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OpenFastTrace 4.2.0, released 2025-06-09
1+
# OpenFastTrace 4.2.0, released 2025-06-13
22

33
Code name: Markdown code blocks
44

pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
We use the minimal timestamp to suppress a warning by artifact:compare. -->
1717
<project.build.outputTimestamp>1980-01-01T00:00:02Z</project.build.outputTimestamp>
1818
</properties>
19-
<prerequisites>
20-
<maven>3.9.9</maven>
21-
</prerequisites>
2219
<modules>
2320
<module>parent</module>
2421
<module>api</module>

testutil/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@
6666
</compilerArgs>
6767
</configuration>
6868
</plugin>
69-
<plugin>
70-
<groupId>org.apache.maven.plugins</groupId>
71-
<artifactId>maven-javadoc-plugin</artifactId>
72-
<configuration>
73-
<!-- This module is only used in tests, so we don't need javadoc comments. -->
74-
<skip>true</skip>
75-
</configuration>
76-
</plugin>
7769
<plugin>
7870
<groupId>org.apache.maven.plugins</groupId>
7971
<artifactId>maven-deploy-plugin</artifactId>

testutil/src/main/java/org/itsallcode/openfasttrace/testutil/OsCheck.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ public OsCheck()
3333
*/
3434
public enum OSType
3535
{
36-
WINDOWS, MACOS, LINUX, OTHER
36+
/** Windows OS */
37+
WINDOWS,
38+
/** macOS */
39+
MACOS,
40+
/** Linux */
41+
LINUX,
42+
/** Any other operating system */
43+
OTHER
3744
}
3845

3946
/**

testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImportAssertions.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private ImportAssertions()
3535
* content to be imported
3636
* @param matcher
3737
* matcher that defines expectation for imported data
38+
* @param importerFactory
39+
* factory that generates the importer
3840
*/
3941
public static void assertImportWithFactory(final Path path, final String input,
4042
final Matcher<Iterable<? extends SpecificationItem>> matcher,
@@ -44,7 +46,8 @@ public static void assertImportWithFactory(final Path path, final String input,
4446
}
4547

4648
/**
47-
* Run an importer on the given text and return the imported specification items.
49+
* Run an importer on the given text and return the imported specification
50+
* items.
4851
*
4952
* @param path
5053
* path to use for the input file

testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImporterFactoryTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected ImporterFactoryTestBase()
4242
}
4343

4444
@BeforeEach
45-
public void initMocks()
45+
void initMocks()
4646
{
4747
lenient().when(this.contextMock.getImportSettings()).thenReturn(ImportSettings.createDefault());
4848
}

testutil/src/main/java/org/itsallcode/openfasttrace/testutil/matcher/StringRegexpMatcher.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,23 @@
99
*/
1010
public class StringRegexpMatcher extends SubstringMatcher
1111
{
12+
/**
13+
* Create a new instance of the {@link StringRegexpMatcher}.
14+
*
15+
* @param regexp regular expression to match against
16+
*/
1217
public StringRegexpMatcher(final String regexp)
1318
{
1419
super("contains regexp", false, regexp);
1520
}
1621

22+
/**
23+
* Check if the substring matches the given value with newlines removed.
24+
*
25+
* @param value value to match the substring against
26+
*
27+
* @return {@code true} if the given value matches the substring
28+
*/
1729
protected boolean evalSubstringOf(final String value)
1830
{
1931
return Pattern.matches(this.substring, value.replace("\n", ""));

testutil/src/main/java/org/itsallcode/openfasttrace/testutil/xml/IndentingXMLStreamWriter.java

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,29 @@
33
import javax.xml.stream.XMLStreamException;
44
import javax.xml.stream.XMLStreamWriter;
55

6+
/**
7+
* A stream writer for XML that adds indentation.
8+
*/
69
public class IndentingXMLStreamWriter extends StreamWriterDelegate
710
{
8-
/** Two spaces; the default indentation. */
9-
public static final String DEFAULT_INDENT = " ";
10-
11-
/**
12-
* "\n"; the normalized end-of-line representation in
13-
* <a href="http://www.w3.org/TR/xml11/#sec-line-ends">XML</a>.
14-
*/
15-
public static final String NORMAL_END_OF_LINE = "\n";
16-
1711
private static final int WROTE_MARKUP = 1;
18-
1912
private static final int WROTE_DATA = 2;
20-
2113
private final String indent;
22-
2314
private final String newLine;
24-
2515
/** How deeply nested the current scope is. The root element is depth 1. */
2616
private int depth = 0; // document scope
27-
2817
/** stack[depth] indicates what's been written into the current scope. */
2918
private int[] stack = new int[] { 0, 0, 0, 0 }; // nothing written yet
30-
3119
/** Prefix that defines how deeply a line is indented. */
3220
private char[] linePrefix = null;
3321

34-
public IndentingXMLStreamWriter(final XMLStreamWriter out)
35-
{
36-
this(out, DEFAULT_INDENT, NORMAL_END_OF_LINE);
37-
}
38-
22+
/**
23+
* Create a new instance of the {@link IndentingXMLStreamWriter}.
24+
*
25+
* @param out stream writer to output to
26+
* @param indent string used as the indentation prefix
27+
* @param newLine newline character (for platform-specific output)
28+
*/
3929
public IndentingXMLStreamWriter(final XMLStreamWriter out, final String indent,
4030
final String newLine)
4131
{
@@ -205,7 +195,8 @@ public void writeEndDocument() throws XMLStreamException
205195
/**
206196
* Prepare to write markup by writing a new line and indentation.
207197
*
208-
* @throws XMLStreamException here for interface compatibility only
198+
* @throws XMLStreamException
199+
* here for interface compatibility only
209200
*/
210201
protected void beforeMarkup() throws XMLStreamException
211202
{
@@ -236,7 +227,8 @@ protected void afterData()
236227
/**
237228
* Prepare to start an element by allocating stack space.
238229
*
239-
* @throws XMLStreamException here for interface compatibility only
230+
* @throws XMLStreamException
231+
* here for interface compatibility only
240232
*/
241233
protected void beforeStartElement() throws XMLStreamException
242234
{
@@ -261,7 +253,8 @@ protected void afterStartElement()
261253
/**
262254
* Prepare to end an element by writing a new line and indentation.
263255
*
264-
* @throws XMLStreamException here for interface compatibility only
256+
* @throws XMLStreamException
257+
* here for interface compatibility only
265258
*/
266259
protected void beforeEndElement() throws XMLStreamException
267260
{
@@ -283,7 +276,8 @@ protected void afterEndElement()
283276
/**
284277
* Note that a document was ended.
285278
*
286-
* @throws XMLStreamException here for interface compatibility only
279+
* @throws XMLStreamException
280+
* here for interface compatibility only
287281
*/
288282
protected void afterEndDocument() throws XMLStreamException
289283
{
@@ -295,7 +289,14 @@ protected void afterEndDocument() throws XMLStreamException
295289
this.stack[this.depth] = 0; // start fresh
296290
}
297291

298-
/** Write a line separator followed by indentation. */
292+
/**
293+
* Write an indented line.
294+
*
295+
* @param indentation
296+
* indentation depth
297+
* @throws XMLStreamException
298+
* if the underlying {@link XMLStreamWriter} has a problem
299+
*/
299300
protected void writeNewLine(final int indentation) throws XMLStreamException
300301
{
301302
final int newLineLength = this.newLine.length();

0 commit comments

Comments
 (0)