diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/Thorntail.java b/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/Thorntail.java deleted file mode 100644 index 270285d9..00000000 --- a/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/Thorntail.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright (c) 2019 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at: - * - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.jkube.integrationtests.thorntail; - -import io.fabric8.junit.jupiter.api.KubernetesTest; -import io.fabric8.kubernetes.api.model.Pod; -import io.fabric8.kubernetes.client.KubernetesClient; -import org.eclipse.jkube.integrationtests.JKubeCase; -import org.eclipse.jkube.integrationtests.maven.MavenCase; - -import static org.eclipse.jkube.integrationtests.assertions.PodAssertion.assertPod; -import static org.eclipse.jkube.integrationtests.assertions.PodAssertion.awaitPod; -import static org.eclipse.jkube.integrationtests.assertions.ServiceAssertion.awaitService; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasSize; - -@KubernetesTest(createEphemeralNamespace = false) -abstract class Thorntail implements JKubeCase, MavenCase { - - static final String PROJECT_THORNTAIL = "projects-to-be-tested/maven/thorntail/microprofile"; - - private static KubernetesClient kubernetesClient; - - @Override - public KubernetesClient getKubernetesClient() { - return kubernetesClient; - } - - @Override - public String getProject() { - return PROJECT_THORNTAIL; - } - - @Override - public String getApplication() { - return "thorntail-microprofile"; - } - - final Pod assertThatShouldApplyResources() throws Exception { - final Pod pod = awaitPod(this).getKubernetesResource(); - assertPod(pod).apply(this).logContains("Deployed \"thorntail-microprofile-0.0.0-SNAPSHOT.war\"", 60); - awaitService(this, pod.getMetadata().getNamespace()) - .assertIsNodePort() - .assertPorts(hasSize(1)) - .assertPort("http", 8080, true) - .assertNodePortResponse("http", equalTo("JKube from Thorntail rocks!")); - return pod; - } - -} diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/ThorntailK8sITCase.java b/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/ThorntailK8sITCase.java deleted file mode 100644 index db91ce33..00000000 --- a/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/ThorntailK8sITCase.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (c) 2019 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at: - * - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.jkube.integrationtests.thorntail; - -import io.fabric8.kubernetes.api.model.Pod; -import org.apache.maven.shared.invoker.InvocationResult; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.parallel.ResourceLock; - -import java.io.File; -import java.util.Collections; -import java.util.List; - -import static org.eclipse.jkube.integrationtests.Locks.CLUSTER_RESOURCE_INTENSIVE; -import static org.eclipse.jkube.integrationtests.Tags.KUBERNETES; -import static org.eclipse.jkube.integrationtests.assertions.DeploymentAssertion.awaitDeployment; -import static org.eclipse.jkube.integrationtests.assertions.DockerAssertion.assertImageWasRecentlyBuilt; -import static org.eclipse.jkube.integrationtests.assertions.InvocationResultAssertion.assertInvocation; -import static org.eclipse.jkube.integrationtests.assertions.JKubeAssertions.assertJKube; -import static org.eclipse.jkube.integrationtests.assertions.KubernetesListAssertion.assertListResource; -import static org.eclipse.jkube.integrationtests.assertions.YamlAssertion.yaml; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.anEmptyMap; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItems; -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.not; -import static org.junit.jupiter.api.parallel.ResourceAccessMode.READ_WRITE; - -@Tag(KUBERNETES) -@TestMethodOrder(OrderAnnotation.class) -class ThorntailK8sITCase extends Thorntail { - - @Override - public List getProfiles() { - return Collections.singletonList(KUBERNETES); - } - - @Test - @Order(1) - @DisplayName("k8s:build, should create image") - void k8sBuild() throws Exception { - // When - final InvocationResult invocationResult = maven("k8s:build"); - // Then - assertInvocation(invocationResult); - assertImageWasRecentlyBuilt("integration-tests", "thorntail-microprofile"); - } - - @Test - @Order(1) - @DisplayName("k8s:resource, should create manifests") - void k8sResource() throws Exception { - // When - final InvocationResult invocationResult = maven("k8s:resource"); - // Then - assertInvocation(invocationResult); - final File metaInfDirectory = new File( - String.format("../%s/target/classes/META-INF", PROJECT_THORNTAIL)); - assertThat(metaInfDirectory.exists(), equalTo(true)); - assertListResource(new File(metaInfDirectory, "jkube/kubernetes.yml")); - assertThat(new File(metaInfDirectory, "jkube/kubernetes/thorntail-microprofile-deployment.yml"), yaml(not(anEmptyMap()))); - assertThat(new File(metaInfDirectory, "jkube/kubernetes/thorntail-microprofile-service.yml"), yaml(not(anEmptyMap()))); - } - - @Test - @Order(2) - @ResourceLock(value = CLUSTER_RESOURCE_INTENSIVE, mode = READ_WRITE) - @DisplayName("k8s:apply, should deploy pod and service") - @SuppressWarnings("unchecked") - void k8sApply() throws Exception { - // When - final InvocationResult invocationResult = maven("k8s:apply"); - // Then - assertInvocation(invocationResult); - final Pod pod = assertThatShouldApplyResources(); - awaitDeployment(this, pod.getMetadata().getNamespace()) - .assertReplicas(equalTo(1)) - .assertContainers(hasSize(1)) - .assertContainers(hasItems(allOf( - hasProperty("image", equalTo("integration-tests/thorntail-microprofile:latest")), - hasProperty("name", equalTo("thorntail-v2")), - hasProperty("ports", hasSize(3)), - hasProperty("ports", hasItems(allOf( - hasProperty("name", equalTo("http")), - hasProperty("containerPort", equalTo(8080)) - ))), - hasProperty("env", hasItems(allOf( - hasProperty("name", equalTo("JAVA_OPTIONS")), - hasProperty("value", equalTo("-Djava.net.preferIPv4Stack=true")) - ))) - ))); - } - - @Test - @Order(3) - @DisplayName("k8s:undeploy, should delete all applied resources") - void k8sUndeploy() throws Exception { - // When - final InvocationResult invocationResult = maven("k8s:undeploy"); - // Then - assertInvocation(invocationResult); - assertJKube(this) - .assertThatShouldDeleteAllAppliedResources() - .assertDeploymentDeleted(); - } -} diff --git a/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/ThorntailOcITCase.java b/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/ThorntailOcITCase.java deleted file mode 100644 index c2313e83..00000000 --- a/it/src/test/java/org/eclipse/jkube/integrationtests/thorntail/ThorntailOcITCase.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (c) 2019 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at: - * - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.jkube.integrationtests.thorntail; - -import io.fabric8.openshift.api.model.ImageStream; -import org.apache.maven.shared.invoker.InvocationResult; -import org.eclipse.jkube.integrationtests.OpenShiftCase; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.parallel.ResourceLock; - -import java.io.File; -import java.util.Collections; -import java.util.List; - -import static org.eclipse.jkube.integrationtests.Locks.CLUSTER_RESOURCE_INTENSIVE; -import static org.eclipse.jkube.integrationtests.Tags.OPEN_SHIFT; -import static org.eclipse.jkube.integrationtests.Tags.OPEN_SHIFT_OSCI; -import static org.eclipse.jkube.integrationtests.assertions.InvocationResultAssertion.assertInvocation; -import static org.eclipse.jkube.integrationtests.assertions.JKubeAssertions.assertJKube; -import static org.eclipse.jkube.integrationtests.assertions.KubernetesListAssertion.assertListResource; -import static org.eclipse.jkube.integrationtests.assertions.YamlAssertion.yaml; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.anEmptyMap; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.Matchers.notNullValue; -import static org.junit.jupiter.api.parallel.ResourceAccessMode.READ_WRITE; - -@Tag(OPEN_SHIFT) -@Tag(OPEN_SHIFT_OSCI) -@TestMethodOrder(OrderAnnotation.class) -class ThorntailOcITCase extends Thorntail implements OpenShiftCase { - - @Override - public List getProfiles() { - return Collections.singletonList(OPEN_SHIFT); - } - - @Test - @Order(1) - @ResourceLock(value = CLUSTER_RESOURCE_INTENSIVE, mode = READ_WRITE) - @DisplayName("oc:build, should create image") - void ocBuild() throws Exception { - // When - final InvocationResult invocationResult = maven("oc:build"); - // Then - assertInvocation(invocationResult); - final ImageStream is = getOpenShiftClient().imageStreams().withName("thorntail-microprofile").get(); - assertThat(is, notNullValue()); - assertThat(is.getStatus().getTags().iterator().next().getTag(), equalTo("latest")); - } - - @Test - @Order(1) - @DisplayName("oc:resource, should create manifests") - void ocResource() throws Exception { - // When - final InvocationResult invocationResult = maven("clean oc:resource"); //Clean to free up DiskSpace - // Then - assertInvocation(invocationResult); - final File metaInfDirectory = new File( - String.format("../%s/target/classes/META-INF", PROJECT_THORNTAIL)); - assertThat(metaInfDirectory.exists(), equalTo(true)); - assertListResource(new File(metaInfDirectory, "jkube/openshift.yml")); - assertThat(new File(metaInfDirectory, "jkube/openshift/thorntail-microprofile-deploymentconfig.yml"), yaml(not(anEmptyMap()))); - assertThat(new File(metaInfDirectory, "jkube/openshift/thorntail-microprofile-route.yml"), yaml(not(anEmptyMap()))); - assertThat(new File(metaInfDirectory, "jkube/openshift/thorntail-microprofile-service.yml"), yaml(not(anEmptyMap()))); - } - - @Test - @Order(2) - @ResourceLock(value = CLUSTER_RESOURCE_INTENSIVE, mode = READ_WRITE) - @DisplayName("oc:apply, should deploy pod and service") - void ocApply() throws Exception { - // When - final InvocationResult invocationResult = maven("oc:apply"); - // Then - assertInvocation(invocationResult); - assertThatShouldApplyResources(); - } - - @Test - @Order(3) - @DisplayName("oc:undeploy, should delete all applied resources") - void ocUndeploy() throws Exception { - // When - final InvocationResult invocationResult = maven("oc:undeploy"); - // Then - assertInvocation(invocationResult); - assertJKube(this) - .assertThatShouldDeleteAllAppliedResources(); - cleanUpCluster(); - } -} diff --git a/pom.xml b/pom.xml index d176dca0..39bf6d9d 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,6 @@ 2.0.7 2.7.11 2.3.9.RELEASE - 2.7.0.Final 4.4.5 1.0.28 11.0.2.Final @@ -169,11 +168,6 @@ vertx-maven-plugin ${vertx.plugin.version} - - io.thorntail - thorntail-maven-plugin - ${thorntail.version} - org.wildfly.plugins wildfly-jar-maven-plugin @@ -288,7 +282,6 @@ other projects-to-be-tested/maven/openliberty/rest - projects-to-be-tested/maven/thorntail/microprofile projects-to-be-tested/maven/vertx/simplest projects-to-be-tested/maven/wildfly-jar/microprofile projects-to-be-tested/maven/karaf/camel-log @@ -297,7 +290,7 @@ - projects-to-be-tested/maven/thorntail/microprofile/target + projects-to-be-tested/maven/vertx/simplest/target @@ -309,7 +302,6 @@ **/integrationtests/openliberty/**/*ITCase.java - **/integrationtests/thorntail/**/*ITCase.java **/integrationtests/vertx/**/*ITCase.java **/integrationtests/wildfly/jar/**/*ITCase.java **/integrationtests/karaf/**/*ITCase.java diff --git a/projects-to-be-tested/maven/thorntail/microprofile/pom.xml b/projects-to-be-tested/maven/thorntail/microprofile/pom.xml deleted file mode 100644 index 0a49ad39..00000000 --- a/projects-to-be-tested/maven/thorntail/microprofile/pom.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - 4.0.0 - - - org.eclipse.jkube.integration-tests - jkube-integration-tests-project - ${revision} - ../../../../pom.xml - - - thorntail-microprofile - war - ${global.name} :: Thorntail :: MicroProfile - - Thorntail MicroProfile OpenAPI project - - - NodePort - - - - - io.thorntail - microprofile-openapi - ${thorntail.version} - - - - - - - io.thorntail - thorntail-maven-plugin - - - - package - - - - - - - - - Kubernetes - - k8s - - - - - org.eclipse.jkube - kubernetes-maven-plugin - - - - - - OpenShift - - oc - - - - - org.eclipse.jkube - openshift-maven-plugin - - - - - - - diff --git a/projects-to-be-tested/maven/thorntail/microprofile/src/main/java/org/eclipse/jkube/integrationtests/thorntail/microprofile/MicroProfileApplication.java b/projects-to-be-tested/maven/thorntail/microprofile/src/main/java/org/eclipse/jkube/integrationtests/thorntail/microprofile/MicroProfileApplication.java deleted file mode 100644 index bb469367..00000000 --- a/projects-to-be-tested/maven/thorntail/microprofile/src/main/java/org/eclipse/jkube/integrationtests/thorntail/microprofile/MicroProfileApplication.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2019 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at: - * - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.jkube.integrationtests.thorntail.microprofile; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/") -public class MicroProfileApplication extends Application { -} diff --git a/projects-to-be-tested/maven/thorntail/microprofile/src/main/java/org/eclipse/jkube/integrationtests/thorntail/microprofile/MicroProfileResource.java b/projects-to-be-tested/maven/thorntail/microprofile/src/main/java/org/eclipse/jkube/integrationtests/thorntail/microprofile/MicroProfileResource.java deleted file mode 100644 index ecb6b951..00000000 --- a/projects-to-be-tested/maven/thorntail/microprofile/src/main/java/org/eclipse/jkube/integrationtests/thorntail/microprofile/MicroProfileResource.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2019 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at: - * - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.jkube.integrationtests.thorntail.microprofile; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("") -public class MicroProfileResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public Response get() { - return Response.ok("JKube from Thorntail rocks!").build(); - } -} diff --git a/projects-to-be-tested/maven/thorntail/microprofile/src/main/jkube/k8s/deployment.yml b/projects-to-be-tested/maven/thorntail/microprofile/src/main/jkube/k8s/deployment.yml deleted file mode 100644 index 029f73f8..00000000 --- a/projects-to-be-tested/maven/thorntail/microprofile/src/main/jkube/k8s/deployment.yml +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2019 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at: -# -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -# - -spec: - template: - spec: - containers: - - env: - - name: JAVA_OPTIONS - value: "-Djava.net.preferIPv4Stack=true" \ No newline at end of file diff --git a/projects-to-be-tested/maven/thorntail/microprofile/src/main/jkube/oc/deploymentconfig.yml b/projects-to-be-tested/maven/thorntail/microprofile/src/main/jkube/oc/deploymentconfig.yml deleted file mode 100644 index d9f40f2f..00000000 --- a/projects-to-be-tested/maven/thorntail/microprofile/src/main/jkube/oc/deploymentconfig.yml +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) 2019 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at: -# -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -# - -spec: - replicas: 1 - template: - spec: - containers: - - env: - - name: JAVA_OPTIONS - value: "-Djava.net.preferIPv4Stack=true" - triggers: - - imageChangeParams: - automatic: true - containerNames: - - thorntail-v2 - from: - kind: ImageStreamTag - name: thorntail-microprofile:latest - type: ImageChange \ No newline at end of file