[jboss-svn-commits] JBossWS SVN: r1117 - in trunk/src: main/java/org/jboss/ws/soap main/java/org/jboss/ws/xop test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8 test/java/org/jboss/test/ws/jaxrpc/xop test/java/org/jboss/test/ws/jaxrpc/xop/doclit
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Oct 2 09:01:49 EDT 2006
Author: heiko.braun at jboss.com
Date: 2006-10-02 09:01:38 -0400 (Mon, 02 Oct 2006)
New Revision: 1117
Added:
trunk/src/main/java/org/jboss/ws/soap/SAAJVisitable.java
trunk/src/main/java/org/jboss/ws/soap/SAAJVisitor.java
trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java
trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java
trunk/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/SecureMTOMTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java
Log:
merged MTOM revamp from branch 1.0
Added: trunk/src/main/java/org/jboss/ws/soap/SAAJVisitable.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SAAJVisitable.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/main/java/org/jboss/ws/soap/SAAJVisitable.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,31 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.soap;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Sep 26, 2006
+ */
+public interface SAAJVisitable {
+ public void accept(SAAJVisitor visitor);
+}
Property changes on: trunk/src/main/java/org/jboss/ws/soap/SAAJVisitable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/soap/SAAJVisitor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SAAJVisitor.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/main/java/org/jboss/ws/soap/SAAJVisitor.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.soap;
+
+import javax.xml.soap.SOAPElement;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Sep 26, 2006
+ */
+public interface SAAJVisitor {
+ void visitSOAPElement(SOAPElementImpl soapElement);
+ void visitSOAPContentElement(SOAPContentElement scElement);
+}
Property changes on: trunk/src/main/java/org/jboss/ws/soap/SAAJVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.xop;
+
+import org.jboss.ws.jaxrpc.StubExt;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.MessageContext;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Oct 2, 2006
+ */
+public class DisableMTOMHandler extends GenericHandler {
+ public QName[] getHeaders() {
+ return new QName[0];
+ }
+
+ public boolean handleRequest(MessageContext msgContext) {
+ disableMTOM(msgContext);
+ return true;
+ }
+
+ public boolean handleResponse(MessageContext msgContext) {
+ disableMTOM(msgContext);
+ return true;
+ }
+
+ public boolean handleFault(MessageContext msgContext) {
+ disableMTOM(msgContext);
+ return true;
+ }
+
+ public void disableMTOM(MessageContext msgContext)
+ {
+ msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/xop/DisableMTOMHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.xop;
+
+import org.jboss.ws.soap.SAAJVisitor;
+import org.jboss.ws.soap.SOAPContentElement;
+import org.jboss.ws.soap.SOAPElementImpl;
+
+import java.util.Iterator;
+
+/**
+ * Visit soap object model and restore XOP contents.
+ * This visitor is invoked when:
+ * <ul>
+ * <li>Client side request handler chain has been executed
+ * <li>Server side response or fault handler chain been executed
+ * </ul>
+ *
+ * It basically takes care that when jaxrpc handlers have been in place,
+ * the XOP contents are being restored upon request and response.
+ *
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Sep 26, 2006
+ */
+public class RestoreXOPElementVisitor implements SAAJVisitor {
+
+ public void visitXOPElements(SOAPElementImpl root)
+ {
+ boolean isSCE = (root instanceof SOAPContentElement);
+
+ // don't expand SOAPContentElements
+ if(isSCE)
+ {
+ root.accept(this);
+ }
+ else
+ {
+ Iterator it = root.getChildElements();
+ while(it.hasNext())
+ {
+ visitXOPElements((SOAPElementImpl)it.next());
+ }
+ }
+ }
+
+ public void visitSOAPElement(SOAPElementImpl soapElement) {
+ // nada
+ }
+
+ public void visitSOAPContentElement(SOAPContentElement scElement) {
+ scElement.handleMTOMTransitions();
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/SecureMTOMTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/SecureMTOMTestCase.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/SecureMTOMTestCase.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.interop.microsoft.mtom.utf8;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.interop.microsoft.ClientScenario;
+import org.jboss.test.ws.interop.microsoft.InteropConfigFactory;
+
+import javax.naming.InitialContext;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
+
+/**
+ * Scenario 3.7 and 3.8 exercise composition of MTOM with Security.
+ *
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Aug 24, 2006
+ */
+public class SecureMTOMTestCase extends JBossWSTest {
+
+ IMtomTest port;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(SecureMTOMTestCase.class, "jbossws-interop-mtomUTF8_wsse-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ if (port == null )
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/interop/MTOMUTF8Service_wsse");
+ port = (IMtomTest)service.getPort(IMtomTest.class);
+ configureClient();
+ }
+
+ System.setProperty("org.jboss.ws.wsse.keyStore", "resources/interop/microsoft/security/wsse10Shared/META-INF/alice.jks");
+ System.setProperty("org.jboss.ws.wsse.trustStore", "resources/interop/microsoft/security/wsse10Shared/META-INF/wsse10.truststore");
+ System.setProperty("org.jboss.ws.wsse.keyStorePassword", "password");
+ System.setProperty("org.jboss.ws.wsse.trustStorePassword", "password");
+ System.setProperty("org.jboss.ws.wsse.keyStoreType", "jks");
+ System.setProperty("org.jboss.ws.wsse.trustStoreType", "jks");
+ }
+
+ private void configureClient() {
+
+ InteropConfigFactory factory = InteropConfigFactory.newInstance();
+ ClientScenario scenario = factory.createClientScenario(System.getProperty("client.scenario"));
+ if(scenario!=null)
+ {
+ log.info("Using scenario: " + scenario);
+ ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, scenario.getTargetEndpoint().toString());
+ }
+ else
+ {
+ throw new IllegalStateException("Failed to load client scenario");
+ }
+ }
+
+ /**
+ * Scenario #3.7. Composition with WS-Security 1.0, Sign Only
+ *
+ */
+ public void testScenario_3_7() throws Exception
+ {
+ String s = "testScenario_3_7";
+ EchoBinaryAsStringResponse response = port.echoBinaryAsString( new EchoBinaryAsString(s.getBytes()));
+ assertNotNull(response);
+ assertEquals(response.getEchoBinaryAsStringResult(), s);
+ }
+
+}
Property changes on: trunk/src/test/java/org/jboss/test/ws/interop/microsoft/mtom/utf8/SecureMTOMTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.FileInputStream;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Sep 22, 2006
+ */
+public class XOPTestSupport {
+
+ public static byte[] getBytesFromFile(File file) throws IOException {
+ InputStream is = new FileInputStream(file);
+
+ long length = file.length();
+ byte[] bytes = new byte[(int)length];
+
+ int offset = 0;
+ int numRead = 0;
+ while (offset < bytes.length
+ && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
+ offset += numRead;
+ }
+
+ is.close();
+ return bytes;
+ }
+}
Property changes on: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,82 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.doclit;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
+import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
+import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
+import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.jaxrpc.StubExt;
+
+import javax.activation.DataHandler;
+import javax.xml.rpc.Stub;
+import java.io.File;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Sep 25, 2006
+ */
+public abstract class XOPBase extends JBossWSTest {
+
+ protected TestService_PortType port;
+
+ public void testRequestResponseOptimized() throws Exception {
+
+ DataHandler dh = new DataHandler("Another plain text attachment", "text/plain");
+ byte[] bytesIn = IOUtils.convertToBytes(dh);
+ PingMsgResponse value = port.ping(new PingMsg("1|1", bytesIn));
+ assertNotNull("Return value was null", value);
+ byte[] bytesOut = value.getXopContent();
+ assertNotNull("Returned xopContent was null", bytesOut);
+ assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
+ }
+
+ public void testResponseOptimized() throws Exception {
+
+ byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/samples/mtom/attach.jpeg"));
+
+ // disable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingMsgResponse value = port.ping(new PingMsg("0|1", bytesIn));
+ assertNotNull("Return value was null",value);
+ byte[] bytesOut = value.getXopContent();
+ assertNotNull("Return xopContent was null", bytesOut);
+ assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
+ }
+
+ public void testRequestOptimized() throws Exception {
+
+ byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/samples/mtom/attach.jpeg"));
+
+ // reusing the stub means cleaning the previous state
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingMsgResponse value = port.ping(new PingMsg("1|0", bytesIn));
+ assertNotNull("Return value was null",value);
+ byte[] bytesOut = value.getXopContent();
+ assertNotNull("Return xopContent was null", bytesOut);
+ assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
+ }
+}
Property changes on: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.doclit;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
+import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
+import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
+import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.jaxrpc.StubExt;
+
+import javax.naming.InitialContext;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
+import javax.activation.DataHandler;
+import java.io.File;
+
+/**
+ * Test MTOM functionality with jaxrpc-handlers in place.<br>
+ * This basically determines wether XB needs to handle base64 values directly
+ * or uses callbacks to XOPMarshaller/Unmarshaller.
+ *
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Sep 22, 2006
+ */
+public class XOPHandlerTestCase extends XOPBase {
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(XOPHandlerTestCase.class, "jaxrpc-xop-doclit_handler.war, jaxrpc-xop-doclit_handler-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ if (port == null)
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPHandlerTestCase");
+ port = (TestService_PortType)service.getPort(TestService_PortType.class);
+ }
+
+ //((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8081/jaxrpc-xop-doclit_handler");
+ }
+}
Property changes on: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java 2006-10-02 13:01:18 UTC (rev 1116)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java 2006-10-02 13:01:38 UTC (rev 1117)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxrpc.xop.doclit;
+
+// $Id$
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
+import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
+import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
+import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.utils.IOUtils;
+
+import javax.activation.DataHandler;
+import javax.naming.InitialContext;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
+import java.io.File;
+
+/**
+ * Test MTOM functionaly without any jaxrpc handlers in place.
+ *
+ * @author Heiko.Braun at jboss.org
+ * @since Sep 22, 2006
+ */
+public class XOPTestCase extends XOPBase {
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(XOPTestCase.class, "jaxrpc-xop-doclit.war, jaxrpc-xop-doclit-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ if (port == null)
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPTestCase");
+ port = (TestService_PortType)service.getPort(TestService_PortType.class);
+ }
+
+ //((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8081/jaxrpc-xop-doclit");
+ }
+
+}
Property changes on: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
More information about the jboss-svn-commits
mailing list