You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2015/03/31 20:12:11 UTC

[2/2] cxf git commit: [CXF-6268] Add integration test This closes #61

[CXF-6268] Add integration test
This closes #61


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/41812468
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/41812468
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/41812468

Branch: refs/heads/master
Commit: 41812468cde977c25aae405814677555beadee1a
Parents: d7945c7
Author: kops <je...@dudie.fr>
Authored: Thu Mar 5 23:52:04 2015 +0100
Committer: Daniel Kulp <dk...@apache.org>
Committed: Tue Mar 31 13:32:55 2015 -0400

----------------------------------------------------------------------
 maven-plugins/codegen-plugin/pom.xml            | 33 +++++++
 maven-plugins/codegen-plugin/src/it/README.md   | 12 +++
 .../src/it/jdk6-cxf-with-toolchain/pom.xml      | 97 ++++++++++++++++++++
 .../src/main/wsdl/HelloWorld.wsdl               | 79 ++++++++++++++++
 .../codegen-plugin/src/it/settings.xml          | 45 +++++++++
 5 files changed, 266 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/41812468/maven-plugins/codegen-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/pom.xml b/maven-plugins/codegen-plugin/pom.xml
index e1221da..70a2f02 100644
--- a/maven-plugins/codegen-plugin/pom.xml
+++ b/maven-plugins/codegen-plugin/pom.xml
@@ -154,6 +154,39 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-install-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>install-to-integration-repo</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>install</goal>
+                        </goals>
+                        <configuration>
+                            <localRepositoryPath>${project.build.directory}/it/repo</localRepositoryPath>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-invoker-plugin</artifactId>
+                <version>1.9</version>
+                <executions>
+                    <execution>
+                        <id>test-toolchains-integration</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                            <goal>integration-test</goal>
+                        </goals>
+                        <configuration>
+                            <settingsFile>src/it/settings.xml</settingsFile>
+                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <profiles>

http://git-wip-us.apache.org/repos/asf/cxf/blob/41812468/maven-plugins/codegen-plugin/src/it/README.md
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/it/README.md b/maven-plugins/codegen-plugin/src/it/README.md
new file mode 100644
index 0000000..b202bec
--- /dev/null
+++ b/maven-plugins/codegen-plugin/src/it/README.md
@@ -0,0 +1,12 @@
+toolchain-integration-tests
+===========================
+
+jdk6-cxf-with-toolchain
+-----------------------
+
+This project contains sample maven module using `cxf-codegen-plugin` to generate java from WSDL file.
+
+- it enforces usage of JDK 1.7 or higher to run the `mvn` command
+- it configures `maven-toolchains-plugins` to target JDK 6
+- cxf `fork` parameter if set to true to enable toolchain detection
+- if the toolchain wasn't correctly used by the cxf-codegen-plugin`, the the build should fail during the _compile_ phase

http://git-wip-us.apache.org/repos/asf/cxf/blob/41812468/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/pom.xml b/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/pom.xml
new file mode 100644
index 0000000..1dd949f
--- /dev/null
+++ b/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/pom.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.cxf.it</groupId>
+  <artifactId>jdk6-cxf-with-toolchain</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <properties>
+    <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
+  </properties>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>1.4</version>
+        <executions>
+          <execution>
+            <id>enforce-jdk7-of-higher</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireJavaVersion>
+                  <version>[1.7,)</version>
+                </requireJavaVersion>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-toolchains-plugin</artifactId>
+        <version>1.1</version>
+        <configuration>
+          <toolchains>
+            <jdk>
+              <version>6</version>
+            </jdk>
+          </toolchains>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>toolchain</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-codegen-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>wsdl2java</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>wsdl2java</goal>
+            </goals>
+            <configuration>
+              <fork>true</fork>
+              <wsdlOptions>
+                <wsdlOption>
+                  <wsdl>src/main/wsdl/HelloWorld.wsdl</wsdl>
+                </wsdlOption>
+              </wsdlOptions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.9.1</version>
+        <executions>
+          <execution>
+            <id>add-wsdl-source</id>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>${project.build.directory}/generated-sources/cxf</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/41812468/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/src/main/wsdl/HelloWorld.wsdl
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/src/main/wsdl/HelloWorld.wsdl b/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/src/main/wsdl/HelloWorld.wsdl
new file mode 100644
index 0000000..21dd8de
--- /dev/null
+++ b/maven-plugins/codegen-plugin/src/it/jdk6-cxf-with-toolchain/src/main/wsdl/HelloWorld.wsdl
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+##    licensed to the Apache Software Foundation (ASF) under one
+##    or more contributor license agreements. See the NOTICE file
+##    distributed with this work for additional information
+##    regarding copyright ownership. The ASF licenses this file
+##    to you under the Apache License, Version 2.0 (the
+##    "License"); you may not use this file except in compliance
+##    with the License. You may obtain a copy of the License at
+##    
+##    http://www.apache.org/licenses/LICENSE-2.0
+##    
+##    Unless required by applicable law or agreed to in writing,
+##    software distributed under the License is distributed on an
+##    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+##    KIND, either express or implied. See the License for the
+##    specific language governing permissions and limitations
+##    under the License.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://www.apache.org/contract/HelloWorld"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://www.apache.org/contract/HelloWorld"
+    xmlns:x1="http://www.apache.org/schema/HelloWorld"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <wsdl:types>
+        <schema targetNamespace="http://www.apache.org/schema/HelloWorld"
+            xmlns="http://www.w3.org/2001/XMLSchema"
+            xmlns:tns="http://www.apache.org/schema/HelloWorld"
+            elementFormDefault="qualified">
+            <element name="sayHi">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="sayHiResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="sayHiRequest">
+        <wsdl:part element="x1:sayHi" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part element="x1:sayHiResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:portType name="HelloWorldPortType">
+        <wsdl:operation name="sayHi">
+            <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+            <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="HelloWorldBinding" type="tns:HelloWorldPortType">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="sayHi">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="sayHiRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="sayHiResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="HelloWorldService">
+        <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding">
+            <!-- Actual soap:address value is dynamically generated after deployment -->
+            <soap:address location="http://dummy.value"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/41812468/maven-plugins/codegen-plugin/src/it/settings.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/it/settings.xml b/maven-plugins/codegen-plugin/src/it/settings.xml
new file mode 100644
index 0000000..d29dc39
--- /dev/null
+++ b/maven-plugins/codegen-plugin/src/it/settings.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<settings>
+  <profiles>
+    <profile>
+      <id>it-repo</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <repositories>
+        <repository>
+          <id>local.central</id>
+          <url>@localRepositoryUrl@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>local.central</id>
+          <url>@localRepositoryUrl@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+        <pluginRepository>
+          <id>local.it</id>
+          <url>file://@project.build.directory@/it/repo</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+</settings>