-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test : Move CompleteOcDockerLayerDisabledITCase to a different package
Currently CompleteOcDockerITCase and CompleteOcDockerLayersDisabledITCase use shared project. This causes problems when these projects are run concurrently as one test overwrites build directory (fat jar) that might be currently getting used by other test (the latter one uses legacy fat jar). Move CompleteOcDockerLayerDisabledITCase to a different package and make it use a different test project. Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
6e28885
commit 8780838
Showing
8 changed files
with
211 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
.../org/eclipse/jkube/integrationtests/springboot/layeredjardisabled/LayeredJarDisabled.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* 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.springboot.layeredjardisabled; | ||
|
||
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.assertions.ServiceAssertion; | ||
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.hasSize; | ||
|
||
@KubernetesTest(createEphemeralNamespace = false) | ||
abstract class LayeredJarDisabled implements JKubeCase, MavenCase { | ||
|
||
private static final String PROJECT_LAYERED_JAR_DISABLED = "projects-to-be-tested/maven/spring/layered-jar-disabled"; | ||
|
||
private KubernetesClient kubernetesClient; | ||
|
||
@Override | ||
public KubernetesClient getKubernetesClient() { | ||
return kubernetesClient; | ||
} | ||
|
||
@Override | ||
public String getProject() { | ||
return PROJECT_LAYERED_JAR_DISABLED; | ||
} | ||
|
||
@Override | ||
public String getApplication() { | ||
return "spring-boot-layered-jar-disabled"; | ||
} | ||
|
||
final ServiceAssertion assertThatShouldApplyResources() throws Exception { | ||
final Pod pod = awaitPod(this).getKubernetesResource(); | ||
assertPod(pod).apply(this).logContains("LayeredJarDisabledApplication : Started LayeredJarDisabledApplication in", 60); | ||
return awaitService(this, pod.getMetadata().getNamespace()) | ||
.assertIsNodePort() | ||
.assertPorts(hasSize(1)) | ||
.assertPort("http", 8080, true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
projects-to-be-tested/maven/spring/layered-jar-disabled/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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 | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.jkube.integration-tests</groupId> | ||
<artifactId>jkube-integration-tests-project</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>../../../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>spring-boot-layered-jar-disabled</artifactId> | ||
<name>${global.name} :: Spring Boot :: Layered Jar Disabled</name> | ||
<description> | ||
Spring Boot with Explicit Configuration to disable Layered Jar | ||
</description> | ||
|
||
<properties> | ||
<jkube.build.strategy>docker</jkube.build.strategy> | ||
<jkube.enricher.jkube-service.type>NodePort</jkube.enricher.jkube-service.type> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter</artifactId> | ||
<version>${spring-boot.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
<version>${spring-boot.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<version>${spring-boot.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<layers> | ||
<enabled>false</enabled> | ||
</layers> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.jkube</groupId> | ||
<artifactId>kubernetes-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.jkube</groupId> | ||
<artifactId>openshift-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
26 changes: 26 additions & 0 deletions
26
...e/jkube/integrationtests/springboot/layeredjardisabled/LayeredJarDisabledApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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.springboot.layeredjardisabled; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class LayeredJarDisabledApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(LayeredJarDisabledApplication.class, args); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...ipse/jkube/integrationtests/springboot/layeredjardisabled/LayeredJarDisabledResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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.springboot.layeredjardisabled; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/") | ||
public class LayeredJarDisabledResource { | ||
|
||
@GetMapping | ||
public String layeredJarDisabled() { | ||
return "Layered Jar is Disabled in this application"; | ||
} | ||
} |