Skip to content

Commit f78b733

Browse files
authored
Enable javadoc plugin and generates javadoc for libs (#26)
Signed-off-by: David Kornel <kornys@outlook.com>
1 parent a32aea0 commit f78b733

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1343
-203
lines changed

pom.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,24 @@
176176

177177
<build>
178178
<plugins>
179-
<!-- <plugin>-->
180-
<!-- <groupId>org.apache.maven.plugins</groupId>-->
181-
<!-- <artifactId>maven-javadoc-plugin</artifactId>-->
182-
<!-- <version>${maven.javadoc.version}</version>-->
183-
<!-- <executions>-->
184-
<!-- <execution>-->
185-
<!-- <id>attach-javadocs</id>-->
186-
<!-- <goals>-->
187-
<!-- <goal>jar</goal>-->
188-
<!-- </goals>-->
189-
<!-- <configuration>-->
190-
<!-- <show>public</show>-->
191-
<!-- <failOnError>true</failOnError>-->
192-
<!-- <failOnWarnings>true</failOnWarnings>-->
193-
<!-- </configuration>-->
194-
<!-- </execution>-->
195-
<!-- </executions>-->
196-
<!-- </plugin>-->
179+
<plugin>
180+
<groupId>org.apache.maven.plugins</groupId>
181+
<artifactId>maven-javadoc-plugin</artifactId>
182+
<version>${maven.javadoc.version}</version>
183+
<executions>
184+
<execution>
185+
<id>attach-javadocs</id>
186+
<goals>
187+
<goal>jar</goal>
188+
</goals>
189+
<configuration>
190+
<show>public</show>
191+
<failOnError>true</failOnError>
192+
<failOnWarnings>true</failOnWarnings>
193+
</configuration>
194+
</execution>
195+
</executions>
196+
</plugin>
197197
<plugin>
198198
<groupId>org.apache.maven.plugins</groupId>
199199
<artifactId>maven-checkstyle-plugin</artifactId>

test-frame-common/src/main/java/io/skodjob/testframe/LoggerUtils.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,41 @@
99
import org.slf4j.Logger;
1010
import org.slf4j.LoggerFactory;
1111

12+
/**
13+
* Utility methods for logging.
14+
*/
1215
public class LoggerUtils {
1316

1417
private static final Logger LOGGER = LoggerFactory.getLogger(LoggerUtils.class);
1518
static final String SEPARATOR_CHAR = "#";
1619

20+
/**
21+
* Pattern for logging resource information without namespace.
22+
*/
1723
public static final String RESOURCE_LOGGER_PATTERN = "{} {}/{}";
24+
25+
/**
26+
* Pattern for logging resource information with namespace.
27+
*/
1828
public static final String RESOURCE_WITH_NAMESPACE_LOGGER_PATTERN = "{} {}/{} in {}";
1929

30+
private LoggerUtils() {
31+
// All static methods
32+
}
33+
34+
/**
35+
* Logs a separator line using the default separator character and length.
36+
*/
2037
public static void logSeparator() {
2138
logSeparator(SEPARATOR_CHAR, 76);
2239
}
2340

41+
/**
42+
* Logs a separator line with a custom delimiter character and length.
43+
*
44+
* @param delimiterChar The delimiter character.
45+
* @param length The length of the separator line.
46+
*/
2447
public static void logSeparator(String delimiterChar, int length) {
2548
LOGGER.info(String.join("", Collections.nCopies(length, delimiterChar)));
2649
}

test-frame-common/src/main/java/io/skodjob/testframe/TestFrameConstants.java

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,46 @@
66

77
import java.time.Duration;
88

9+
/**
10+
* Constants used in the test framework.
11+
*/
912
public class TestFrameConstants {
1013
private TestFrameConstants() {
14+
// Private constructor to prevent instantiation
1115
}
16+
17+
/**
18+
* Global poll interval in milliseconds (long).
19+
*/
1220
public static final long GLOBAL_POLL_INTERVAL_LONG = Duration.ofSeconds(15).toMillis();
21+
22+
/**
23+
* Global poll interval in milliseconds (medium).
24+
*/
1325
public static final long GLOBAL_POLL_INTERVAL_MEDIUM = Duration.ofSeconds(10).toMillis();
26+
27+
/**
28+
* Global poll interval in milliseconds (short).
29+
*/
1430
public static final long GLOBAL_POLL_INTERVAL_SHORT = Duration.ofSeconds(5).toMillis();
31+
32+
/**
33+
* Global poll interval in milliseconds (1 second).
34+
*/
1535
public static final long GLOBAL_POLL_INTERVAL_1_SEC = Duration.ofSeconds(1).toMillis();
36+
37+
/**
38+
* Global timeout in milliseconds.
39+
*/
1640
public static final long GLOBAL_TIMEOUT = Duration.ofMinutes(10).toMillis();
41+
42+
/**
43+
* OpenShift client type.
44+
*/
1745
public static final String OPENSHIFT_CLIENT = "oc";
18-
public static final String KUBERNETES_CLIENT = "kubectl";
1946

47+
/**
48+
* Kubernetes client type.
49+
*/
50+
public static final String KUBERNETES_CLIENT = "kubectl";
2051
}

test-frame-common/src/main/java/io/skodjob/testframe/TestFrameEnv.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class TestFrameEnv {
2626
private static final Logger LOGGER = LoggerFactory.getLogger(TestFrameEnv.class);
2727
private static final Map<String, String> VALUES = new HashMap<>();
2828
private static final Map<String, Object> YAML_DATA = loadConfigurationFile();
29-
public static final String USER_PATH = System.getProperty("user.dir");
3029

3130
private static final String CONFIG_FILE_PATH_ENV = "ENV_FILE";
3231
private static final String CLIENT_TYPE_ENV = "CLIENT_TYPE";
@@ -36,15 +35,36 @@ public class TestFrameEnv {
3635
private static final String URL_ENV = "KUBE_URL";
3736

3837
/**
39-
* Set values
38+
* Default user dir of exec process
39+
*/
40+
public static final String USER_PATH = System.getProperty("user.dir");
41+
/**
42+
* The type of client.
4043
*/
4144
public static final String CLIENT_TYPE = getOrDefault(CLIENT_TYPE_ENV, TestFrameConstants.KUBERNETES_CLIENT);
45+
46+
/**
47+
* The username for accessing the Kubernetes cluster.
48+
*/
4249
public static final String KUBE_USERNAME = getOrDefault(USERNAME_ENV, null);
50+
51+
/**
52+
* The password for accessing the Kubernetes cluster.
53+
*/
4354
public static final String KUBE_PASSWORD = getOrDefault(PASSWORD_ENV, null);
55+
56+
/**
57+
* The token for accessing the Kubernetes cluster.
58+
*/
4459
public static final String KUBE_TOKEN = getOrDefault(TOKEN_ENV, null);
60+
61+
/**
62+
* The URL for accessing the Kubernetes cluster.
63+
*/
4564
public static final String KUBE_URL = getOrDefault(URL_ENV, null);
4665

4766
private TestFrameEnv() {
67+
// Private constructor to prevent instantiation
4868
}
4969

5070
static {
@@ -61,7 +81,11 @@ private TestFrameEnv() {
6181
LoggerUtils.logSeparator("-", 30);
6282
}
6383

84+
/**
85+
* Print method.
86+
*/
6487
public static void print() {
88+
// Method implementation
6589
}
6690

6791
private static String getOrDefault(String varName, String defaultValue) {
@@ -90,7 +114,7 @@ private static Map<String, Object> loadConfigurationFile() {
90114
File yamlFile = new File(config).getAbsoluteFile();
91115
return yaml.load(new FileInputStream(yamlFile));
92116
} catch (IOException ex) {
93-
LOGGER.info("Yaml configuration not provider or not exists");
117+
LOGGER.info("Yaml configuration not provided or does not exist");
94118
return Collections.emptyMap();
95119
}
96120
}

test-frame-common/src/main/java/io/skodjob/testframe/annotations/ResourceManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515
import static java.lang.annotation.RetentionPolicy.RUNTIME;
1616

17+
/**
18+
* This annotation is used to manage resources in JUnit tests.
19+
* It is applied at the class level.
20+
* <p>
21+
* It uses the {@link ResourceManagerExtension} and {@link ResourceManagerCleanerExtension}
22+
* to set up and clean up resources before and after each test.
23+
*/
1724
@Target(ElementType.TYPE)
1825
@Retention(RUNTIME)
1926
@ExtendWith(ResourceManagerExtension.class)

test-frame-common/src/main/java/io/skodjob/testframe/annotations/ResourceManagerDebug.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
import static java.lang.annotation.RetentionPolicy.RUNTIME;
1515

16+
/**
17+
* This annotation is used to manage resources in JUnit tests.
18+
* It is applied at the class level.
19+
* <p>
20+
* It uses the {@link ResourceManagerExtension}
21+
*/
1622
@Target(ElementType.TYPE)
1723
@Retention(RUNTIME)
1824
@ExtendWith(ResourceManagerExtension.class)

test-frame-common/src/main/java/io/skodjob/testframe/annotations/TestVisualSeparator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
import static java.lang.annotation.RetentionPolicy.RUNTIME;
1515

16+
/**
17+
* This annotation is used to manage resources in JUnit tests.
18+
* It is applied at the class level.
19+
* <p>
20+
* It uses the {@link TestVisualSeparatorExtension}
21+
*/
1622
@Target(ElementType.TYPE)
1723
@Retention(RUNTIME)
1824
@ExtendWith(TestVisualSeparatorExtension.class)

0 commit comments

Comments
 (0)