Skip to content

Commit

Permalink
Don't default 'defaultJVMServer'. Add more tests covering bundle part…
Browse files Browse the repository at this point in the history
… overrides
  • Loading branch information
stewartfrancis committed Nov 7, 2024
1 parent 253004c commit 95f7742
Show file tree
Hide file tree
Showing 42 changed files with 1,156 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cics-bundle-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@
<addTestClassPath>true</addTestClassPath>
<goals>install</goals>
<mergeUserSettings>true</mergeUserSettings>
<pomIncludes>test-bundle-war-final-name/pom.xml</pomIncludes>
<scriptVariables>
<wiremockPort>${wiremockPort}</wiremockPort>
<pluginString>${project.groupId}:${project.artifactId}:${project.version}</pluginString>
</scriptVariables>
<streamLogs>true</streamLogs>
<!-- mavenOpts>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y</mavenOpts -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ assert buildLog.exists()
// Deployment with <insecure> set
assert buildLog.text.contains("""\
(deploy-with-insecure) @ test-bundle-deploy-insecure ---
[INFO] Deploying bundle to https://localhost:${wiremockPort} into region cicsplex/region
[INFO] Deploying test-app-bundle-0.0.1-SNAPSHOT.zip to https://localhost:${wiremockPort} into region cicsplex/region
[INFO] Bundle deployed
""")

// Deployment without <insecure> set
assert buildLog.text.contains("""\
(deploy-and-fail-because-self-signed) @ test-bundle-deploy-insecure ---
[INFO] Deploying bundle to https://localhost:${wiremockPort} into region cicsplex/region
[INFO] Deploying test-app-bundle-0.0.1-SNAPSHOT.zip to https://localhost:${wiremockPort} into region cicsplex/region
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
""")
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<extensions>true</extensions>
<configuration>
<defaultjvmserver>HELLO</defaultjvmserver>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
###
# #%L
# CICS Bundle Maven Plugin
# %%
# Copyright (C) 2019 IBM Corp.
# %%
# 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
# #L%
###
# The expected result of the build, possible values are "success" (default) and "failure"
invoker.buildResult = failure
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!--
#%L
CICS Bundle Maven Plugin
%%
Copyright (C) 2019 IBM Corp.
%%
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
#L%
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm.cics.test-bundle-war-no-jvmserver</groupId>
<artifactId>test-bundle-war-no-jvmserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<dependencies>
<!-- provided -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>pom.xml</packagingExcludes>
<warName>test-war</warName>
</configuration>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>bundle-war</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*-
* #%L
* CICS Bundle Maven Plugin
* %%
* Copyright (C) 2024 IBM Corp.
* %%
* 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
* #L%
*/
File buildLog = new File(basedir, 'build.log')

assert buildLog.exists()
assert buildLog.text.contains("The parameters 'jvmserver' for goal ${pluginString}:bundle-war are missing or invalid")
50 changes: 50 additions & 0 deletions cics-bundle-maven-plugin/src/it/test-reactor-ear-jvmserver/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
#%L
CICS Bundle Maven Plugin
%%
Copyright (C) 2019 IBM Corp.
%%
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
#L%
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test-reactor-ear-jvmserver</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>

<packaging>pom</packaging>

<modules>
<module>test-ear</module>
<module>test-bundle</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.ibm.cics.cbmp.PostBuildEar.assertOutput(basedir);
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
#%L
CICS Bundle Maven Plugin
%%
Copyright (C) 2019 IBM Corp.
%%
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
#L%
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test-reactor-ear-jvmserver</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>test-bundle</artifactId>
<packaging>cics-bundle</packaging>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>test-ear</artifactId>
<version>${project.version}</version>
<type>ear</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<extensions>true</extensions>
<configuration>
<bundleParts>
<bundlePart implementation="com.ibm.cics.cbmp.Earbundle">
<artifact>
<artifactId>test-ear</artifactId>
</artifact>
<jvmserver>EYUCMCIJ</jvmserver>
</bundlePart>
</bundleParts>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
#%L
CICS Bundle Maven Plugin
%%
Copyright (C) 2019 IBM Corp.
%%
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
#L%
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>test-reactor-ear-jvmserver</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>test-ear</artifactId>
<packaging>ear</packaging>

<dependencies>
<!-- provided -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ibm.cics</groupId>
<artifactId>test-war</artifactId>
<version>1.0.0</version>
<type>war</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>pom.xml</packagingExcludes>
<earName>test-ear</earName>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
###
# #%L
# CICS Bundle Maven Plugin
# %%
# Copyright (C) 2019 IBM Corp.
# %%
# 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
# #L%
###
# The expected result of the build, possible values are "success" (default) and "failure"
invoker.buildResult = failure
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
#%L
CICS Bundle Maven Plugin
%%
Copyright (C) 2019 IBM Corp.
%%
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
#L%
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test-reactor-ear-nodefaultjvmserver</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>

<packaging>pom</packaging>

<modules>
<module>test-ear</module>
<module>test-bundle</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*-
* #%L
* CICS Bundle Maven Plugin
* %%
* Copyright (C) 2024 IBM Corp.
* %%
* 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
* #L%
*/
File buildLog = new File(basedir, 'build.log')

assert buildLog.exists()
assert buildLog.text.contains("[ERROR] Failed to execute goal ${pluginString}:build (default-build) on project test-bundle: Bundle part for artifact test-reactor-ear-nodefaultjvmserver:test-ear:ear:0.0.1-SNAPSHOT:compile did not specify a JVM server explicitly, and no default was configured")
Loading

0 comments on commit 95f7742

Please sign in to comment.