-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from sophiegreen/master
Allow bundle parts directory to be configurable and add integration test
- Loading branch information
Showing
14 changed files
with
196 additions
and
2 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
27 changes: 27 additions & 0 deletions
27
cics-bundle-maven-plugin/src/it/test-reactor-bundlePartDirectory/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,27 @@ | ||
<!-- | ||
#%L | ||
CICS Bundle Maven Plugin | ||
%% | ||
Copyright (C) 2020 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-reactor-bundlePartDirectory</groupId> | ||
<artifactId>test-reactor-bundlePartDirectory</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>test-bundle</module> | ||
</modules> | ||
|
||
</project> |
1 change: 1 addition & 0 deletions
1
cics-bundle-maven-plugin/src/it/test-reactor-bundlePartDirectory/postbuild.bsh
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 @@ | ||
com.ibm.cics.cbmp.PostBuildBundlePartDirectory.assertOutput(basedir); |
40 changes: 40 additions & 0 deletions
40
cics-bundle-maven-plugin/src/it/test-reactor-bundlePartDirectory/test-bundle/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,40 @@ | ||
<!-- | ||
#%L | ||
CICS Bundle Maven Plugin | ||
%% | ||
Copyright (C) 2020 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>com.ibm.cics.test-reactor-bundlePartDirectory</groupId> | ||
<artifactId>test-reactor-bundlePartDirectory</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>test-bundle</artifactId> | ||
<packaging>cics-bundle</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<defaultjvmserver>EYUCMCIJ</defaultjvmserver> | ||
<bundlePartsDirectory>differentDirectory</bundlePartsDirectory> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
6 changes: 6 additions & 0 deletions
6
...-reactor-bundlePartDirectory/test-bundle/src/main/bundleParts/EventBindingWrongDir.evbind
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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<ns2:eventBinding CICSEPSchemaVersion="2" CICSEPSchemaRelease="0" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/cics/eventprocessing/eventbinding CicsEventBinding.xsd " xmlns:ns2="http://www.ibm.com/xmlns/prod/cics/eventprocessing/eventbinding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<description></description> | ||
<userTag></userTag> | ||
<eventAdapterName></eventAdapterName> | ||
</ns2:eventBinding> |
1 change: 1 addition & 0 deletions
1
...t/test-reactor-bundlePartDirectory/test-bundle/src/main/bundleParts/PROG1WrongDir.program
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 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><cicsdefinitionprogram jvm="NO" name="PROG1WrongDir" xmlns="http://www.ibm.com/xmlns/prod/CICS/smw2int"/> |
8 changes: 8 additions & 0 deletions
8
...it/test-reactor-bundlePartDirectory/test-bundle/src/main/bundleParts/mymapWrongDir.urimap
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<cicsdefinitionurimap xmlns="http://www.ibm.com/xmlns/prod/CICS/smw2int" | ||
hfsfile="/u/niced/blah" | ||
host="winmvs28.hursley.ibm.com" | ||
mediatype="text/html" | ||
name="mymap" | ||
path="my/path/" | ||
usage="SERVER" /> |
1 change: 1 addition & 0 deletions
1
.../it/test-reactor-bundlePartDirectory/test-bundle/src/main/bundleParts/noextensionWrongDir
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 @@ | ||
this file should have no file extension. |
6 changes: 6 additions & 0 deletions
6
...t-reactor-bundlePartDirectory/test-bundle/src/main/differentDirectory/EventBinding.evbind
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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<ns2:eventBinding CICSEPSchemaVersion="2" CICSEPSchemaRelease="0" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/cics/eventprocessing/eventbinding CicsEventBinding.xsd " xmlns:ns2="http://www.ibm.com/xmlns/prod/cics/eventprocessing/eventbinding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<description></description> | ||
<userTag></userTag> | ||
<eventAdapterName></eventAdapterName> | ||
</ns2:eventBinding> |
1 change: 1 addition & 0 deletions
1
...it/test-reactor-bundlePartDirectory/test-bundle/src/main/differentDirectory/PROG1.program
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 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><cicsdefinitionprogram jvm="NO" name="PROG1" xmlns="http://www.ibm.com/xmlns/prod/CICS/smw2int"/> |
8 changes: 8 additions & 0 deletions
8
.../it/test-reactor-bundlePartDirectory/test-bundle/src/main/differentDirectory/mymap.urimap
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<cicsdefinitionurimap xmlns="http://www.ibm.com/xmlns/prod/CICS/smw2int" | ||
hfsfile="/u/niced/blah" | ||
host="winmvs28.hursley.ibm.com" | ||
mediatype="text/html" | ||
name="mymap" | ||
path="my/path/" | ||
usage="SERVER" /> |
1 change: 1 addition & 0 deletions
1
...c/it/test-reactor-bundlePartDirectory/test-bundle/src/main/differentDirectory/noextension
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 @@ | ||
this file should have no file extension. |
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
cics-bundle-maven-plugin/src/test/java/com/ibm/cics/cbmp/PostBuildBundlePartDirectory.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,84 @@ | ||
package com.ibm.cics.cbmp; | ||
/*- | ||
* #%L | ||
* CICS Bundle Maven Plugin | ||
* %% | ||
* Copyright (C) 2020 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% | ||
*/ | ||
|
||
import static com.ibm.cics.cbmp.BundleValidator.assertBundleContents; | ||
import static com.ibm.cics.cbmp.BundleValidator.bfv; | ||
import static com.ibm.cics.cbmp.BundleValidator.manifestValidator; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
|
||
import org.xmlunit.matchers.CompareMatcher; | ||
|
||
public class PostBuildBundlePartDirectory { | ||
|
||
private static final String EVBIND_BUNDLEPART = "/EventBinding.evbind"; | ||
private static final String URIMAP_BUNDLEPART = "/mymap.urimap"; | ||
private static final String PROGRAM_BUNDLEPART = "/PROG1.program"; | ||
private static final String NOEXTENSION_FILE = "/noextension"; | ||
|
||
static void assertOutput(File root) throws Exception { | ||
|
||
Path cicsBundle = root.toPath().resolve("test-bundle/target/test-bundle-0.0.1-SNAPSHOT.zip"); | ||
|
||
assertBundleContents( | ||
cicsBundle, | ||
manifestValidator( | ||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" + | ||
"<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\" bundleMajorVer=\"0\" bundleMicroVer=\"1\" bundleMinorVer=\"0\" bundleRelease=\"0\" bundleVersion=\"1\" id=\"test-bundle\">\n" + | ||
" <meta_directives>\n" + | ||
" <timestamp>2019-09-11T21:12:17.023Z</timestamp>\n" + | ||
" </meta_directives>\n" + | ||
" <define name=\"PROG1\" path=\"PROG1.program\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/PROGRAM\"/>\n" + | ||
" <define name=\"EventBinding\" path=\"EventBinding.evbind\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/EVENTBINDING\"/>\n" + | ||
" <define name=\"mymap\" path=\"mymap.urimap\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/URIMAP\"/>\n" + | ||
"</manifest>" | ||
), | ||
bfv( | ||
EVBIND_BUNDLEPART, | ||
is -> assertThat( | ||
is, | ||
CompareMatcher.isIdenticalTo( | ||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + | ||
"<ns2:eventBinding CICSEPSchemaVersion=\"2\" CICSEPSchemaRelease=\"0\" " + | ||
"xsi:schemaLocation=\"http://www.ibm.com/xmlns/prod/cics/eventprocessing/eventbinding CicsEventBinding.xsd \" " + | ||
"xmlns:ns2=\"http://www.ibm.com/xmlns/prod/cics/eventprocessing/eventbinding\" " + | ||
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" + | ||
" <description></description>\n" + | ||
" <userTag></userTag>\n" + | ||
" <eventAdapterName></eventAdapterName>\n" + | ||
"</ns2:eventBinding>" | ||
) | ||
) | ||
), | ||
bfv( | ||
URIMAP_BUNDLEPART, | ||
is -> {} | ||
), | ||
bfv( | ||
PROGRAM_BUNDLEPART, | ||
is -> {} | ||
), | ||
bfv( | ||
NOEXTENSION_FILE, | ||
is -> {} | ||
) | ||
); | ||
|
||
} | ||
|
||
|
||
} |