You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2014/09/12 08:18:50 UTC
[1/2] CXF-5999 Moving JiBX related systests into its own module.
Repository: cxf
Updated Branches:
refs/heads/master 0037232fb -> d2dec5b87
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl b/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl
new file mode 100644
index 0000000..f7ec99a
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl
@@ -0,0 +1,169 @@
+<?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 xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://apache.org/hello_world_soap_http_jibx/jibx" xmlns:x1="http://apache.org/hello_world_soap_http_jibx/jibx/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http_jibx/jibx">
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://apache.org/hello_world_soap_http_jibx/jibx/types" targetNamespace="http://apache.org/hello_world_soap_http_jibx/jibx/types" elementFormDefault="qualified">
+ <simpleType name="MyStringType">
+ <restriction base="string">
+ <maxLength value="30"/>
+ </restriction>
+ </simpleType>
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="tns:MyStringType"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeOneWay">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="pingMe">
+ <complexType/>
+ </element>
+ <element name="pingMeResponse">
+ <complexType/>
+ </element>
+ <element name="faultDetail">
+ <complexType>
+ <sequence>
+ <element name="minor" type="short"/>
+ <element name="major" type="short"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeFaultDetail" type="string"/>
+ </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:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x1:greetMeResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part element="x1:greetMeOneWay" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeRequest">
+ <wsdl:part name="in" element="x1:pingMe"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeResponse">
+ <wsdl:part name="out" element="x1:pingMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeFault">
+ <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeFault">
+ <wsdl:part name="greetMeFault" element="x1:greetMeFaultDetail"/>
+ </wsdl:message>
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+ <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+ <wsdl:fault name="greetMeFault" message="tns:greetMeFault"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+ </wsdl:operation>
+ <wsdl:operation name="pingMe">
+ <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+ <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+ <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <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:operation name="greetMe">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="greetMeFault">
+ <soap:fault name="greetMeFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeOneWayRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ <wsdl:operation name="pingMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="pingMeFault">
+ <soap:fault name="pingMeFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/pom.xml b/systests/jibx/jaxrs-jibx/pom.xml
new file mode 100644
index 0000000..82b9f74
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/pom.xml
@@ -0,0 +1,287 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<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">
+ <parent>
+ <artifactId>cxf-systests-jibx</artifactId>
+ <groupId>org.apache.cxf.systests</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.cxf.systests</groupId>
+ <artifactId>cxf-systests-jaxrs-jibx</artifactId>
+ <name>Apache CXF JAX-RS JiBX System Tests</name>
+ <description>Apache CXF JAX-RS JiBX System Tests</description>
+ <url>http://cxf.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-jsp</artifactId>
+ <version>${cxf.jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${cxf.jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-local</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-testutils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-databinding-sdo</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-databinding-jibx</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-management-web</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-extension-providers</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-security-cors</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.5.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.5.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!--dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <scope>test</scope>
+ </dependency-->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>${cxf.spring.mock}</artifactId>
+ <version>${cxf.spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.fastinfoset</groupId>
+ <artifactId>FastInfoset</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>2.4.1</version>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-maven-plugin</artifactId>
+ <version>${cxf.jibx.version}</version>
+ <executions>
+ <execution>
+ <id>generate-java-code-from-schema</id>
+ <goals>
+ <goal>schema-codegen</goal>
+ </goals>
+ <configuration>
+ <schemaLocation>src/test/resources/jibx</schemaLocation>
+ <schemaBindingDirectory>target/generated/src/main/java</schemaBindingDirectory>
+ <options>
+ <package>org.apache.cxf.systest.jaxrs.codegen.jibx</package>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>compile-binding</id>
+ <goals>
+ <goal>bind</goal>
+ </goals>
+ <configuration>
+ <schemaBindingDirectory>target/generated/src/main/java</schemaBindingDirectory>
+ <includeSchemaBindings>
+ <includeSchemaBindings>binding.xml</includeSchemaBindings>
+ </includeSchemaBindings>
+ <load>true</load>
+ <validate>true</validate>
+ <verify>true</verify>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java b/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
new file mode 100644
index 0000000..693414b
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
@@ -0,0 +1,82 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.jaxrs;
+
+import java.net.URISyntaxException;
+
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.handler.DefaultHandler;
+import org.eclipse.jetty.server.handler.HandlerCollection;
+import org.eclipse.jetty.webapp.WebAppContext;
+
+
+public class BookDataBindingServer extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(BookDataBindingServer.class);
+
+ private org.eclipse.jetty.server.Server server;
+
+ protected void run() {
+ server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
+
+ WebAppContext webappcontext = new WebAppContext();
+ String contextPath = null;
+ try {
+ contextPath = getClass().getResource("/jaxrs_databinding").toURI().getPath();
+ } catch (URISyntaxException e1) {
+ e1.printStackTrace();
+ }
+ webappcontext.setContextPath("/");
+
+ webappcontext.setWar(contextPath);
+
+ HandlerCollection handlers = new HandlerCollection();
+ handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});
+
+ server.setHandler(handlers);
+ try {
+ server.start();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ public void tearDown() throws Exception {
+ super.tearDown();
+ if (server != null) {
+ server.stop();
+ server.destroy();
+ server = null;
+ }
+ }
+
+ public static void main(String args[]) {
+ try {
+ BookDataBindingServer s = new BookDataBindingServer();
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java b/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
new file mode 100644
index 0000000..fe0eb72
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
@@ -0,0 +1,54 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.jaxrs;
+
+
+import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
+import org.apache.cxf.jibx.JibxDataBinding;
+import org.apache.cxf.systest.jaxrs.jibx.JibxResource;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = BookDataBindingServer.PORT;
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ AbstractResourceInfo.clearAllMaps();
+ assertTrue("server did not launch correctly",
+ launchServer(BookDataBindingServer.class, true));
+ createStaticBus();
+ }
+
+ @Test
+ public void testGetBookJIBX() throws Exception {
+ JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
+ bean.setDataBinding(new JibxDataBinding());
+ bean.setAddress("http://localhost:" + PORT + "/databinding/jibx");
+ bean.setResourceClass(JibxResource.class);
+ JibxResource client = bean.create(JibxResource.class);
+ org.apache.cxf.systest.jaxrs.codegen.jibx.Book b = client.getBook();
+ assertEquals("JIBX", b.getName());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java b/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java
new file mode 100644
index 0000000..495eb15
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java
@@ -0,0 +1,37 @@
+/**
+ * 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.
+ */
+package org.apache.cxf.systest.jaxrs.jibx;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+import org.apache.cxf.systest.jaxrs.codegen.jibx.Book;
+
+@Path("books")
+public class JibxResource {
+ @GET
+ @Produces("application/xml")
+ public Book getBook() {
+ Book b = new Book();
+ b.setName("JIBX");
+ b.setId(1L);
+ return b;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml b/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
new file mode 100644
index 0000000..f4cc4ef
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
@@ -0,0 +1,39 @@
+<?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.
+-->
+<!-- START SNIPPET: beans -->
+<!--beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:simple="http://cxf.apache.org/simple"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd"-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
+ <import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
+ <jaxrs:server id="jibx" address="/jibx">
+ <jaxrs:serviceBeans>
+ <bean class="org.apache.cxf.systest.jaxrs.jibx.JibxResource"/>
+ </jaxrs:serviceBeans>
+ <jaxrs:dataBinding>
+ <bean class="org.apache.cxf.jibx.JibxDataBinding"/>
+ </jaxrs:dataBinding>
+ </jaxrs:server>
+</beans>
+<!-- END SNIPPET: beans -->
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/web.xml b/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/web.xml
new file mode 100644
index 0000000..f5ab779
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/src/test/resources/jaxrs_databinding/WEB-INF/web.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!--
+ 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.
+-->
+<!-- START SNIPPET: webxml -->
+<web-app>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>WEB-INF/beans.xml</param-value>
+ </context-param>
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>CXFServlet</servlet-name>
+ <display-name>CXF Servlet</display-name>
+ <servlet-class>
+ org.apache.cxf.transport.servlet.CXFServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>CXFServlet</servlet-name>
+ <url-pattern>/databinding/*</url-pattern>
+ </servlet-mapping>
+</web-app>
+<!-- END SNIPPET: webxml -->
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/jaxrs-jibx/src/test/resources/jibx/types.xsd
----------------------------------------------------------------------
diff --git a/systests/jibx/jaxrs-jibx/src/test/resources/jibx/types.xsd b/systests/jibx/jaxrs-jibx/src/test/resources/jibx/types.xsd
new file mode 100644
index 0000000..7af9023
--- /dev/null
+++ b/systests/jibx/jaxrs-jibx/src/test/resources/jibx/types.xsd
@@ -0,0 +1,9 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://books/types" elementFormDefault="qualified" targetNamespace="http://books/types">
+ <xs:complexType name="book">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element type="xs:long" name="id"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element type="tns:book" name="book"/>
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jibx/pom.xml b/systests/jibx/pom.xml
new file mode 100644
index 0000000..f370f3d
--- /dev/null
+++ b/systests/jibx/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<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">
+ <parent>
+ <artifactId>cxf-parent</artifactId>
+ <groupId>org.apache.cxf</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.cxf.systests</groupId>
+ <artifactId>cxf-systests-jibx</artifactId>
+ <name>Apache CXF JiBX Integration System Tests</name>
+ <description>Apache CXF JiBx Integration System Tests</description>
+ <packaging>pom</packaging>
+ <url>http://cxf.apache.org</url>
+ <modules>
+ <module>jaxrs-jibx</module>
+ <module>databinding-jibx</module>
+ </modules>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/pom.xml
----------------------------------------------------------------------
diff --git a/systests/pom.xml b/systests/pom.xml
index 197dfe9..915b641 100644
--- a/systests/pom.xml
+++ b/systests/pom.xml
@@ -7,9 +7,9 @@
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
@@ -46,4 +46,26 @@
<module>wsdl_maven</module>
<module>cdi</module>
</modules>
+
+ <profiles>
+ <!-- jibx does support JDK8 -->
+ <profile>
+ <id>jdk-7</id>
+ <modules>
+ <module>jibx</module>
+ </modules>
+ <activation>
+ <jdk>1.7</jdk>
+ </activation>
+ </profile>
+ <profile>
+ <id>jdk-6</id>
+ <modules>
+ <module>jibx</module>
+ </modules>
+ <activation>
+ <jdk>1.6</jdk>
+ </activation>
+ </profile>
+ </profiles>
</project>
[2/2] git commit: CXF-5999 Moving JiBX related systests into its own
module.
Posted by ni...@apache.org.
CXF-5999 Moving JiBX related systests into its own module.
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d2dec5b8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d2dec5b8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d2dec5b8
Branch: refs/heads/master
Commit: d2dec5b87788b8cb5059d3719cf3dfd7135a1280
Parents: 0037232
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Sep 12 14:17:39 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Sep 12 14:18:24 2014 +0800
----------------------------------------------------------------------
systests/databinding/pom.xml | 32 ---
.../cxf/systest/jibx/ClientServerJibxTest.java | 144 ----------
.../apache/cxf/systest/jibx/GreeterImpl.java | 76 -----
.../cxf/systest/jibx/PutLastTradePriceImpl.java | 62 ----
.../org/apache/cxf/systest/jibx/Server.java | 58 ----
.../java/org/apache/cxf/systest/jibx/cxf.xml | 32 ---
.../jibx/doc_lit_bare.wsdl | 114 --------
.../jibx/hello_world.wsdl | 169 -----------
systests/jaxrs/pom.xml | 51 +---
.../cxf/systest/jaxrs/JAXRSDataBindingTest.java | 33 +--
.../cxf/systest/jaxrs/jibx/JibxResource.java | 37 ---
.../jaxrs_databinding/WEB-INF/beans.xml | 12 +-
systests/jibx/databinding-jibx/pom.xml | 274 ++++++++++++++++++
.../cxf/systest/jibx/ClientServerJibxTest.java | 144 ++++++++++
.../apache/cxf/systest/jibx/GreeterImpl.java | 76 +++++
.../cxf/systest/jibx/PutLastTradePriceImpl.java | 62 ++++
.../org/apache/cxf/systest/jibx/Server.java | 58 ++++
.../java/org/apache/cxf/systest/jibx/cxf.xml | 32 +++
.../jibx/doc_lit_bare.wsdl | 114 ++++++++
.../jibx/hello_world.wsdl | 169 +++++++++++
systests/jibx/jaxrs-jibx/pom.xml | 287 +++++++++++++++++++
.../systest/jaxrs/BookDataBindingServer.java | 82 ++++++
.../cxf/systest/jaxrs/JAXRSDataBindingTest.java | 54 ++++
.../cxf/systest/jaxrs/jibx/JibxResource.java | 37 +++
.../jaxrs_databinding/WEB-INF/beans.xml | 39 +++
.../resources/jaxrs_databinding/WEB-INF/web.xml | 45 +++
.../src/test/resources/jibx/types.xsd | 9 +
systests/jibx/pom.xml | 38 +++
systests/pom.xml | 26 +-
29 files changed, 1564 insertions(+), 802 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/pom.xml
----------------------------------------------------------------------
diff --git a/systests/databinding/pom.xml b/systests/databinding/pom.xml
index f1fb079..0c99169 100644
--- a/systests/databinding/pom.xml
+++ b/systests/databinding/pom.xml
@@ -93,16 +93,6 @@
<dataBinding>xmlbeans</dataBinding>
</wsdlOption>
<wsdlOption>
- <wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl</wsdl>
- <frontEnd>cxf</frontEnd>
- <dataBinding>jibx</dataBinding>
- </wsdlOption>
- <wsdlOption>
- <wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl</wsdl>
- <frontEnd>cxf</frontEnd>
- <dataBinding>jibx</dataBinding>
- </wsdlOption>
- <wsdlOption>
<wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/source/hello_world.wsdl</wsdl>
<frontEnd>cxf</frontEnd>
<dataBinding>domsource</dataBinding>
@@ -120,28 +110,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.jibx</groupId>
- <artifactId>maven-jibx-plugin</artifactId>
- <version>${cxf.jibx.version}</version>
- <configuration>
- <directory>target/generated/src/test/java/jibx_bindings</directory>
- <!--load>true</load-->
- <!--validate>true</validate-->
- <!--verify>true</verify-->
- <includes>
- <include>${hello.world.binding.file}</include>
- <include>${doc.lit.bare.binding.file}</include>
- </includes>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>test-bind</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<profiles>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java b/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java
deleted file mode 100644
index a7d16b3..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.cxf.systest.jibx;
-
-import java.math.BigDecimal;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Holder;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.interceptor.LoggingInInterceptor;
-import org.apache.cxf.interceptor.LoggingOutInterceptor;
-import org.apache.cxf.jibx.doc_lit_bare.PutLastTradedPricePortType;
-import org.apache.cxf.jibx.doclitbare.types.In;
-import org.apache.cxf.jibx.doclitbare.types.InDecimal;
-import org.apache.cxf.jibx.doclitbare.types.Inout;
-import org.apache.cxf.jibx.doclitbare.types.OutString;
-import org.apache.cxf.jibx.doclitbare.types.StringRespType;
-import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-import org.apache.cxf.testutil.common.TestUtil;
-import org.apache.hello_world_soap_http_jibx.jibx.GreetMeFault;
-import org.apache.hello_world_soap_http_jibx.jibx.Greeter;
-import org.apache.hello_world_soap_http_jibx.jibx.PingMeFault;
-import org.apache.hello_world_soap_http_jibx.jibx.SOAPService;
-import org.apache.helloworldsoaphttpjibx.jibx.types.FaultDetail;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class ClientServerJibxTest extends AbstractBusClientServerTestBase {
- static final String WSDL_PORT = TestUtil.getPortNumber(Server.class);
-
- private static final QName SERVICE_NAME
- = new QName("http://apache.org/hello_world_soap_http_jibx/jibx", "SOAPService");
-
- private static final QName DOC_LIT_BARE_SERVICE =
- new QName("http://cxf.apache.org/jibx/doc_lit_bare", "SOAPService");
-
- @BeforeClass
- public static void startServers() throws Exception {
- assertTrue("server did not launch correctly", launchServer(Server.class, true));
- }
-
- @Test
- public void testCallFromDocLitBareClient() throws Exception {
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/jibx/cxf.xml");
- BusFactory.setDefaultBus(bus);
- URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl");
- assertNotNull("We should have found the WSDL here. " , wsdl);
-
- org.apache.cxf.jibx.doc_lit_bare.SOAPService ss =
- new org.apache.cxf.jibx.doc_lit_bare.SOAPService(wsdl, DOC_LIT_BARE_SERVICE);
- PutLastTradedPricePortType port = ss.getSoapPort();
- updateAddressPort(port, WSDL_PORT);
-
-
- ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
- ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
- StringRespType resp = port.bareNoParam();
- assertEquals("Get a wrong response", "Get the request!", resp.getStringRespType());
-
- InDecimal xd = new InDecimal();
- xd.setInDecimal(new BigDecimal(123));
- OutString response = port.nillableParameter(xd);
- assertEquals("Get a wrong response", "Get the request 123", response.getOutString());
-
- In data = new In();
- data.setTickerPrice(12.33F);
- data.setTickerSymbol("CXF");
- port.putLastTradedPrice(data);
-
- Inout dataio = new Inout();
- dataio.setTickerPrice(12.33F);
- dataio.setTickerSymbol("CXF");
- Holder<Inout> holder = new Holder<Inout>(dataio);
- port.sayHi(holder);
- assertEquals("Get a wrong response", "BAK", holder.value.getTickerSymbol());
- }
-
- @Test
- public void testCallFromClient() throws Exception {
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/jibx/cxf.xml");
- BusFactory.setDefaultBus(bus);
- URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/jibx/hello_world.wsdl");
- assertNotNull("We should have found the WSDL here. " , wsdl);
-
- SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
- Greeter port = ss.getSoapPort();
- updateAddressPort(port, WSDL_PORT);
-
- String resp;
- ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
- ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
- resp = port.sayHi();
- assertEquals("We should get the right response", "Bonjour", resp);
-
- resp = port.greetMe("Willem");
- assertEquals("We should get the right response", "Hello Willem", resp);
-
- try {
- port.greetMe("fault");
- fail("Should have been a fault");
- } catch (GreetMeFault ex) {
- assertEquals("Some fault detail", ex.getFaultInfo().getGreetMeFaultDetail());
- }
-
- try {
- port.pingMe();
- fail("We expect exception here");
- } catch (PingMeFault ex) {
- FaultDetail detail = ex.getFaultInfo();
- assertEquals("Wrong faultDetail major", detail.getMajor(), 2);
- assertEquals("Wrong faultDetail minor", detail.getMinor(), 1);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java b/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java
deleted file mode 100644
index e677586..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.cxf.systest.jibx;
-
-import java.util.logging.Logger;
-
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.hello_world_soap_http_jibx.jibx.GreetMeFault;
-import org.apache.hello_world_soap_http_jibx.jibx.Greeter;
-import org.apache.hello_world_soap_http_jibx.jibx.PingMeFault;
-import org.apache.helloworldsoaphttpjibx.jibx.types.FaultDetail;
-
-@javax.jws.WebService(portName = "SoapPort", serviceName = "SOAPService",
- targetNamespace = "http://apache.org/hello_world_soap_http_jibx/jibx",
- endpointInterface = "org.apache.hello_world_soap_http_jibx.jibx.Greeter")
-public class GreeterImpl implements Greeter {
-
- private static final Logger LOG = LogUtils.getL7dLogger(GreeterImpl.class);
-
- /* (non-Javadoc)
- * @see org.apache.hello_world_soap_http.Greeter#greetMe(java.lang.String)
- */
- public String greetMe(String me) throws GreetMeFault {
- if ("fault".equals(me)) {
- org.apache.helloworldsoaphttpjibx.jibx.types.GreetMeFaultDetail detail
- = new org.apache.helloworldsoaphttpjibx.jibx.types.GreetMeFaultDetail();
- detail.setGreetMeFaultDetail("Some fault detail");
- throw new GreetMeFault("Fault String", detail);
- }
- LOG.info("Executing operation greetMe");
- return "Hello " + me;
- }
-
- /* (non-Javadoc)
- * @see org.apache.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)
- */
- public void greetMeOneWay(String me) {
- LOG.info("Executing operation greetMeOneWay");
- }
-
- /* (non-Javadoc)
- * @see org.apache.hello_world_soap_http.Greeter#sayHi()
- */
- public String sayHi() {
- LOG.info("Executing operation sayHi");
- return "Bonjour";
- }
-
- public void pingMe() throws PingMeFault {
- // here we need to put the FaultDetail into the FaultDetailDocument
- FaultDetail faultDetail = new FaultDetail();
- faultDetail.setMajor((short)2);
- faultDetail.setMinor((short)1);
- LOG.info("Executing operation pingMe, throwing PingMeFault exception");
- throw new PingMeFault("PingMeFault raised by server", faultDetail);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java b/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java
deleted file mode 100644
index d799c5d..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.cxf.systest.jibx;
-
-import javax.jws.WebService;
-
-import org.apache.cxf.jibx.doc_lit_bare.PutLastTradedPricePortType;
-import org.apache.cxf.jibx.doclitbare.types.In;
-import org.apache.cxf.jibx.doclitbare.types.InDecimal;
-import org.apache.cxf.jibx.doclitbare.types.OutString;
-import org.apache.cxf.jibx.doclitbare.types.StringRespType;
-
-/**
- *
- */
-@WebService(targetNamespace = "http://cxf.apache.org/jibx/doc_lit_bare",
- portName = "SoapPort", serviceName = "SOAPService",
- endpointInterface = "org.apache.cxf.jibx.doc_lit_bare.PutLastTradedPricePortType"
-)
-public class PutLastTradePriceImpl implements PutLastTradedPricePortType {
-
- public StringRespType bareNoParam() {
- StringRespType st = new StringRespType();
- st.setStringRespType("Get the request!");
- return st;
- }
-
- public void sayHi(javax.xml.ws.Holder<org.apache.cxf.jibx.doclitbare.types.Inout> body) {
- body.value.setTickerSymbol("BAK");
- }
-
-
- public void putLastTradedPrice(In body) {
- // TODO Auto-generated method stub
-
- }
-
- public OutString nillableParameter(InDecimal theRequest) {
- OutString st = new OutString();
- st.setOutString("Get the request " + theRequest.getInDecimal().toString());
- return st;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/Server.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/Server.java b/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/Server.java
deleted file mode 100644
index 72b495c..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/Server.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.cxf.systest.jibx;
-
-import javax.xml.ws.Endpoint;
-
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.apache.cxf.testutil.common.TestUtil;
-
-public class Server extends AbstractBusTestServerBase {
- static final String PORT = TestUtil.getPortNumber(Server.class);
-
- protected void run() {
- // set the configuration file
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/jibx/cxf.xml");
- BusFactory.setDefaultBus(bus);
- setBus(bus);
- Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
- new GreeterImpl());
-
- Endpoint.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort",
- new PutLastTradePriceImpl());
- }
-
- public static void main(String args[]) {
- try {
- Server s = new Server();
- s.start();
- } catch (Exception ex) {
- ex.printStackTrace();
- System.exit(-1);
- } finally {
- System.out.println("done!");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/cxf.xml
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/cxf.xml b/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/cxf.xml
deleted file mode 100644
index 20832e7..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/jibx/cxf.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
- <jaxws:client name="{http://apache.org/hello_world_soap_http_jibx/jibx}SoapPort" createdFromAPI="true">
- <!-- jaxws:properties>
- <entry key="schema-validation-enabled" value="true" />
- </jaxws:properties-->
- </jaxws:client>
- <jaxws:endpoint name="{http://apache.org/hello_world_soap_http_jibx/jibx}SoapPort" wsdlLocation="classpath:wsdl_systest_databinding/jibx/hello_world.wsdl" createdFromAPI="true">
- <jaxws:properties>
- <entry key="schema-validation-enabled" value="true"/>
- </jaxws:properties>
- </jaxws:endpoint>
- <jaxws:endpoint name="{http://cxf.apache.org/jibx/doc_lit_bare}SoapPort" wsdlLocation="classpath:wsdl_systest_databinding/jibx/doc_lit_bare.wsdl" createdFromAPI="true"/>
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl b/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl
deleted file mode 100644
index 19422e1..0000000
--- a/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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 xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/jibx/doc_lit_bare" xmlns:x1="http://cxf.apache.org/jibx/doc_lit_bare/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cxf.apache.org/jibx/doc_lit_bare" name="DocLitBare">
- <wsdl:types>
- <schema xmlns:tns="http://cxf.apache.org/jibx/doc_lit_bare/types" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cxf.apache.org/jibx/doc_lit_bare/types" elementFormDefault="qualified">
- <complexType name="TradePriceData">
- <sequence>
- <element name="tickerSymbol" type="xsd:string"/>
- <element name="tickerPrice" type="xsd:float"/>
- </sequence>
- </complexType>
- <element name="in" type="tns:TradePriceData"/>
- <element name="inout" type="tns:TradePriceData"/>
- <element name="stringRespType" type="xsd:string"/>
- <element name="inDecimal" nillable="true" type="xsd:decimal"/>
- <element name="outString" nillable="true" type="xsd:string"/>
- </schema>
- </wsdl:types>
- <message name="PutLastTradedPriceInput">
- <part name="body" element="x1:in"/>
- </message>
- <message name="PutLastTradedPriceOutput"/>
- <message name="SayHiInput">
- <part name="body" element="x1:inout"/>
- </message>
- <message name="SayHiOutput">
- <part name="body" element="x1:inout"/>
- </message>
- <message name="bareNoParamRequest"/>
- <message name="bareNoParamResponse">
- <part element="x1:stringRespType" name="theResponse"/>
- </message>
- <message name="nillableRequest">
- <part name="theRequest" element="x1:inDecimal"/>
- </message>
- <message name="nillableResponse">
- <part name="theResponse" element="x1:outString"/>
- </message>
- <portType name="PutLastTradedPricePortType">
- <operation name="SayHi">
- <input message="tns:SayHiInput"/>
- <output message="tns:SayHiOutput"/>
- </operation>
- <operation name="PutLastTradedPrice">
- <input message="tns:PutLastTradedPriceInput"/>
- <output message="tns:PutLastTradedPriceOutput"/>
- </operation>
- <operation name="bareNoParam">
- <input message="tns:bareNoParamRequest"/>
- <output message="tns:bareNoParamResponse"/>
- </operation>
- <operation name="nillableParameter">
- <input message="tns:nillableRequest"/>
- <output message="tns:nillableResponse"/>
- </operation>
- </portType>
- <binding name="PutLastTradedPriceSoapBinding" type="tns:PutLastTradedPricePortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="SayHi">
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="PutLastTradedPrice">
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="bareNoParam">
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="nillableParameter">
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <wsdl:service name="SOAPService">
- <wsdl:port name="SoapPort" binding="tns:PutLastTradedPriceSoapBinding">
- <soap:address location="http://localhost:9107/SOAPDocLitBareService/SoapPort"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl b/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl
deleted file mode 100644
index f7ec99a..0000000
--- a/systests/databinding/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl
+++ /dev/null
@@ -1,169 +0,0 @@
-<?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 xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://apache.org/hello_world_soap_http_jibx/jibx" xmlns:x1="http://apache.org/hello_world_soap_http_jibx/jibx/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http_jibx/jibx">
- <wsdl:types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://apache.org/hello_world_soap_http_jibx/jibx/types" targetNamespace="http://apache.org/hello_world_soap_http_jibx/jibx/types" elementFormDefault="qualified">
- <simpleType name="MyStringType">
- <restriction base="string">
- <maxLength value="30"/>
- </restriction>
- </simpleType>
- <element name="sayHi">
- <complexType/>
- </element>
- <element name="sayHiResponse">
- <complexType>
- <sequence>
- <element name="responseType" type="string"/>
- </sequence>
- </complexType>
- </element>
- <element name="greetMe">
- <complexType>
- <sequence>
- <element name="requestType" type="tns:MyStringType"/>
- </sequence>
- </complexType>
- </element>
- <element name="greetMeResponse">
- <complexType>
- <sequence>
- <element name="responseType" type="string"/>
- </sequence>
- </complexType>
- </element>
- <element name="greetMeOneWay">
- <complexType>
- <sequence>
- <element name="requestType" type="string"/>
- </sequence>
- </complexType>
- </element>
- <element name="pingMe">
- <complexType/>
- </element>
- <element name="pingMeResponse">
- <complexType/>
- </element>
- <element name="faultDetail">
- <complexType>
- <sequence>
- <element name="minor" type="short"/>
- <element name="major" type="short"/>
- </sequence>
- </complexType>
- </element>
- <element name="greetMeFaultDetail" type="string"/>
- </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:message name="greetMeRequest">
- <wsdl:part element="x1:greetMe" name="in"/>
- </wsdl:message>
- <wsdl:message name="greetMeResponse">
- <wsdl:part element="x1:greetMeResponse" name="out"/>
- </wsdl:message>
- <wsdl:message name="greetMeOneWayRequest">
- <wsdl:part element="x1:greetMeOneWay" name="in"/>
- </wsdl:message>
- <wsdl:message name="pingMeRequest">
- <wsdl:part name="in" element="x1:pingMe"/>
- </wsdl:message>
- <wsdl:message name="pingMeResponse">
- <wsdl:part name="out" element="x1:pingMeResponse"/>
- </wsdl:message>
- <wsdl:message name="pingMeFault">
- <wsdl:part name="faultDetail" element="x1:faultDetail"/>
- </wsdl:message>
- <wsdl:message name="greetMeFault">
- <wsdl:part name="greetMeFault" element="x1:greetMeFaultDetail"/>
- </wsdl:message>
- <wsdl:portType name="Greeter">
- <wsdl:operation name="sayHi">
- <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
- <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
- </wsdl:operation>
- <wsdl:operation name="greetMe">
- <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
- <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
- <wsdl:fault name="greetMeFault" message="tns:greetMeFault"/>
- </wsdl:operation>
- <wsdl:operation name="greetMeOneWay">
- <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
- </wsdl:operation>
- <wsdl:operation name="pingMe">
- <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
- <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
- <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
- <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:operation name="greetMe">
- <soap:operation soapAction="" style="document"/>
- <wsdl:input name="greetMeRequest">
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="greetMeResponse">
- <soap:body use="literal"/>
- </wsdl:output>
- <wsdl:fault name="greetMeFault">
- <soap:fault name="greetMeFault" use="literal"/>
- </wsdl:fault>
- </wsdl:operation>
- <wsdl:operation name="greetMeOneWay">
- <soap:operation soapAction="" style="document"/>
- <wsdl:input name="greetMeOneWayRequest">
- <soap:body use="literal"/>
- </wsdl:input>
- </wsdl:operation>
- <wsdl:operation name="pingMe">
- <soap:operation style="document"/>
- <wsdl:input>
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal"/>
- </wsdl:output>
- <wsdl:fault name="pingMeFault">
- <soap:fault name="pingMeFault" use="literal"/>
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="SOAPService">
- <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
- <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jaxrs/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/pom.xml b/systests/jaxrs/pom.xml
index 27bae8f..42e36ef 100644
--- a/systests/jaxrs/pom.xml
+++ b/systests/jaxrs/pom.xml
@@ -35,7 +35,7 @@
<cxf.glassfish.el.version>3.0-b01</cxf.glassfish.el.version>
<cxf.surefire.fork.vmargs>-XX:MaxPermSize=192m</cxf.surefire.fork.vmargs>
<cxf.server.launcher.vmargs>-XX:MaxPermSize=192m</cxf.server.launcher.vmargs>
-
+
</properties>
<dependencies>
<dependency>
@@ -49,12 +49,12 @@
</dependency>
<dependency>
<groupId>javax.json</groupId>
- <artifactId>javax.json-api</artifactId>
- </dependency>
+ <artifactId>javax.json-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
- </dependency>
+ </dependency>
<!--
<dependency>
<groupId>org.apache.bval</groupId>
@@ -155,7 +155,7 @@
<artifactId>jetty-jaas</artifactId>
<version>${cxf.jetty9.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
@@ -391,7 +391,7 @@
<artifactId>spring-security-web</artifactId>
<version>3.2.0.RELEASE</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -472,8 +472,8 @@
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
- <artifactId>poi-ooxml</artifactId>
- </exclusion>
+ <artifactId>poi-ooxml</artifactId>
+ </exclusion>
</exclusions>
</dependency>
</dependencies>
@@ -491,41 +491,6 @@
</executions>
</plugin>
<plugin>
- <groupId>org.jibx</groupId>
- <artifactId>jibx-maven-plugin</artifactId>
- <version>${cxf.jibx.version}</version>
- <executions>
- <execution>
- <id>generate-java-code-from-schema</id>
- <goals>
- <goal>schema-codegen</goal>
- </goals>
- <configuration>
- <schemaLocation>src/test/resources/jibx</schemaLocation>
- <schemaBindingDirectory>target/generated/src/main/java</schemaBindingDirectory>
- <options>
- <package>org.apache.cxf.systest.jaxrs.codegen.jibx</package>
- </options>
- </configuration>
- </execution>
- <execution>
- <id>compile-binding</id>
- <goals>
- <goal>bind</goal>
- </goals>
- <configuration>
- <schemaBindingDirectory>target/generated/src/main/java</schemaBindingDirectory>
- <includeSchemaBindings>
- <includeSchemaBindings>binding.xml</includeSchemaBindings>
- </includeSchemaBindings>
- <load>true</load>
- <validate>true</validate>
- <verify>true</verify>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-wadl2java-plugin</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
index 6d6ab56..ec0d449 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
@@ -31,10 +31,8 @@ import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
import org.apache.cxf.jaxrs.provider.aegis.AegisElementProvider;
import org.apache.cxf.jaxrs.provider.json.DataBindingJSONProvider;
-import org.apache.cxf.jibx.JibxDataBinding;
import org.apache.cxf.message.Message;
import org.apache.cxf.sdo.SDODataBinding;
-import org.apache.cxf.systest.jaxrs.jibx.JibxResource;
import org.apache.cxf.systest.jaxrs.sdo.SDOResource;
import org.apache.cxf.systest.jaxrs.sdo.Structure;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -48,32 +46,21 @@ public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
@BeforeClass
public static void startServers() throws Exception {
AbstractResourceInfo.clearAllMaps();
- assertTrue("server did not launch correctly",
+ assertTrue("server did not launch correctly",
launchServer(BookDataBindingServer.class, true));
createStaticBus();
}
-
-
+
+
@Test
public void testGetBookJAXB() throws Exception {
- WebClient client = WebClient.create("http://localhost:"
+ WebClient client = WebClient.create("http://localhost:"
+ PORT + "/databinding/jaxb/bookstore/books/123");
Book book = client.accept("application/xml").get(Book.class);
assertEquals(123L, book.getId());
assertEquals("CXF in Action", book.getName());
}
-
- @Test
- public void testGetBookJIBX() throws Exception {
- JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
- bean.setDataBinding(new JibxDataBinding());
- bean.setAddress("http://localhost:" + PORT + "/databinding/jibx");
- bean.setResourceClass(JibxResource.class);
- JibxResource client = bean.create(JibxResource.class);
- org.apache.cxf.systest.jaxrs.codegen.jibx.Book b = client.getBook();
- assertEquals("JIBX", b.getName());
- }
-
+
@Test
public void testGetBookAegis() throws Exception {
WebClient client = WebClient.create("http://localhost:"
@@ -83,17 +70,17 @@ public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
assertEquals(123L, book.getId());
assertEquals("CXF in Action", book.getName());
}
-
+
@Test
public void testSDOStructure() throws Exception {
doTestSDOStructure("http://localhost:" + PORT + "/databinding/sdo");
}
-
+
@Test
public void testSDOStructureWithAnnotation() throws Exception {
doTestSDOStructure("http://localhost:" + PORT + "/databinding/sdo2");
}
-
+
private void doTestSDOStructure(String address) throws Exception {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setDataBinding(new SDODataBinding());
@@ -105,7 +92,7 @@ public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
assertEquals(123.5, struct.getDbl(), 0.01);
assertEquals(3, struct.getInt());
}
-
+
@Test
public void testSDOStructureJSON() throws Exception {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
@@ -127,5 +114,5 @@ public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
assertEquals(123.5, struct.getDbl(), 0.01);
assertEquals(3, struct.getInt());
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java
deleted file mode 100644
index 495eb15..0000000
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jibx/JibxResource.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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.
- */
-package org.apache.cxf.systest.jaxrs.jibx;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-
-import org.apache.cxf.systest.jaxrs.codegen.jibx.Book;
-
-@Path("books")
-public class JibxResource {
- @GET
- @Produces("application/xml")
- public Book getBook() {
- Book b = new Book();
- b.setName("JIBX");
- b.setId(1L);
- return b;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jaxrs/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
index 9df380b..5960555 100644
--- a/systests/jaxrs/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs_databinding/WEB-INF/beans.xml
@@ -7,9 +7,9 @@
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
@@ -38,14 +38,6 @@
<bean class="org.apache.cxf.jaxb.JAXBDataBinding"/>
</jaxrs:dataBinding>
</jaxrs:server>
- <jaxrs:server id="jibx" address="/jibx">
- <jaxrs:serviceBeans>
- <bean class="org.apache.cxf.systest.jaxrs.jibx.JibxResource"/>
- </jaxrs:serviceBeans>
- <jaxrs:dataBinding>
- <bean class="org.apache.cxf.jibx.JibxDataBinding"/>
- </jaxrs:dataBinding>
- </jaxrs:server>
<jaxrs:server id="aegisbook" address="/aegis">
<jaxrs:serviceBeans>
<ref bean="serviceBean"/>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/pom.xml b/systests/jibx/databinding-jibx/pom.xml
new file mode 100644
index 0000000..55a9af6
--- /dev/null
+++ b/systests/jibx/databinding-jibx/pom.xml
@@ -0,0 +1,274 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<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">
+ <parent>
+ <artifactId>cxf-systests-jibx</artifactId>
+ <groupId>org.apache.cxf.systests</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.cxf.systests</groupId>
+ <artifactId>cxf-systests-databinding-jibx</artifactId>
+ <name>Apache CXF Data Binding JiBX System Tests</name>
+ <description>Apache CXF Data Binding JiBX System Tests</description>
+ <url>http://cxf.apache.org</url>
+ <properties>
+ <hello.world.binding.file>hello_world.xml</hello.world.binding.file>
+ <doc.lit.bare.binding.file>doc_lit_bare.xml</doc.lit.bare.binding.file>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-test-source</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/src/test/generated</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-codegen-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <configuration>
+ <fork>${cxf.codegenplugin.forkmode}</fork>
+ <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
+ <testWsdlRoot>${basedir}/src/test/resources/wsdl_systest_databinding</testWsdlRoot>
+ <defaultOptions>
+ <markGenerated>true</markGenerated>
+ <faultSerialVersionUID>1</faultSerialVersionUID>
+ </defaultOptions>
+ <wsdlOptions>
+ <wsdlOption>
+ <wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/jibx/hello_world.wsdl</wsdl>
+ <frontEnd>cxf</frontEnd>
+ <dataBinding>jibx</dataBinding>
+ </wsdlOption>
+ <wsdlOption>
+ <wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl</wsdl>
+ <frontEnd>cxf</frontEnd>
+ <dataBinding>jibx</dataBinding>
+ </wsdlOption>
+ </wsdlOptions>
+ </configuration>
+ <goals>
+ <goal>wsdl2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jibx</groupId>
+ <artifactId>maven-jibx-plugin</artifactId>
+ <version>${cxf.jibx.version}</version>
+ <configuration>
+ <directory>target/generated/src/test/java/jibx_bindings</directory>
+ <!--load>true</load-->
+ <!--validate>true</validate-->
+ <!--verify>true</verify-->
+ <includes>
+ <include>${hello.world.binding.file}</include>
+ <include>${doc.lit.bare.binding.file}</include>
+ </includes>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-bind</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>fastinstall</id>
+ <properties>
+ <hello.world.binding.file>none</hello.world.binding.file>
+ <doc.lit.bare.binding.file>none</doc.lit.bare.binding.file>
+ </properties>
+ </profile>
+ <profile>
+ <id>setup.eclipse</id>
+ <properties>
+ <hello.world.binding.file>none</hello.world.binding.file>
+ <doc.lit.bare.binding.file>none</doc.lit.bare.binding.file>
+ </properties>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-tools-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-databinding-jaxb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-soap</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-databinding-jibx</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-local</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-testutils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>${cxf.spring.mock}</artifactId>
+ <version>${cxf.spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.fastinfoset</groupId>
+ <artifactId>FastInfoset</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-bind</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-run</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-schema</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jibx</groupId>
+ <artifactId>jibx-tools</artifactId>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java
new file mode 100644
index 0000000..a7d16b3
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/ClientServerJibxTest.java
@@ -0,0 +1,144 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.jibx;
+
+import java.math.BigDecimal;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jibx.doc_lit_bare.PutLastTradedPricePortType;
+import org.apache.cxf.jibx.doclitbare.types.In;
+import org.apache.cxf.jibx.doclitbare.types.InDecimal;
+import org.apache.cxf.jibx.doclitbare.types.Inout;
+import org.apache.cxf.jibx.doclitbare.types.OutString;
+import org.apache.cxf.jibx.doclitbare.types.StringRespType;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.testutil.common.TestUtil;
+import org.apache.hello_world_soap_http_jibx.jibx.GreetMeFault;
+import org.apache.hello_world_soap_http_jibx.jibx.Greeter;
+import org.apache.hello_world_soap_http_jibx.jibx.PingMeFault;
+import org.apache.hello_world_soap_http_jibx.jibx.SOAPService;
+import org.apache.helloworldsoaphttpjibx.jibx.types.FaultDetail;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class ClientServerJibxTest extends AbstractBusClientServerTestBase {
+ static final String WSDL_PORT = TestUtil.getPortNumber(Server.class);
+
+ private static final QName SERVICE_NAME
+ = new QName("http://apache.org/hello_world_soap_http_jibx/jibx", "SOAPService");
+
+ private static final QName DOC_LIT_BARE_SERVICE =
+ new QName("http://cxf.apache.org/jibx/doc_lit_bare", "SOAPService");
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(Server.class, true));
+ }
+
+ @Test
+ public void testCallFromDocLitBareClient() throws Exception {
+ SpringBusFactory factory = new SpringBusFactory();
+ Bus bus = factory.createBus("org/apache/cxf/systest/jibx/cxf.xml");
+ BusFactory.setDefaultBus(bus);
+ URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl");
+ assertNotNull("We should have found the WSDL here. " , wsdl);
+
+ org.apache.cxf.jibx.doc_lit_bare.SOAPService ss =
+ new org.apache.cxf.jibx.doc_lit_bare.SOAPService(wsdl, DOC_LIT_BARE_SERVICE);
+ PutLastTradedPricePortType port = ss.getSoapPort();
+ updateAddressPort(port, WSDL_PORT);
+
+
+ ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
+ ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
+ StringRespType resp = port.bareNoParam();
+ assertEquals("Get a wrong response", "Get the request!", resp.getStringRespType());
+
+ InDecimal xd = new InDecimal();
+ xd.setInDecimal(new BigDecimal(123));
+ OutString response = port.nillableParameter(xd);
+ assertEquals("Get a wrong response", "Get the request 123", response.getOutString());
+
+ In data = new In();
+ data.setTickerPrice(12.33F);
+ data.setTickerSymbol("CXF");
+ port.putLastTradedPrice(data);
+
+ Inout dataio = new Inout();
+ dataio.setTickerPrice(12.33F);
+ dataio.setTickerSymbol("CXF");
+ Holder<Inout> holder = new Holder<Inout>(dataio);
+ port.sayHi(holder);
+ assertEquals("Get a wrong response", "BAK", holder.value.getTickerSymbol());
+ }
+
+ @Test
+ public void testCallFromClient() throws Exception {
+ SpringBusFactory factory = new SpringBusFactory();
+ Bus bus = factory.createBus("org/apache/cxf/systest/jibx/cxf.xml");
+ BusFactory.setDefaultBus(bus);
+ URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/jibx/hello_world.wsdl");
+ assertNotNull("We should have found the WSDL here. " , wsdl);
+
+ SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
+ Greeter port = ss.getSoapPort();
+ updateAddressPort(port, WSDL_PORT);
+
+ String resp;
+ ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
+ ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
+ resp = port.sayHi();
+ assertEquals("We should get the right response", "Bonjour", resp);
+
+ resp = port.greetMe("Willem");
+ assertEquals("We should get the right response", "Hello Willem", resp);
+
+ try {
+ port.greetMe("fault");
+ fail("Should have been a fault");
+ } catch (GreetMeFault ex) {
+ assertEquals("Some fault detail", ex.getFaultInfo().getGreetMeFaultDetail());
+ }
+
+ try {
+ port.pingMe();
+ fail("We expect exception here");
+ } catch (PingMeFault ex) {
+ FaultDetail detail = ex.getFaultInfo();
+ assertEquals("Wrong faultDetail major", detail.getMajor(), 2);
+ assertEquals("Wrong faultDetail minor", detail.getMinor(), 1);
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java
new file mode 100644
index 0000000..e677586
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/GreeterImpl.java
@@ -0,0 +1,76 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.jibx;
+
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.hello_world_soap_http_jibx.jibx.GreetMeFault;
+import org.apache.hello_world_soap_http_jibx.jibx.Greeter;
+import org.apache.hello_world_soap_http_jibx.jibx.PingMeFault;
+import org.apache.helloworldsoaphttpjibx.jibx.types.FaultDetail;
+
+@javax.jws.WebService(portName = "SoapPort", serviceName = "SOAPService",
+ targetNamespace = "http://apache.org/hello_world_soap_http_jibx/jibx",
+ endpointInterface = "org.apache.hello_world_soap_http_jibx.jibx.Greeter")
+public class GreeterImpl implements Greeter {
+
+ private static final Logger LOG = LogUtils.getL7dLogger(GreeterImpl.class);
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap_http.Greeter#greetMe(java.lang.String)
+ */
+ public String greetMe(String me) throws GreetMeFault {
+ if ("fault".equals(me)) {
+ org.apache.helloworldsoaphttpjibx.jibx.types.GreetMeFaultDetail detail
+ = new org.apache.helloworldsoaphttpjibx.jibx.types.GreetMeFaultDetail();
+ detail.setGreetMeFaultDetail("Some fault detail");
+ throw new GreetMeFault("Fault String", detail);
+ }
+ LOG.info("Executing operation greetMe");
+ return "Hello " + me;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)
+ */
+ public void greetMeOneWay(String me) {
+ LOG.info("Executing operation greetMeOneWay");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap_http.Greeter#sayHi()
+ */
+ public String sayHi() {
+ LOG.info("Executing operation sayHi");
+ return "Bonjour";
+ }
+
+ public void pingMe() throws PingMeFault {
+ // here we need to put the FaultDetail into the FaultDetailDocument
+ FaultDetail faultDetail = new FaultDetail();
+ faultDetail.setMajor((short)2);
+ faultDetail.setMinor((short)1);
+ LOG.info("Executing operation pingMe, throwing PingMeFault exception");
+ throw new PingMeFault("PingMeFault raised by server", faultDetail);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java
new file mode 100644
index 0000000..d799c5d
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/PutLastTradePriceImpl.java
@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.jibx;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.jibx.doc_lit_bare.PutLastTradedPricePortType;
+import org.apache.cxf.jibx.doclitbare.types.In;
+import org.apache.cxf.jibx.doclitbare.types.InDecimal;
+import org.apache.cxf.jibx.doclitbare.types.OutString;
+import org.apache.cxf.jibx.doclitbare.types.StringRespType;
+
+/**
+ *
+ */
+@WebService(targetNamespace = "http://cxf.apache.org/jibx/doc_lit_bare",
+ portName = "SoapPort", serviceName = "SOAPService",
+ endpointInterface = "org.apache.cxf.jibx.doc_lit_bare.PutLastTradedPricePortType"
+)
+public class PutLastTradePriceImpl implements PutLastTradedPricePortType {
+
+ public StringRespType bareNoParam() {
+ StringRespType st = new StringRespType();
+ st.setStringRespType("Get the request!");
+ return st;
+ }
+
+ public void sayHi(javax.xml.ws.Holder<org.apache.cxf.jibx.doclitbare.types.Inout> body) {
+ body.value.setTickerSymbol("BAK");
+ }
+
+
+ public void putLastTradedPrice(In body) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public OutString nillableParameter(InDecimal theRequest) {
+ OutString st = new OutString();
+ st.setOutString("Get the request " + theRequest.getInDecimal().toString());
+ return st;
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/Server.java
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/Server.java b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/Server.java
new file mode 100644
index 0000000..72b495c
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/Server.java
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.jibx;
+
+import javax.xml.ws.Endpoint;
+
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.testutil.common.TestUtil;
+
+public class Server extends AbstractBusTestServerBase {
+ static final String PORT = TestUtil.getPortNumber(Server.class);
+
+ protected void run() {
+ // set the configuration file
+ SpringBusFactory factory = new SpringBusFactory();
+ Bus bus = factory.createBus("org/apache/cxf/systest/jibx/cxf.xml");
+ BusFactory.setDefaultBus(bus);
+ setBus(bus);
+ Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
+ new GreeterImpl());
+
+ Endpoint.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort",
+ new PutLastTradePriceImpl());
+ }
+
+ public static void main(String args[]) {
+ try {
+ Server s = new Server();
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/cxf.xml
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/cxf.xml b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/cxf.xml
new file mode 100644
index 0000000..20832e7
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/java/org/apache/cxf/systest/jibx/cxf.xml
@@ -0,0 +1,32 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+ <jaxws:client name="{http://apache.org/hello_world_soap_http_jibx/jibx}SoapPort" createdFromAPI="true">
+ <!-- jaxws:properties>
+ <entry key="schema-validation-enabled" value="true" />
+ </jaxws:properties-->
+ </jaxws:client>
+ <jaxws:endpoint name="{http://apache.org/hello_world_soap_http_jibx/jibx}SoapPort" wsdlLocation="classpath:wsdl_systest_databinding/jibx/hello_world.wsdl" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="schema-validation-enabled" value="true"/>
+ </jaxws:properties>
+ </jaxws:endpoint>
+ <jaxws:endpoint name="{http://cxf.apache.org/jibx/doc_lit_bare}SoapPort" wsdlLocation="classpath:wsdl_systest_databinding/jibx/doc_lit_bare.wsdl" createdFromAPI="true"/>
+</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/d2dec5b8/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl
----------------------------------------------------------------------
diff --git a/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl b/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl
new file mode 100644
index 0000000..19422e1
--- /dev/null
+++ b/systests/jibx/databinding-jibx/src/test/resources/wsdl_systest_databinding/jibx/doc_lit_bare.wsdl
@@ -0,0 +1,114 @@
+<?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 xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/jibx/doc_lit_bare" xmlns:x1="http://cxf.apache.org/jibx/doc_lit_bare/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cxf.apache.org/jibx/doc_lit_bare" name="DocLitBare">
+ <wsdl:types>
+ <schema xmlns:tns="http://cxf.apache.org/jibx/doc_lit_bare/types" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cxf.apache.org/jibx/doc_lit_bare/types" elementFormDefault="qualified">
+ <complexType name="TradePriceData">
+ <sequence>
+ <element name="tickerSymbol" type="xsd:string"/>
+ <element name="tickerPrice" type="xsd:float"/>
+ </sequence>
+ </complexType>
+ <element name="in" type="tns:TradePriceData"/>
+ <element name="inout" type="tns:TradePriceData"/>
+ <element name="stringRespType" type="xsd:string"/>
+ <element name="inDecimal" nillable="true" type="xsd:decimal"/>
+ <element name="outString" nillable="true" type="xsd:string"/>
+ </schema>
+ </wsdl:types>
+ <message name="PutLastTradedPriceInput">
+ <part name="body" element="x1:in"/>
+ </message>
+ <message name="PutLastTradedPriceOutput"/>
+ <message name="SayHiInput">
+ <part name="body" element="x1:inout"/>
+ </message>
+ <message name="SayHiOutput">
+ <part name="body" element="x1:inout"/>
+ </message>
+ <message name="bareNoParamRequest"/>
+ <message name="bareNoParamResponse">
+ <part element="x1:stringRespType" name="theResponse"/>
+ </message>
+ <message name="nillableRequest">
+ <part name="theRequest" element="x1:inDecimal"/>
+ </message>
+ <message name="nillableResponse">
+ <part name="theResponse" element="x1:outString"/>
+ </message>
+ <portType name="PutLastTradedPricePortType">
+ <operation name="SayHi">
+ <input message="tns:SayHiInput"/>
+ <output message="tns:SayHiOutput"/>
+ </operation>
+ <operation name="PutLastTradedPrice">
+ <input message="tns:PutLastTradedPriceInput"/>
+ <output message="tns:PutLastTradedPriceOutput"/>
+ </operation>
+ <operation name="bareNoParam">
+ <input message="tns:bareNoParamRequest"/>
+ <output message="tns:bareNoParamResponse"/>
+ </operation>
+ <operation name="nillableParameter">
+ <input message="tns:nillableRequest"/>
+ <output message="tns:nillableResponse"/>
+ </operation>
+ </portType>
+ <binding name="PutLastTradedPriceSoapBinding" type="tns:PutLastTradedPricePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="SayHi">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="PutLastTradedPrice">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="bareNoParam">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="nillableParameter">
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:PutLastTradedPriceSoapBinding">
+ <soap:address location="http://localhost:9107/SOAPDocLitBareService/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>