You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by tl...@apache.org on 2006/11/24 09:54:43 UTC
svn commit: r478805 [2/2] - in /incubator/cxf/trunk:
common/common/src/main/java/org/apache/cxf/helpers/
distribution/src/main/release/samples/mtom/
distribution/src/main/release/samples/mtom/src/
distribution/src/main/release/samples/mtom/src/demo/ di...
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?view=diff&rev=478805&r1=478804&r2=478805
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Fri Nov 24 00:54:41 2006
@@ -24,9 +24,9 @@
import java.lang.reflect.UndeclaredThrowableException;
import java.util.List;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.mail.util.ByteArrayDataSource;
+// import javax.activation.DataHandler;
+// import javax.activation.DataSource;
+// import javax.mail.util.ByteArrayDataSource;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
@@ -49,8 +49,8 @@
import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.mime.Hello;
-import org.apache.cxf.mtom_xop.HelloImpl;
+import org.apache.cxf.mime.TestMtom;
+import org.apache.cxf.mtom_xop.TestMtomImpl;
import org.apache.cxf.service.Service;
import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
import org.apache.cxf.service.model.EndpointInfo;
@@ -63,13 +63,13 @@
public class ClientMtomXopTest extends ClientServerTestBase {
- public static final QName HELLO_PORT = new QName("http://cxf.apache.org/mime", "HelloPort");
- public static final QName HELLO_SERVICE = new QName("http://cxf.apache.org/mime", "HelloService");
+ public static final QName MTOM_PORT = new QName("http://cxf.apache.org/mime", "TestMtomPort");
+ public static final QName MTOM_SERVICE = new QName("http://cxf.apache.org/mime", "TestMtomService");
public static class Server extends TestServerBase {
protected void run() {
- Object implementor = new HelloImpl();
+ Object implementor = new TestMtomImpl();
String address = "http://localhost:9036/mime-test";
try {
Bus bus = BusFactoryHelper.newInstance().getDefaultBus();
@@ -115,9 +115,9 @@
}
};
}
-
+ /*
public void testMtomSWA() throws Exception {
- Hello hello = createPort(HELLO_SERVICE, HELLO_PORT, Hello.class);
+ TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class);
try {
InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
long fileSize = 0;
@@ -128,7 +128,7 @@
ByteArrayDataSource bads = new ByteArrayDataSource(this.getClass().getResourceAsStream(
"/wsdl/mtom_xop.wsdl"), "application/octet-stream");
DataHandler dh = new DataHandler(bads);
- DataHandler dhResp = hello.claimForm(dh);
+ DataHandler dhResp = mtomPort.testSWA(dh);
DataSource ds = dhResp.getDataSource();
InputStream in = ds.getInputStream();
@@ -141,9 +141,9 @@
throw (Exception) ex.getCause();
}
}
-
- public void xtestMtomXop() throws Exception {
- Hello hello = createPort(HELLO_SERVICE, HELLO_PORT, Hello.class);
+ */
+ public void testMtomXop() throws Exception {
+ TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class);
try {
InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
long fileSize = 0;
@@ -155,7 +155,7 @@
this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl").read(param.value);
String target = new String(param.value);
Holder<String> name = new Holder<String>("call detail");
- hello.detail(name, param);
+ mtomPort.testXop(name, param);
assertEquals("name unchanged", "return detail + call detail", name.value);
assertEquals("attachinfo changed", target, new String(param.value));
} catch (UndeclaredThrowableException ex) {
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ServerMtomXopTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ServerMtomXopTest.java?view=diff&rev=478805&r1=478804&r2=478805
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ServerMtomXopTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ServerMtomXopTest.java Fri Nov 24 00:54:41 2006
@@ -19,18 +19,18 @@
package org.apache.cxf.systest.mtom;
-import java.io.FileOutputStream;
+// import java.io.FileOutputStream;
import java.io.InputStream;
-import java.io.OutputStream;
+// import java.io.OutputStream;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.List;
import java.util.concurrent.TimeUnit;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.mail.util.ByteArrayDataSource;
+// import javax.activation.DataHandler;
+// import javax.activation.DataSource;
+// import javax.mail.util.ByteArrayDataSource;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
@@ -51,8 +51,8 @@
import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.mime.Hello;
-import org.apache.cxf.mtom_xop.HelloImpl;
+import org.apache.cxf.mime.TestMtom;
+import org.apache.cxf.mtom_xop.TestMtomImpl;
import org.apache.cxf.service.Service;
import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
import org.apache.cxf.service.model.EndpointInfo;
@@ -63,12 +63,11 @@
public class ServerMtomXopTest extends ClientServerTestBase {
- public static final QName HELLO_PORT = new QName("http://cxf.apache.org/mime", "HelloPort");
-
- public static final QName HELLO_SERVICE = new QName("http://cxf.apache.org/mime", "HelloService");
+ public static final QName MTOM_PORT = new QName("http://cxf.apache.org/mime", "TestMtomPort");
+ public static final QName MTOM_SERVICE = new QName("http://cxf.apache.org/mime", "TestMtomService");
public void testServer() throws Exception {
- Object implementor = new HelloImpl();
+ Object implementor = new TestMtomImpl();
String address = "http://localhost:9036/mime-test";
Bus bus = BusFactoryHelper.newInstance().getDefaultBus();
@@ -95,15 +94,15 @@
public void run() {
try {
- swaTest();
+ // swaTest();
xopTest();
} catch (Exception e) {
Thread.currentThread().interrupt();
}
}
-
+ /*
private void swaTest() throws Exception {
- Hello hello = createPort(HELLO_SERVICE, HELLO_PORT, Hello.class);
+ TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class);
try {
InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
OutputStream outPre = new FileOutputStream("c:/tmp/swa_pre.wsdl");
@@ -118,7 +117,7 @@
ByteArrayDataSource bads = new ByteArrayDataSource(this.getClass().getResourceAsStream(
"/wsdl/mtom_xop.wsdl"), "application/octet-stream");
DataHandler dh = new DataHandler(bads);
- DataHandler dhResp = hello.claimForm(dh);
+ DataHandler dhResp = mtomPort.testSWA(dh);
DataSource ds = dhResp.getDataSource();
InputStream in = ds.getInputStream();
@@ -134,9 +133,10 @@
throw (Exception) ex.getCause();
}
}
-
+ */
+
private void xopTest() throws Exception {
- Hello hello = createPort(HELLO_SERVICE, HELLO_PORT, Hello.class);
+ TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class);
try {
InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
long fileSize = 0;
@@ -148,7 +148,7 @@
this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl").read(param.value);
String target = new String(param.value);
Holder<String> name = new Holder<String>("call detail");
- hello.detail(name, param);
+ mtomPort.testXop(name, param);
assertEquals("name unchanged", "return detail + call detail", name.value);
assertEquals("attachinfo changed", target, new String(param.value));
} catch (UndeclaredThrowableException ex) {
Added: incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl?view=auto&rev=478805
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl (added)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl Fri Nov 24 00:54:41 2006
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions name="SOAPBuilders-mime-cr-test" xmlns:types="http://cxf.apache.org/mime/types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://cxf.apache.org/mime"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://cxf.apache.org/mime">
+
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cxf.apache.org/mime/types"
+ xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="qualified">
+ <complexType name="XopType">
+ <sequence>
+ <element name="name" type="xsd:string" />
+ <element name="attachinfo" type="xsd:base64Binary" />
+ </sequence>
+ </complexType>
+ <element name="testXop" type="types:XopType" />
+ <element name="testXopResponse" type="types:XopType" />
+ </schema>
+
+ </wsdl:types>
+
+
+ <wsdl:message name="testXopIn">
+ <wsdl:part name="data" element="types:testXop" />
+ </wsdl:message>
+
+ <wsdl:message name="testXopOut">
+ <wsdl:part name="data" element="types:testXopResponse" />
+ </wsdl:message>
+
+
+ <wsdl:portType name="TestMtom">
+
+ <wsdl:operation name="testXop">
+ <wsdl:input message="tns:testXopIn" />
+ <wsdl:output message="tns:testXopOut" />
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="TestMtomBinding" type="tns:TestMtom">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <wsdl:operation name="testXop">
+ <soap:operation soapAction="" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="TestMtomService">
+ <wsdl:port name="TestMtomPort" binding="tns:TestMtomBinding">
+ <soap:address location="http://localhost:9036/mime-test" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/mtom_xop.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml