diff --git a/.checkstyle/checkstyle.xml b/.checkstyle/checkstyle.xml new file mode 100644 index 00000000..3fda23dd --- /dev/null +++ b/.checkstyle/checkstyle.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 49965066..7f211989 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,8 @@ 2.0.9 2.2 1.0.6-SNAPSHOT + 10.12.5 + 3.3.1 @@ -204,6 +206,39 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven.checkstyle.version} + + .checkstyle/checkstyle.xml + true + true + true + + + + com.puppycrawl.tools + checkstyle + ${checkstyle.version} + + + + + validate + validate + + .checkstyle/checkstyle.xml + true + true + true + + + check + + + + @@ -240,4 +275,4 @@ - \ No newline at end of file + diff --git a/src/main/java/io/odh/test/Environment.java b/src/main/java/io/odh/test/Environment.java index 02759fa5..6353a243 100644 --- a/src/main/java/io/odh/test/Environment.java +++ b/src/main/java/io/odh/test/Environment.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test; diff --git a/src/main/java/io/odh/test/TestConstants.java b/src/main/java/io/odh/test/TestConstants.java index 1a2b17c4..8ba90e32 100644 --- a/src/main/java/io/odh/test/TestConstants.java +++ b/src/main/java/io/odh/test/TestConstants.java @@ -1,9 +1,12 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test; public class TestConstants { public static final String ODH_NAMESPACE = "opendatahub"; + + private TestConstants() { + } } diff --git a/src/main/java/io/odh/test/framework/ExecutionListener.java b/src/main/java/io/odh/test/framework/ExecutionListener.java index 342e908e..75e9195f 100644 --- a/src/main/java/io/odh/test/framework/ExecutionListener.java +++ b/src/main/java/io/odh/test/framework/ExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.framework; @@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory; public class ExecutionListener implements TestExecutionListener { - Logger LOGGER = LoggerFactory.getLogger(TestSeparator.class); + static final Logger LOGGER = LoggerFactory.getLogger(TestSeparator.class); public void testPlanExecutionStarted(TestPlan testPlan) { LOGGER.info("======================================================================="); diff --git a/src/main/java/io/odh/test/framework/ExtensionContextParameterResolver.java b/src/main/java/io/odh/test/framework/ExtensionContextParameterResolver.java index 703e9581..120a416a 100644 --- a/src/main/java/io/odh/test/framework/ExtensionContextParameterResolver.java +++ b/src/main/java/io/odh/test/framework/ExtensionContextParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.framework; @@ -19,4 +19,4 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException { return extensionContext; } -} \ No newline at end of file +} diff --git a/src/main/java/io/odh/test/framework/TestSeparator.java b/src/main/java/io/odh/test/framework/TestSeparator.java index 88ab2785..005e14be 100644 --- a/src/main/java/io/odh/test/framework/TestSeparator.java +++ b/src/main/java/io/odh/test/framework/TestSeparator.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.framework; diff --git a/src/main/java/io/odh/test/platform/KubeClient.java b/src/main/java/io/odh/test/platform/KubeClient.java index 2bdc1664..71a291a9 100644 --- a/src/main/java/io/odh/test/platform/KubeClient.java +++ b/src/main/java/io/odh/test/platform/KubeClient.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.platform; @@ -83,9 +83,9 @@ public KubeClient inNamespace(String namespace) { } private Config getConfig() { - if (Environment.KUBE_PASSWORD != null && - Environment.KUBE_PASSWORD != null && - Environment.KUBE_URL != null) { + if (Environment.KUBE_PASSWORD != null + && Environment.KUBE_PASSWORD != null + && Environment.KUBE_URL != null) { return new ConfigBuilder() .withUsername(Environment.KUBE_USERNAME) .withPassword(Environment.KUBE_PASSWORD) @@ -93,8 +93,8 @@ private Config getConfig() { .withDisableHostnameVerification(true) .withTrustCerts(true) .build(); - } else if (Environment.KUBE_URL != null && - Environment.KUBE_TOKEN != null) { + } else if (Environment.KUBE_URL != null + && Environment.KUBE_TOKEN != null) { return new ConfigBuilder() .withOauthToken(Environment.KUBE_TOKEN) .withMasterUrl(Environment.KUBE_URL) @@ -311,4 +311,3 @@ public MixedOperation, Resource conditions, String type) { return conditions.stream().filter(c -> c.getType().equals(type)).findFirst().orElseGet(null); } + + private KubeUtils() { + } } diff --git a/src/test/java/io/odh/test/e2e/Abstract.java b/src/test/java/io/odh/test/e2e/Abstract.java index b049b0cf..58e564bb 100644 --- a/src/test/java/io/odh/test/e2e/Abstract.java +++ b/src/test/java/io/odh/test/e2e/Abstract.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.e2e; @@ -7,7 +7,6 @@ import io.odh.test.platform.KubeClient; import io.odh.test.TestConstants; import io.odh.test.framework.TestSeparator; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterIT.java b/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterIT.java index 0c6118b0..e5480e4e 100644 --- a/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterIT.java +++ b/src/test/java/io/odh/test/e2e/continuous/DataScienceClusterIT.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.e2e.continuous; @@ -32,8 +32,8 @@ @Tag("continuous") public class DataScienceClusterIT extends Abstract { - private final String DS_CLUSTER_NAME = "default"; - private final String DS_DASHBOARD_CONFIG_NAME = "odh-dashboard-config"; + private static final String DS_CLUSTER_NAME = "default"; + private static final String DS_DASHBOARD_CONFIG_NAME = "odh-dashboard-config"; MixedOperation, Resource> dataScienceProjectCli; MixedOperation, Resource> dashboardConfigCli; diff --git a/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectIT.java b/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectIT.java index 000d7d0f..66a3b0ba 100644 --- a/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectIT.java +++ b/src/test/java/io/odh/test/e2e/continuous/DataScienceProjectIT.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.e2e.continuous; @@ -19,8 +19,8 @@ @Tag("continuous") public class DataScienceProjectIT extends Abstract { - private final String DS_PROJECT_NAME = "test"; - private final String DS_WORKBENCH_NAME = "test-workbench"; + private static final String DS_PROJECT_NAME = "test"; + private static final String DS_WORKBENCH_NAME = "test-workbench"; MixedOperation, Resource> notebookCli; @BeforeAll diff --git a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterIT.java b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterIT.java index 99ecb491..8091b63e 100644 --- a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterIT.java +++ b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterIT.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.e2e.standard; @@ -8,9 +8,7 @@ import io.fabric8.kubernetes.api.model.NamespaceBuilder; import io.fabric8.kubernetes.client.dsl.MixedOperation; import io.fabric8.kubernetes.client.dsl.Resource; -import io.odh.test.TestConstants; import io.odh.test.e2e.Abstract; -import io.odh.test.platform.KubeUtils; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; import io.opendatahub.datasciencecluster.v1.DataScienceClusterBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.ComponentsBuilder; @@ -22,9 +20,6 @@ import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.DatasciencepipelinesBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Kserve; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.KserveBuilder; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Modelmeshserving; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Ray; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Trustyai; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Workbenches; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.WorkbenchesBuilder; import org.junit.jupiter.api.AfterAll; @@ -33,13 +28,12 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; @Tag("standard") public class DataScienceClusterIT extends Abstract { - private final String DS_PROJECT_NAME = "test-dsp"; - private final String DS_PROJECT_NAMESPACE = "test-ns-ds"; + private static final String DS_PROJECT_NAME = "test-dsp"; + private static final String DS_PROJECT_NAMESPACE = "test-ns-ds"; MixedOperation, Resource> cli; @BeforeAll diff --git a/src/test/java/io/odh/test/unit/UnitTests.java b/src/test/java/io/odh/test/unit/UnitTests.java index 69071c9d..6cf8a725 100644 --- a/src/test/java/io/odh/test/unit/UnitTests.java +++ b/src/test/java/io/odh/test/unit/UnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright Tealc authors. + * Copyright Skodjob authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). */ package io.odh.test.unit;