Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project site links to javadoc #271

Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,23 @@
*
* <p>The key of the environment variable to be cleared must be specified via
* {@link #key()}. After the annotated element has been executed, After the
* annotated method has been executed, the initial default value is restored.
* annotated method has been executed, the initial default value is restored.</p>
*
* <p>{@code ClearEnvironmentVariable} is repeatable and can be used on the method and
* on the class level. If a class is annotated, the configured variable will be
* cleared for all tests inside that class.
* cleared for all tests inside that class.</p>
*
* <p>WARNING: Java considers environment variables to be immutable, so this extension
* uses reflection to change them. This requires that the {@link SecurityManager}
* allows modifications and can potentially break on different operating systems and
* Java versions. Be aware that this is a fragile solution and consider finding a
* better one for your specific situation. If you're running on Java 9 or later, you
* may have to add {@code --add-opens=java.base/java.util=ALL-UNNAMED} to your test
* execution to prevent warnings or even errors.
* execution to prevent warnings or even errors.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/environment-variables/" target="_top">the documentation on <code>@ClearEnvironmentVariable and @SetEnvironmentVariable</code></a>
* </p>
*
* @since 0.6
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
*
* <p>The key of the system property to be cleared must be specified via
* {@link #key()}. After the annotated element has been executed, After the
* annotated method has been executed, the initial default value is restored.
* annotated method has been executed, the initial default value is restored.</p>
*
* <p>{@code ClearSystemProperty} is repeatable and can be used on the method and
* on the class level. If a class is annotated, the configured property will be
* cleared for all tests inside that class.
* cleared for all tests inside that class.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/system-properties/" target="_top">the documentation on <code>@ClearSystemProperty and @SetSystemProperty</code></a>
* </p>
*
* @since 0.5
*/
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/junitpioneer/jupiter/DefaultLocale.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* returned by {@link java.util.Locale#getDefault()} for a test execution.
*
* <p>The {@link java.util.Locale} to set as the default locale can be
* configured in several ways:
* configured in several ways:</p>
*
* <ul>
* <li>using a {@link java.util.Locale#forLanguageTag(String) language tag}</li>
Expand All @@ -44,6 +44,10 @@
* {@code Locale} for all tests inside that class. Any method level
* configurations will override the class level default {@code Locale}.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/default-locale-timezone/" target="_top">the documentation on <code>@DefaultLocale and @DefaultTimeZone</code></a>
* </p>
*
* @since 0.2
* @see java.util.Locale#getDefault()
* @see DefaultTimeZone
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/junitpioneer/jupiter/DefaultTimeZone.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
* default {@code TimeZone} for all tests inside that class. Any method level
* configurations will override the class level default {@code TimeZone}.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/default-locale-timezone/" target="_top">the documentation on <code>@DefaultLocale and @DefaultTimeZone</code></a>
* </p>
*
* @since 0.2
* @see java.util.TimeZone#getDefault()
* @see DefaultLocale
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/junitpioneer/jupiter/RepeatFailedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* Each ignored/aborted or failed execution includes the underlying
* exception.
*
* <p>{@code @RepeatFailedTest} has a number of limitations:
* <p>{@code @RepeatFailedTest} has a number of limitations:</p>
*
* <ul>
* <li>it can only be applied to methods</li>
Expand All @@ -50,6 +50,10 @@
* <a href="https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution">parallel test execution</a></li>
* </ul>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/repeat-failed-test/" target="_top">the documentation on <code>@RepeatFailedTest</code></a>
* </p>
*
* @since 0.4
*/
@Target({ METHOD, ANNOTATION_TYPE })
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/junitpioneer/jupiter/ReportEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
* {@link org.junit.jupiter.api.extension.ExtensionContext#publishReportEntry(String, String) ExtensionContext::publishReportEntry}
* from within the test method.
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/report-entries/" target="_top">the documentation on <code>Report entries</code></a>
* </p>
*
* @since 0.5.6
*/
@Repeatable(ReportEntry.ReportEntries.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,24 @@
*
* <p>The key and value of the environment variable to be set must be specified via
* {@link #key()} and {@link #value()}. After the annotated method has been
* executed, the initial default value is restored.
* executed, the initial default value is restored.</p>
*
* <p>{@code SetEnvironmentVariable} is repeatable and can be used on the method and on
* the class level. If a class is annotated, the configured variable will be set
* for all tests inside that class. Any method level configurations will
* override the class level configurations.
* override the class level configurations.</p>
*
* <p>WARNING: Java considers environment variables to be immutable, so this extension
* uses reflection to change them. This requires that the {@link SecurityManager}
* allows modifications and can potentially break on different operating systems and
* Java versions. Be aware that this is a fragile solution and consider finding a
* better one for your specific situation. If you're running on Java 9 or later, you
* may have to add {@code --add-opens=java.base/java.util=ALL-UNNAMED} to your test
* execution to prevent warnings or even errors.
* execution to prevent warnings or even errors.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/environment-variables/" target="_top">the documentation on <code>@ClearEnvironmentVariable and @SetEnvironmentVariable</code></a>
* </p>
*
* @since 0.6
*/
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/junitpioneer/jupiter/SetSystemProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
*
* <p>The key and value of the system property to be set must be specified via
* {@link #key()} and {@link #value()}. After the annotated method has been
* executed, the initial default value is restored.
* executed, the initial default value is restored.</p>
*
* <p>{@code SetSystemProperty} is repeatable and can be used on the method and on
* the class level. If a class is annotated, the configured property will be set
* for all tests inside that class. Any method level configurations will
* override the class level configurations.
* override the class level configurations.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/system-properties/" target="_top">the documentation on <code>@ClearSystemProperty and @SetSystemProperty</code></a>
* </p>
*
* @since 0.5
*/
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/junitpioneer/jupiter/StdIOExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.ParameterResolver;

/**
* <p>For details and examples, see
* <a href="https://junit-pioneer.org/docs/standard-input-output/" target="_top">the documentation on <code>Standard input/output</code></a>
* </p>
*/
public class StdIOExtension implements ParameterResolver {

private static final String SEPARATOR = System.getProperty("line.separator");
Expand Down Expand Up @@ -68,6 +73,11 @@ private String[] getSourceValuesFromAnnotation(ExtensionContext context) {
StdIn.class.getName(), StdInSource.class.getName())));
}

/**
* <p>For details and examples, see
* <a href="https://junit-pioneer.org/docs/standard-input-output/" target="_top">the documentation on <code>Standard input/output</code></a>
* </p>
*/
public static class StdOut extends OutputStream {

Writer writer = new StringWriter();
Expand All @@ -88,6 +98,11 @@ public String[] capturedLines() {

}

/**
* <p>For details and examples, see
* <a href="https://junit-pioneer.org/docs/standard-input-output/" target="_top">the documentation on <code>Standard input/output</code></a>
* </p>
*/
public static class StdIn extends InputStream {

Reader reader;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/junitpioneer/jupiter/StdInSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* Provide values that the {@link StdIOExtension extension} will read instead of reading the
* standard input ({@code System.in}).
* This should be used with {@link org.junitpioneer.jupiter.StdIOExtension.StdIn}.
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/standard-input-output/" target="_top">the documentation on <code>Standard input/output</code></a>
* </p>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/junitpioneer/jupiter/TempDir.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
* <a href="https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-TempDirectory">
* built-in {@code @TempDir} extension</a>. If you don't need support for
* arbitrary file systems, you should consider using that instead of this
* extension.
* extension.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/temp-directory/" target="_top">the documentation on <code>TempDirectory</code></a>
* </p>
*
* @see TempDirectoryExtension
*/
Expand Down
24 changes: 14 additions & 10 deletions src/main/java/org/junitpioneer/jupiter/TempDirectoryExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* test class constructor has a parameter annotated with
* {@link TempDir @TempDir}. If the parameter type is not {@link Path} or if the
* temporary directory could not be created, this extension will throw a
* {@link ParameterResolutionException}.
* {@link ParameterResolutionException}.</p>
*
* <p>The scope of the temporary directory depends on where the first
* {@link TempDir @TempDir} annotation is encountered when executing a test
Expand All @@ -51,14 +51,14 @@
* constructor. Otherwise, e.g. when only used on test or
* {@link org.junit.jupiter.api.BeforeEach @BeforeEach} or
* {@link org.junit.jupiter.api.AfterEach @AfterEach} methods, each test will
* use its own temporary directory.
* use its own temporary directory.</p>
*
* <p>When the end of the scope of a temporary directory is reached, i.e. when
* the test method or class has finished execution, this extension will attempt
* to recursively delete all files and directories in the temporary directory
* and, finally, the temporary directory itself. In case deletion of a file or
* directory fails, this extension will throw an {@link IOException} that will
* cause the test to fail.
* cause the test to fail.</p>
*
* <p>By default, this extension will use the default
* {@link java.nio.file.FileSystem FileSystem} to create temporary directories
Expand All @@ -69,13 +69,17 @@
* to pass a custom provider to configure the parent directory for all temporary
* directories created by this extension. This allows the use of this extension
* with any third-party {@code FileSystem} implementation, e.g.
* <a href="https://github.com/google/jimfs">Jimfs</a>.
* <a href="https://github.com/google/jimfs">Jimfs</a>.</p>
*
* <p>Since JUnit Jupiter 5.4, there's a
* <a href="https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-TempDirectory">
* built-in {@code @TempDir} extension</a>. If you don't need support for
* arbitrary file systems, you should consider using that instead of this
* extension.
* extension.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/temp-directory/" target="_top">the documentation on <code>TempDirectory</code></a>
* </p>
*
* @since 0.1
* @see TempDir
Expand Down Expand Up @@ -113,7 +117,7 @@ public interface ParentDirProvider {
* <p>The temporary directory is by default created on the regular
* file system, but the user can also provide a custom file system
* by using the {@link ParentDirProvider}. An instance of
* {@code TempDirProvider} executes these (and possibly other) strategies.
* {@code TempDirProvider} executes these (and possibly other) strategies.</p>
*
* @see TempDirectoryExtension.ParentDirProvider
*/
Expand Down Expand Up @@ -141,7 +145,7 @@ private TempDirectoryExtension(TempDirProvider tempDirProvider) {
*
* <p>This constructor is used by the JUnit Jupiter Engine when the
* extension is registered via
* {@link org.junit.jupiter.api.extension.ExtendWith @ExtendWith}.
* {@link org.junit.jupiter.api.extension.ExtendWith @ExtendWith}.</p>
*/
public TempDirectoryExtension() {
this((__, ___, dirPrefix) -> createDefaultTempDir(dirPrefix));
Expand All @@ -155,7 +159,7 @@ public TempDirectoryExtension() {
* <p>You may use this factory method when registering this extension via
* {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension},
* although you might prefer the simpler registration via
* {@link org.junit.jupiter.api.extension.ExtendWith @ExtendWith}.
* {@link org.junit.jupiter.api.extension.ExtendWith @ExtendWith}.</p>
*
* @return a {@code TempDirectory} extension
*/
Expand All @@ -169,7 +173,7 @@ public static TempDirectoryExtension createInDefaultDirectory() {
* temporary directories created by this extension.
*
* <p>You may use this factory method when registering this extension via
* {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}.
* {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}.</p>
*
* @param parentDirProvider used to configure the parent directory for the
* temporary directories created by this extension
Expand All @@ -186,7 +190,7 @@ public static TempDirectoryExtension createInCustomDirectory(ParentDirProvider p
* directories created by this extension.
*
* <p>You may use this factory method when registering this extension via
* {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}.
* {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}.</p>
*
* @param parentDirProvider used to configure the parent directory for the
* temporary directories created by this extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* {@code @ByteRangeSource} is an {@link ArgumentsSource} that provides access to a range of {@code byte} values.
*
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/range-sources/" target="_top">the documentation on <code>Range Sources</code></a>
* </p>
*
* @since 0.5
* @see ArgumentsSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* {@code @DoubleRangeSource} is an {@link ArgumentsSource} that provides access to a range of {@code double} values.
*
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/range-sources/" target="_top">the documentation on <code>Range Sources</code></a>
* </p>
*
* @since 0.5
* @see ArgumentsSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* {@code @FloatRangeSource} is an {@link ArgumentsSource} that provides access to a range of {@code float} values.
*
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/range-sources/" target="_top">the documentation on <code>Range Sources</code></a>
* </p>
*
* @since 0.5
* @see ArgumentsSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* {@code @IntRangeSource} is an {@link ArgumentsSource} that provides access to a range of {@code int} values.
*
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/range-sources/" target="_top">the documentation on <code>Range Sources</code></a>
* </p>
*
* @since 0.5
* @see ArgumentsSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* {@code @LongRangeSource} is an {@link ArgumentsSource} that provides access to a range of {@code long} values.
*
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/range-sources/" target="_top">the documentation on <code>Range Sources</code></a>
* </p>
*
* @since 0.5
* @see ArgumentsSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* {@code @ShortRangeSource} is an {@link ArgumentsSource} that provides access to a range of {@code short} values.
*
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.
* <p>The supplied values will be provided as arguments to the annotated {@code @ParameterizedTest} method.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/range-sources/" target="_top">the documentation on <code>Range Sources</code></a>
* </p>
*
* @since 0.5
* @see ArgumentsSource
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/junitpioneer/vintage/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
*
* <p>Like JUnit 4's annotation it offers the possibility to {@link #expected() expect exceptions} and to
* {@link #timeout() time out} long running tests. The latter functions slightly different from the original - see the
* attached Javadoc.
* attached Javadoc.</p>
*
* <p>See {@link org.junit.jupiter.api.Test the official @Test} for more information regarding JUnit Jupiter integration.
* <p>See {@link org.junit.jupiter.api.Test the official @Test} for more information regarding JUnit Jupiter integration.</p>
*
* <p>For more details and examples, see
* <a href="https://junit-pioneer.org/docs/vintage-test/" target="_top">the documentation on <code>Vintage @Test</code></a>
* </p>
*
* @deprecated This annotation is an intermediate step on a full migration from JUnit 4's {@code @Test} to Jupiter's.
* To emphasize its character as a temporary solution and to reduce risk of accidental use, it's marked as deprecated.
Expand Down