Add @since tag to classes in unittests package

This commit is contained in:
JeremyStar™ 2024-06-28 01:11:55 +02:00
parent f5075b9832
commit bba645f69b
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 22 additions and 4 deletions

View file

@ -23,18 +23,23 @@ import de.staropensource.sosengine.base.classes.logging.LogLevel;
/** /**
* Static configuration for the sos!engine unit testing helpers. * Static configuration for the sos!engine unit testing helpers.
*
* @since 1-alpha0
*/ */
public class UnitConfig { public class UnitConfig {
/** /**
* Constructor. * Constructor.
*
* @since 1-alpha0
*/ */
public UnitConfig() {} public UnitConfig() {}
/** /**
* Configures the {@link LogLevel} for the {@link UnitLogger}.<br/> * Configures the {@link LogLevel} for the {@link UnitLogger}.<br/>
* Note: The log level {@code SILENT_WARNING} is used for printing test calls. * Note: The log level {@code SILENT_WARNING} has been repurposed for printing test calls.
* *
* @see de.staropensource.sosengine.base.logging.Logger * @see UnitLogger
* @since 1-alpha0
*/ */
public static LogLevel loggerLevel = LogLevel.SILENT_WARNING; public static LogLevel loggerLevel = LogLevel.SILENT_WARNING;
} }

View file

@ -27,11 +27,15 @@ import java.util.List;
/** /**
* Provides a extremely dead simple logging system for unit tests. * Provides a extremely dead simple logging system for unit tests.
*
* @since 1-alpha0
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class UnitLogger { public class UnitLogger {
/** /**
* The parent class. * The parent class.
*
* @since 1-alpha0
*/ */
private final Class<?> clazz; private final Class<?> clazz;
@ -39,6 +43,7 @@ public class UnitLogger {
* Constructor. * Constructor.
* *
* @param clazz parent class * @param clazz parent class
* @since 1-alpha0
*/ */
public UnitLogger(Class<?> clazz) { public UnitLogger(Class<?> clazz) {
this.clazz = clazz; this.clazz = clazz;
@ -47,8 +52,10 @@ public class UnitLogger {
/** /**
* Prints a log message. * Prints a log message.
* *
* @param level log level * @param level log level
* @param message log message (and arguments if called with level {@code SILENT_WARNING}) * @param message log message
* @param additionalStuff additional arguments
* @since 1-alpha0
*/ */
private void log(@NotNull LogLevel level, @NotNull String message, List<@Nullable Object> additionalStuff) { private void log(@NotNull LogLevel level, @NotNull String message, List<@Nullable Object> additionalStuff) {
String messageSingle = message; String messageSingle = message;
@ -93,6 +100,7 @@ public class UnitLogger {
* Prints a diagnostic message. * Prints a diagnostic message.
* *
* @param message diagnostic log message * @param message diagnostic log message
* @since 1-alpha0
*/ */
public void diag(@NotNull String message) { public void diag(@NotNull String message) {
log(LogLevel.DIAGNOSTIC, message, null); log(LogLevel.DIAGNOSTIC, message, null);
@ -102,6 +110,7 @@ public class UnitLogger {
* Prints a verbose message. * Prints a verbose message.
* *
* @param message verbose log message * @param message verbose log message
* @since 1-alpha0
*/ */
public void verb(@NotNull String message) { public void verb(@NotNull String message) {
log(LogLevel.VERBOSE, message, null); log(LogLevel.VERBOSE, message, null);
@ -112,6 +121,7 @@ public class UnitLogger {
* *
* @param methodName name of the test method called * @param methodName name of the test method called
* @param methodArgs arguments of the test method called * @param methodArgs arguments of the test method called
* @since 1-alpha0
*/ */
public void testCall(@NotNull String methodName, @Nullable Object ... methodArgs) { public void testCall(@NotNull String methodName, @Nullable Object ... methodArgs) {
log(LogLevel.SILENT_WARNING, methodName, List.of(methodArgs)); log(LogLevel.SILENT_WARNING, methodName, List.of(methodArgs));
@ -121,6 +131,7 @@ public class UnitLogger {
* Prints a informational message. * Prints a informational message.
* *
* @param message informational log message * @param message informational log message
* @since 1-alpha0
*/ */
public void info(@NotNull String message) { public void info(@NotNull String message) {
log(LogLevel.INFORMATIONAL, message, null); log(LogLevel.INFORMATIONAL, message, null);
@ -130,6 +141,7 @@ public class UnitLogger {
* Prints a warning message. * Prints a warning message.
* *
* @param message warning log message * @param message warning log message
* @since 1-alpha0
*/ */
public void warn(@NotNull String message) { public void warn(@NotNull String message) {
log(LogLevel.WARNING, message, null); log(LogLevel.WARNING, message, null);
@ -139,6 +151,7 @@ public class UnitLogger {
* Prints a error message. * Prints a error message.
* *
* @param message error log message * @param message error log message
* @since 1-alpha0
*/ */
public void error(@NotNull String message) { public void error(@NotNull String message) {
log(LogLevel.ERROR, message, null); log(LogLevel.ERROR, message, null);