cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r718565 [2/3] - in /cxf/trunk: api/src/main/java/org/apache/cxf/continuations/ api/src/main/java/org/apache/cxf/phase/ api/src/test/java/org/apache/cxf/continuations/ api/src/test/java/org/apache/cxf/phase/ rt/core/src/main/java/org/apache/...
Date Tue, 18 Nov 2008 12:27:36 GMT
Added: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProviderTest.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProviderTest.java (added)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProviderTest.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,63 @@
+/**
+ * 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.transport.jms.continuations;
+
+import org.apache.cxf.continuations.ContinuationWrapper;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.junit.Assert;
+import org.junit.Test;
+
+
+public class JMSContinuationProviderTest extends Assert {
+
+    @Test
+    public void testNoContinuationForOneWay() {
+        Exchange exchange = new ExchangeImpl();
+        exchange.setOneWay(true);
+        Message m = new MessageImpl();
+        m.setExchange(exchange);
+        JMSContinuationProvider provider = new JMSContinuationProvider(null, m, null, null);
+        assertNull(provider.getContinuation());
+    }
+    
+    @Test
+    public void testGetNewContinuation() {
+        Message m = new MessageImpl();
+        m.setExchange(new ExchangeImpl());
+        JMSContinuationProvider provider = new JMSContinuationProvider(null, m, null, null);
+        ContinuationWrapper cw = provider.getContinuation(); 
+        assertTrue(cw.isNew());
+        assertSame(cw, m.get(JMSContinuationWrapper.class));
+    }
+    
+    @Test
+    public void testGetExistingContinuation() {
+        Message m = new MessageImpl();
+        m.setExchange(new ExchangeImpl());
+        JMSContinuationWrapper cw = new JMSContinuationWrapper(null, m, null, null);
+        m.put(JMSContinuationWrapper.class, cw);
+        JMSContinuationProvider provider = new JMSContinuationProvider(null, m, null, null);
+        assertSame(cw, provider.getContinuation());
+        assertSame(cw, m.get(JMSContinuationWrapper.class));
+    }
+}

Propchange: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProviderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationWrapperTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationWrapperTest.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationWrapperTest.java (added)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationWrapperTest.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,140 @@
+/**
+ * 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.transport.jms.continuations;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.continuations.SuspendedInvocationException;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.transport.MessageObserver;
+import org.easymock.classextension.EasyMock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class JMSContinuationWrapperTest extends Assert {
+
+    private Message m;
+    private List<JMSContinuationWrapper> continuations;
+    private Bus b;
+    private MessageObserver observer;
+    
+    @Before
+    public void setUp() {
+        m = new MessageImpl();
+        continuations = new LinkedList<JMSContinuationWrapper>();
+        b = BusFactory.getDefaultBus();
+        observer = EasyMock.createMock(MessageObserver.class);
+    }
+    
+    @Test
+    public void testInitialStatus() {
+        JMSContinuationWrapper cw = 
+            new JMSContinuationWrapper(b, m, observer, continuations);
+        assertTrue(cw.isNew());
+        assertFalse(cw.isPending());
+        assertFalse(cw.isResumed());
+    }
+    
+    @Test
+    public void testSuspendResume() {
+        TestJMSContinuationWrapper cw = 
+            new TestJMSContinuationWrapper(b, m, observer, continuations);
+        try {
+            cw.suspend(5000);
+            fail("SuspendInvocation exception expected");
+        } catch (SuspendedInvocationException ex) {
+            // ignore
+        }
+        assertFalse(cw.isNew());
+        assertTrue(cw.isPending());
+        assertFalse(cw.isResumed());
+        
+        assertTrue(cw.isTaskCreated());
+        assertFalse(cw.isTaskCancelled());
+        assertEquals(continuations.size(), 1);
+        assertSame(continuations.get(0), cw);
+        
+        assertFalse(cw.suspend(1000));
+        
+        observer.onMessage(m);
+        EasyMock.expectLastCall();
+        EasyMock.replay(observer);
+        
+        cw.resume();
+        
+        assertFalse(cw.isNew());
+        assertFalse(cw.isPending());
+        assertTrue(cw.isResumed());
+        
+        assertFalse(cw.isTaskCreated());
+        assertTrue(cw.isTaskCancelled());
+        assertEquals(continuations.size(), 0);
+        EasyMock.verify(observer);
+    }
+    
+    @Test
+    public void testUserObject() {
+        JMSContinuationWrapper cw = 
+            new JMSContinuationWrapper(b, m, observer, continuations);
+        assertNull(cw.getObject());
+        Object userObject = new Object();
+        cw.setObject(userObject);
+        assertSame(userObject, cw.getObject());
+    }
+    
+    private static class TestJMSContinuationWrapper extends JMSContinuationWrapper {
+        
+        private boolean taskCreated;
+        private boolean taskCancelled;
+        
+        public TestJMSContinuationWrapper(Bus b,
+                                          Message m, 
+                                          MessageObserver observer,
+                                          List<JMSContinuationWrapper> cList) {
+            super(b, m, observer, cList);
+        }
+        
+        public void createTimerTask(long timeout) {
+            taskCreated = true;
+        }
+        
+        public void cancelTimerTask() {
+            taskCancelled = true;
+        }
+        
+        public boolean isTaskCreated() {
+            boolean result = taskCreated;
+            taskCreated = false;
+            return result;
+        }
+        
+        public boolean isTaskCancelled() {
+            boolean result = taskCancelled;
+            taskCancelled = false;
+            return result;
+        }
+    }
+}

Propchange: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationWrapperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/continuations/JMSContinuationWrapperTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ClientServerWrappedContinuationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ClientServerWrappedContinuationTest.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ClientServerWrappedContinuationTest.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ClientServerWrappedContinuationTest.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,121 @@
+/**
+ * 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.http_jetty.continuations;
+
+import java.net.URL;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+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.AbstractClientServerTestBase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ClientServerWrappedContinuationTest extends AbstractClientServerTestBase {
+
+    private static final String CLIENT_CONFIG_FILE =
+        "org/apache/cxf/systest/http_jetty/continuations/cxf.xml";
+    private static final String SERVER_CONFIG_FILE =
+        "org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml";
+    
+    public static class Server extends AbstractBusTestServerBase {
+
+        protected void run() {
+            SpringBusFactory bf = new SpringBusFactory();
+            Bus bus = bf.createBus(SERVER_CONFIG_FILE);
+            BusFactory.setDefaultBus(bus);
+            
+            Object implementor = new HelloImplWithWrapppedContinuation();
+            String address = "http://localhost:9092/hellocontinuation";
+            Endpoint.publish(address, implementor);
+        }
+
+        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!");
+            }
+        }
+    }
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", launchServer(Server.class));
+    }
+
+    @Test
+    public void testHttpWrappedContinuatuions() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        Bus bus = bf.createBus(CLIENT_CONFIG_FILE);
+        BusFactory.setDefaultBus(bus);
+        
+        QName serviceName = new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService");
+        
+        URL wsdlURL = new URL("http://localhost:9092/hellocontinuation?wsdl");
+        
+        HelloContinuationService service = new HelloContinuationService(wsdlURL, serviceName);
+        assertNotNull(service);
+        final HelloContinuation helloPort = service.getHelloContinuationPort();
+        
+        ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 0, TimeUnit.SECONDS,
+                                                             new ArrayBlockingQueue<Runnable>(6));
+        CountDownLatch startSignal = new CountDownLatch(1);
+        CountDownLatch controlDoneSignal = new CountDownLatch(5);
+        CountDownLatch helloDoneSignal = new CountDownLatch(5);
+        
+        executor.execute(new ControlWorker(helloPort, "Fred", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Fred", "", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "Barry", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Barry", "Jameson", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "Harry", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Harry", "", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "Rob", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Rob", "Davidson", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "James", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "James", "ServiceMix", startSignal, helloDoneSignal));
+        
+        startSignal.countDown();
+        
+        controlDoneSignal.await(10, TimeUnit.SECONDS);
+        helloDoneSignal.await(10, TimeUnit.SECONDS);
+        executor.shutdownNow();
+        assertEquals("Not all invocations have been resumed", 0, controlDoneSignal.getCount());
+        assertEquals("Not all invocations have completed", 0, helloDoneSignal.getCount());
+    }
+    
+    
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ClientServerWrappedContinuationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ClientServerWrappedContinuationTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ControlWorker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ControlWorker.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ControlWorker.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ControlWorker.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,59 @@
+/**
+ * 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.http_jetty.continuations;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Assert;
+
+public class ControlWorker implements Runnable {
+
+    private HelloContinuation helloPort;
+    private String firstName; 
+    private CountDownLatch startSignal;
+    private CountDownLatch resumeSignal;
+    public ControlWorker(HelloContinuation helloPort,
+                         String firstName,
+                         CountDownLatch startSignal,
+                         CountDownLatch resumeSignal) {
+        this.helloPort = helloPort;
+        this.firstName = firstName;
+        this.startSignal = startSignal;
+        this.resumeSignal = resumeSignal;
+    }
+    
+    public void run() {
+        try {
+            startSignal.await();
+            if (!helloPort.isRequestSuspended(firstName)) {
+                Assert.fail("No suspended invocation for " + firstName);
+            }
+            helloPort.resumeRequest(firstName);
+            resumeSignal.countDown();
+        } catch (InterruptedException ex) {
+            // ignore
+        } catch (RuntimeException ex) {
+            ex.printStackTrace();
+            Assert.fail("Control thread for " + firstName + " failed");
+        }
+        
+    }
+    
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ControlWorker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/ControlWorker.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuation.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuation.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuation.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,36 @@
+/**
+ * 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.http_jetty.continuations;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
+@WebService(name = "HelloContinuation", targetNamespace = "http://cxf.apache.org/systest/jaxws")
+public interface HelloContinuation {
+    @WebMethod(operationName = "sayHi", exclude = false)
+    String sayHi(String firstName, String secondName);
+    
+    @WebMethod(operationName = "isRequestSuspended", exclude = false)
+    boolean isRequestSuspended(String name);
+    
+    @WebMethod(operationName = "resumeRequest", exclude = false)
+    void resumeRequest(String name);
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuation.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuationService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuationService.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuationService.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuationService.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,49 @@
+/**
+ * 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.http_jetty.continuations;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+/**
+ * 
+ */
+
+@WebServiceClient(name = "HelloService", 
+                  targetNamespace = "http://cxf.apache.org/systest/jaxws", 
+                  wsdlLocation = "testutils/hello.wsdl")
+public class HelloContinuationService extends Service {
+    static final QName SERVICE = 
+        new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService");
+    static final QName HELLO_PORT = 
+        new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationPort");
+    public HelloContinuationService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    @WebEndpoint(name = "HelloContinuationPort")
+    public HelloContinuation getHelloContinuationPort() {
+        return (HelloContinuation)super.getPort(HELLO_PORT, HelloContinuation.class);
+    }
+
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuationService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloContinuationService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloImplWithWrapppedContinuation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloImplWithWrapppedContinuation.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloImplWithWrapppedContinuation.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloImplWithWrapppedContinuation.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,125 @@
+/**
+ * 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.http_jetty.continuations;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.continuations.ContinuationProvider;
+import org.apache.cxf.continuations.ContinuationWrapper;
+
+
+@WebService(name = "HelloContinuation", 
+            serviceName = "HelloContinuationService", 
+            portName = "HelloContinuationPort", 
+            targetNamespace = "http://cxf.apache.org/systest/jaxws",
+            endpointInterface = "org.apache.cxf.systest.http_jetty.continuations.HelloContinuation")
+public class HelloImplWithWrapppedContinuation implements HelloContinuation {
+    
+    
+    private Map<String, ContinuationWrapper> suspended = 
+        new HashMap<String, ContinuationWrapper>();
+    
+    
+    @Resource
+    private WebServiceContext context;
+    
+    public String sayHi(String firstName, String secondName) {
+        
+        ContinuationWrapper continuation = getContinuation(firstName);
+        if (continuation == null) {
+            throw new RuntimeException("Failed to get continuation");
+        }
+        synchronized (continuation) {
+            if (continuation.isNew()) {
+                Object userObject = secondName != null && secondName.length() > 0 
+                                    ? secondName : null;
+                continuation.setObject(userObject);
+                suspendInvocation(firstName, continuation);
+            } else {
+                StringBuilder sb = new StringBuilder();
+                sb.append(firstName);
+                
+                // if the actual parameter is not null 
+                if (secondName != null && secondName.length() > 0) {
+                    String surname = continuation.getObject().toString();
+                    sb.append(' ').append(surname);
+                }
+                System.out.println("Saying hi to " + sb.toString());
+                return "Hi " + sb.toString();
+            }
+        }
+        // unreachable
+        return null;
+    }
+
+    public boolean isRequestSuspended(String name) {
+        synchronized (suspended) {
+            while (!suspended.containsKey(name)) {
+                try {
+                    suspended.wait(10000);
+                } catch (InterruptedException ex) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    public void resumeRequest(final String name) {
+        
+        ContinuationWrapper suspendedCont = null;
+        synchronized (suspended) {
+            suspendedCont = suspended.get(name);
+        }
+        
+        if (suspendedCont != null) {
+            synchronized (suspendedCont) {
+                suspendedCont.resume();
+            }
+        }
+    }
+    
+    private void suspendInvocation(String name, ContinuationWrapper cont) {
+        try {
+            cont.suspend(20000);    
+        } finally {
+            synchronized (suspended) {
+                suspended.put(name, cont);
+                suspended.notifyAll();
+            }
+        }
+    }
+    
+    private ContinuationWrapper getContinuation(String name) {
+        synchronized (suspended) {
+            ContinuationWrapper suspendedCont = suspended.remove(name);
+            if (suspendedCont != null) {
+                return suspendedCont;
+            }
+        }
+        
+        ContinuationProvider provider = 
+            (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName());
+        return provider.getContinuation();
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloImplWithWrapppedContinuation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloImplWithWrapppedContinuation.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloWorker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloWorker.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloWorker.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloWorker.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,67 @@
+/**
+ * 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.http_jetty.continuations;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Assert;
+
+public class HelloWorker implements Runnable {
+
+    private HelloContinuation helloPort;
+    private String firstName;
+    private String secondName;
+    private CountDownLatch startSignal;
+    private CountDownLatch doneSignal;
+    public HelloWorker(HelloContinuation helloPort,
+                       String firstName,
+                       String secondName,
+                       CountDownLatch startSignal,
+                       CountDownLatch doneSignal) {
+        this.helloPort = helloPort;
+        this.firstName = firstName;
+        this.secondName = secondName;
+        this.startSignal = startSignal;
+        this.doneSignal = doneSignal;
+    }
+    
+    public void run() {
+        StringBuilder expected = new StringBuilder();
+        expected.append(firstName);
+        if (secondName != null && secondName.length() > 0) {
+            expected.append(' ').append(secondName);
+        }
+        
+        try {
+            startSignal.await();
+            
+            Assert.assertEquals("Wrong hello", "Hi " + expected.toString(), 
+                                helloPort.sayHi(firstName, secondName));
+            doneSignal.countDown();
+        } catch (InterruptedException ex) {
+            // ignore
+        } catch (RuntimeException ex) {
+            ex.printStackTrace();
+            Assert.fail("Hello thread failed for : " + expected.toString());
+        } 
+        
+    }
+    
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloWorker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/HelloWorker.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml Tue Nov 18 04:27:34 2008
@@ -0,0 +1,33 @@
+<?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:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xsi:schemaLocation="
+       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <http:conduit name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.http-conduit">
+        <http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
+    </http:conduit>
+
+</beans>

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/cxf.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml Tue Nov 18 04:27:34 2008
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+       xmlns:sec="http://cxf.apache.org/configuration/security"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans                 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/transports/http/configuration         http://cxf.apache.org/schemas/configuration/http-conf.xsd
+        http://cxf.apache.org/transports/http-jetty/configuration   http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+        http://cxf.apache.org/configuration/security                http://cxf.apache.org/schemas/configuration/security.xsd
+        ">
+
+    <!-- -->
+    <!-- This Spring config file is designed to represent a minimal -->
+    <!-- configuration for spring-loading a CXF servant, where the -->
+    <!-- servant listens using HTTP/S as the transport protocol. -->
+    <!-- -->
+    <!-- Note that the service endpoint is spring-loaded.  In the -->
+    <!-- scenario in which this config is designed to run, the -->
+    <!-- server application merely instantiates a Bus, and does not -->
+    <!-- publish any services programmatically -->
+    <!-- -->
+
+
+    <!-- -->
+    <!-- TLS Port configuration parameters for port 9091 -->
+    <!-- -->
+    <httpj:engine-factory id="port-9091-tls-config">
+        <httpj:engine port="9091">
+            <httpj:tlsServerParameters>
+               <sec:keyManagers keyPassword="password">
+	           <sec:keyStore type="JKS" password="password" 
+	                file="src/test/java/org/apache/cxf/systest/http/resources/Bethal.jks"/>
+	      		</sec:keyManagers>
+	      		<sec:trustManagers>
+	          	<sec:keyStore type="JKS" password="password"
+	               file="src/test/java/org/apache/cxf/systest/http/resources/Truststore.jks"/>
+	     		</sec:trustManagers>
+            </httpj:tlsServerParameters>
+        </httpj:engine>
+    </httpj:engine-factory>
+
+    <!-- -->
+    <!-- HTTP/S configuration for clients -->
+    <!-- -->
+    <http:conduit name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.http-conduit">
+        <http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+	           <sec:keyStore type="JKS" password="password" 
+	                file="src/test/java/org/apache/cxf/systest/http/resources/Morpit.jks"/>
+	           </sec:keyManagers>
+	        <sec:trustManagers>
+	           <sec:keyStore type="JKS" password="password"
+	               file="src/test/java/org/apache/cxf/systest/http/resources/Truststore.jks"/>
+	        </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+
+</beans>
\ No newline at end of file

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jaxws-server.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml Tue Nov 18 04:27:34 2008
@@ -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:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+  xsi:schemaLocation="
+           http://cxf.apache.org/transports/http-jetty/configuration
+              http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+           http://www.springframework.org/schema/beans 
+              http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">              
+ <httpj:engine-factory bus="cxf">
+  <httpj:engine port='9091' continuationsEnabled="true"/>
+ </httpj:engine-factory>
+ 
+ </beans>
\ No newline at end of file

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/jetty-engine.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl Tue Nov 18 04:27:34 2008
@@ -0,0 +1,82 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<wsdl:definitions name="HelloContinuationService" targetNamespace="http://cxf.apache.org/systest/jaxws" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/systest/jaxws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <wsdl:message name="isRequestSuspended">
+    <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="sayHiResponse">
+    <wsdl:part name="return" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="sayHi">
+    <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+    <wsdl:part name="arg1" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="resumeRequestResponse">
+  </wsdl:message>
+  <wsdl:message name="isRequestSuspendedResponse">
+    <wsdl:part name="return" type="xsd:boolean">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="resumeRequest">
+    <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="HelloContinuation">
+    <wsdl:operation name="isRequestSuspended">
+      <wsdl:input message="tns:isRequestSuspended" name="isRequestSuspended">
+    </wsdl:input>
+      <wsdl:output message="tns:isRequestSuspendedResponse" name="isRequestSuspendedResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="resumeRequest">
+      <wsdl:input message="tns:resumeRequest" name="resumeRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:resumeRequestResponse" name="resumeRequestResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="sayHi">
+      <wsdl:input message="tns:sayHi" name="sayHi">
+    </wsdl:input>
+      <wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="HelloContinuationServiceSoapBinding" type="tns:HelloContinuation">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+    <wsdl:operation name="isRequestSuspended">
+      <soap:operation soapAction="" style="rpc" />
+      <wsdl:input name="isRequestSuspended">
+        <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal" />
+      </wsdl:input>
+      <wsdl:output name="isRequestSuspendedResponse">
+        <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal" />
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="resumeRequest">
+      <soap:operation soapAction="" style="rpc" />
+      <wsdl:input name="resumeRequest">
+        <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal" />
+      </wsdl:input>
+      <wsdl:output name="resumeRequestResponse">
+        <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal" />
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="sayHi">
+      <soap:operation soapAction="" style="rpc" />
+      <wsdl:input name="sayHi">
+        <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal" />
+      </wsdl:input>
+      <wsdl:output name="sayHiResponse">
+        <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal" />
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="HelloContinuationService">
+    <wsdl:port binding="tns:HelloContinuationServiceSoapBinding" name="HelloContinuationPort">
+      <soap:address location="https://localhost:9091/hellocontinuation" />
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/continuations/test.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,93 @@
+/**
+ * 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.jms.continuations;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.continuations.ContinuationProvider;
+import org.apache.cxf.continuations.ContinuationWrapper;
+
+
+
+@WebService(serviceName = "HelloWorldService", 
+            portName = "HelloWorldPort",
+            endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
+            targetNamespace = "http://cxf.apache.org/hello_world_jms",
+            wsdlLocation = "testutils/jms_test.wsdl")
+public class GreeterImplWithContinuationsJMS {    
+    
+    @Resource
+    protected WebServiceContext context;
+    private volatile boolean suspended; 
+    
+    public void greetMeOneWay(String name) {
+        throw new UnsupportedOperationException();
+    }
+    
+    public String sayHi() {
+        throw new UnsupportedOperationException();
+    }
+    
+    public void testRpcLitFault(String s) {
+        throw new UnsupportedOperationException();
+    }
+    
+    public String greetMe(String name) {
+        
+        ContinuationWrapper continuation = getContinuation(name);
+        if (continuation == null) {
+            throw new RuntimeException("Failed to get continuation");
+        }
+        synchronized (continuation) {
+            if (continuation.isNew()) {
+                if (suspended) {
+                    throw new RuntimeException("Was already suspended");
+                }
+                Object userObject = "Fred".equals(name) ? "Ruby" : null;
+                continuation.setObject(userObject);
+                suspended = true;
+                continuation.suspend(2000);
+            } else {
+                if (!suspended) {
+                    throw new RuntimeException("Was not suspended yet");
+                }
+                StringBuilder sb = new StringBuilder();
+                sb.append(name);
+                
+                Object userObject = continuation.getObject();
+                if (userObject != null) {
+                    sb.append(' ').append(userObject.toString());
+                }
+                System.out.println("Saying hi to " + sb.toString());
+                return "Hi " + sb.toString();
+            }
+        }
+        // unreachable
+        return null;        
+    }
+    
+    private ContinuationWrapper getContinuation(String name) {
+        
+        ContinuationProvider provider = 
+            (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName());
+        return provider.getContinuation();
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,99 @@
+/**
+ * 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.jms.continuations;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.http_jetty.continuations.HelloContinuation;
+import org.apache.cxf.systest.http_jetty.continuations.HelloContinuationService;
+import org.apache.cxf.systest.http_jetty.continuations.HelloWorker;
+import org.apache.cxf.systest.jms.EmbeddedJMSBrokerLauncher;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
+public class HelloWorldContinuationsClientServerTest extends AbstractBusClientServerTestBase {
+    
+    private static boolean serversStarted;
+    private static final String CONFIG_FILE =
+        "org/apache/cxf/systest/jms/continuations/jms_test_config.xml";
+
+    @Before
+    public void startServers() throws Exception {
+        if (serversStarted) {
+            return;
+        }
+        Map<String, String> props = new HashMap<String, String>();                
+        if (System.getProperty("activemq.store.dir") != null) {
+            props.put("activemq.store.dir", System.getProperty("activemq.store.dir"));
+        }
+        props.put("java.util.logging.config.file", 
+                  System.getProperty("java.util.logging.config.file"));
+        
+        assertTrue("server did not launch correctly", 
+                   launchServer(EmbeddedJMSBrokerLauncher.class, props, null));
+
+        assertTrue("server did not launch correctly", 
+                   launchServer(Server2.class, false));
+        serversStarted = true;
+    }
+    
+    @Test
+    public void testHttpWrappedContinuatuions() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        Bus bus = bf.createBus(CONFIG_FILE);
+        BusFactory.setDefaultBus(bus);
+        
+        QName serviceName = new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService");
+        
+        URL wsdlURL = getClass().getResource("/org/apache/cxf/systest/jms/continuations/test.wsdl");
+        
+        HelloContinuationService service = new HelloContinuationService(wsdlURL, serviceName);
+        assertNotNull(service);
+        final HelloContinuation helloPort = service.getHelloContinuationPort();
+        
+        ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 5, 0, TimeUnit.SECONDS,
+                                                             new ArrayBlockingQueue<Runnable>(10));
+        CountDownLatch startSignal = new CountDownLatch(1);
+        CountDownLatch helloDoneSignal = new CountDownLatch(5);
+        
+        executor.execute(new HelloWorker(helloPort, "Fred", "", startSignal, helloDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Barry", "Jameson", startSignal, helloDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Harry", "", startSignal, helloDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Rob", "Davidson", startSignal, helloDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "James", "ServiceMix", startSignal, helloDoneSignal));
+        
+        startSignal.countDown();
+        helloDoneSignal.await(60, TimeUnit.SECONDS);
+        executor.shutdownNow();
+        assertEquals("Not all invocations have completed", 0, helloDoneSignal.getCount());
+    }
+        
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,151 @@
+/**
+ * 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.jms.continuations;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.continuations.ContinuationProvider;
+import org.apache.cxf.continuations.ContinuationWrapper;
+import org.apache.cxf.systest.http_jetty.continuations.HelloContinuation;
+
+
+
+@WebService(name = "HelloContinuation", 
+            serviceName = "HelloContinuationService", 
+            portName = "HelloContinuationPort", 
+            targetNamespace = "http://cxf.apache.org/systest/jaxws",
+            endpointInterface = "org.apache.cxf.systest.http_jetty.continuations.HelloContinuation",
+            wsdlLocation = "org/apache/cxf/systest/jms/continuations/test.wsdl")
+public class HelloWorldWithContinuationsJMS implements HelloContinuation {    
+    
+    private Map<String, ContinuationWrapper> suspended = 
+        new HashMap<String, ContinuationWrapper>();
+    private Executor executor = new ThreadPoolExecutor(5, 5, 0, TimeUnit.SECONDS,
+                                        new ArrayBlockingQueue<Runnable>(10));
+    
+    @Resource
+    private WebServiceContext context;
+    
+    public String sayHi(String firstName, String secondName) {
+        
+        ContinuationWrapper continuation = getContinuation(firstName);
+        if (continuation == null) {
+            throw new RuntimeException("Failed to get continuation");
+        }
+        synchronized (continuation) {
+            if (continuation.isNew()) {
+                Object userObject = secondName != null && secondName.length() > 0 
+                                    ? secondName : null;
+                continuation.setObject(userObject);
+                suspendInvocation(firstName, continuation);
+            } else {
+                StringBuilder sb = new StringBuilder();
+                sb.append(firstName);
+                
+                // if the actual parameter is not null 
+                if (secondName != null && secondName.length() > 0) {
+                    String surname = continuation.getObject().toString();
+                    sb.append(' ').append(surname);
+                }
+                System.out.println("Saying hi to " + sb.toString());
+                return "Hi " + sb.toString();
+            }
+        }
+        // unreachable
+        return null;
+    }
+
+    public boolean isRequestSuspended(String name) {
+        synchronized (suspended) {
+            while (!suspended.containsKey(name)) {
+                try {
+                    suspended.wait(1000);
+                } catch (InterruptedException ex) {
+                    return false;
+                }
+            }
+        }
+        System.out.println("Invocation for " + name + " has been suspended");
+        
+        return true;
+    }
+
+    public void resumeRequest(final String name) {
+        
+        ContinuationWrapper suspendedCont = null;
+        synchronized (suspended) {
+            suspendedCont = suspended.get(name);
+        }
+        
+        if (suspendedCont != null) {
+            synchronized (suspendedCont) {
+                suspendedCont.resume();
+            }
+        }
+    }
+    
+    private void suspendInvocation(final String name, ContinuationWrapper cont) {
+        
+        System.out.println("Suspending invocation for " + name);
+        
+        try {
+            cont.suspend(500000);    
+        } finally {
+            synchronized (suspended) {
+                suspended.put(name, cont);
+            }
+            executor.execute(new Runnable() {
+                public void run() {
+                    try {
+                        Thread.sleep(2000);
+                    } catch (InterruptedException ex) {
+                        // ignore
+                    }       
+                    resumeRequest(name);
+                }
+            });
+        }
+    }
+    
+    private ContinuationWrapper getContinuation(String name) {
+        
+        System.out.println("Getting continuation for " + name);
+        
+        synchronized (suspended) {
+            ContinuationWrapper suspendedCont = suspended.remove(name);
+            if (suspendedCont != null) {
+                return suspendedCont;
+            }
+        }
+        
+        ContinuationProvider provider = 
+            (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName());
+        return provider.getContinuation();
+    }
+    
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,84 @@
+/**
+ * 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.jms.continuations;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.hello_world_jms.HelloWorldPortType;
+import org.apache.cxf.hello_world_jms.HelloWorldService;
+import org.apache.cxf.systest.jms.EmbeddedJMSBrokerLauncher;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.junit.Before;
+import org.junit.Test;
+
+public class JMSContinuationsClientServerTest extends AbstractBusClientServerTestBase {
+    
+    protected static boolean serversStarted;
+
+    @Before
+    public void startServers() throws Exception {
+        if (serversStarted) {
+            return;
+        }
+        Map<String, String> props = new HashMap<String, String>();                
+        if (System.getProperty("activemq.store.dir") != null) {
+            props.put("activemq.store.dir", System.getProperty("activemq.store.dir"));
+        }
+        props.put("java.util.logging.config.file", 
+                  System.getProperty("java.util.logging.config.file"));
+        
+        assertTrue("server did not launch correctly", 
+                   launchServer(EmbeddedJMSBrokerLauncher.class, props, null));
+
+        assertTrue("server did not launch correctly", 
+                   launchServer(Server.class, false));
+        serversStarted = true;
+    }
+    
+    public URL getWSDLURL(String s) throws Exception {
+        return getClass().getResource(s);
+    }
+    public QName getServiceName(QName q) {
+        return q;
+    }
+    public QName getPortName(QName q) {
+        return q;
+    }
+    
+        
+    @Test
+    public void testContinuationWithTimeout() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                 "HelloWorldService"));
+        QName portName = getPortName(new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldPort"));
+        URL wsdl = getWSDLURL("/org/apache/cxf/systest/jms/continuations/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldService service = new HelloWorldService(wsdl, serviceName);
+        assertNotNull(service);
+
+        HelloWorldPortType greeter = service.getPort(portName, HelloWorldPortType.class);
+        assertEquals("Hi Fred Ruby", greeter.greetMe("Fred"));
+    }
+        
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,46 @@
+/**
+ * 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.jms.continuations;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class Server extends AbstractBusTestServerBase {
+
+
+    protected void run()  {
+        Object implementor = new GreeterImplWithContinuationsJMS();        
+        String address = "http://localhost:9000/SoapContext/SoapPort";
+        Endpoint.publish(address, implementor);
+    }
+
+
+    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!");
+        }
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server2.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server2.java?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server2.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server2.java Tue Nov 18 04:27:34 2008
@@ -0,0 +1,46 @@
+/**
+ * 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.jms.continuations;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class Server2 extends AbstractBusTestServerBase {
+
+   
+    protected void run()  {
+        Object implementor = new HelloWorldWithContinuationsJMS();        
+        String address = "http://localhost:9000/SoapContext/SoapPort";
+        Endpoint.publish(address, implementor);
+    }
+
+
+    public static void main(String[] args) {
+        try {
+            Server2 s = new Server2();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally {
+            System.out.println("done!");
+        }
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/Server2.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl Tue Nov 18 04:27:34 2008
@@ -0,0 +1,177 @@
+<?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.
+-->
+<definitions name="HelloWorldService" 
+    targetNamespace="http://cxf.apache.org/hello_world_jms" 
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:jms="http://cxf.apache.org/transports/jms" 
+    xmlns:x1="http://cxf.apache.org/hello_world_jms/types"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://cxf.apache.org/hello_world_jms" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <types>
+        <schema targetNamespace="http://cxf.apache.org/hello_world_jms/types"      xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://cxf.apache.org/hello_world_jms/types" elementFormDefault="qualified">
+	    <complexType name="ErrorCode">
+		<sequence>
+		    <element name="minor" type="short"/>
+		    <element name="major" type="short"/>
+		</sequence>
+	    </complexType>
+	    <complexType name="testRpcLitFault">
+		<sequence>
+		    <element name="faultType" type="string"/>
+		</sequence>
+	    </complexType>
+	    <complexType name="testRpcLitFaultResponse">
+		<sequence/>
+	    </complexType>
+	    
+	    <element name="NoSuchCodeLit" type="x1:NoSuchCodeLit"/>
+	    <complexType name="NoSuchCodeLit">
+		<sequence>
+		    <element name="code" type="x1:ErrorCode"/>
+		</sequence>
+	    </complexType>
+
+	    <element name="BadRecordLit" type="x1:BadRecordLit"/>
+	    <complexType name="BadRecordLit">
+		<sequence>
+		    <element name="reason" type="string"/>
+		    <element name="code" type="short"/>
+		</sequence>
+	    </complexType>
+	</schema>
+    </types>
+
+    <message name="greetMe">
+        <part name="stringParam0" type="xsd:string"/>
+    </message>
+    <message name="greetMeResponse">
+        <part name="return" type="xsd:string"/>
+    </message>
+    <message name="sayHi"/>
+    <message name="sayHiResponse">
+        <part name="return" type="xsd:string"/>
+    </message>
+    <message name="greetMeOneWay">
+        <part name="stringParam0" type="xsd:string"/>
+    </message>
+    
+    <message name="testRpcLitFaultRequest">
+        <part name="in" type="xsd:string"/>
+    </message>
+    <message name="testRpcLitFaultResponse">
+        <part name="out" type="x1:testRpcLitFaultResponse"/>
+    </message>
+    <message name="NoSuchCodeLitFault">
+        <part name="NoSuchCodeLit" element="x1:NoSuchCodeLit"/>
+    </message>
+    <message name="BadRecordLitFault">
+        <part name="BadRecordLit" element="x1:BadRecordLit"/>
+    </message>
+    
+    <portType name="HelloWorldPortType">
+        <operation name="greetMe">
+            <input message="tns:greetMe" name="greetMe"/>
+            <output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </operation>
+        <operation name="sayHi">
+            <input message="tns:sayHi" name="sayHi"/>
+            <output message="tns:sayHiResponse" name="sayHiResponse"/>
+        </operation>
+        <operation name="greetMeOneWay">
+            <input message="tns:greetMeOneWay" name="greetMeOneWay"/>
+        </operation>
+        <operation name="testRpcLitFault">
+            <input name="testRpcLitFaultRequest" message="tns:testRpcLitFaultRequest"/>
+            <output name="testRpcLitFaultResponse" message="tns:testRpcLitFaultResponse"/>
+            <fault name="NoSuchCodeLitFault" message="tns:NoSuchCodeLitFault"/>
+            <fault name="BadRecordLitFault" message="tns:BadRecordLitFault"/>
+        </operation>
+    </portType>
+    
+    
+    <binding name="HelloWorldPortBinding" type="tns:HelloWorldPortType">
+        <soap:binding style="rpc" transport="http://cxf.apache.org/transports/jms"/>
+        <operation name="greetMe">
+            <soap:operation soapAction="" style="rpc"/>
+            <input name="greetMe">
+                <soap:body 
+                    namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>
+            </input>
+            <output name="greetMeResponse">
+                <soap:body  
+                    namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>
+            </output>
+        </operation>
+        <operation name="sayHi">
+            <soap:operation soapAction="" style="rpc"/>
+            <input name="sayHi">
+                <soap:body 
+                    namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>
+            </input>
+            <output name="sayHiResponse">
+                <soap:body 
+                    namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>
+            </output>
+        </operation>
+        <operation name="greetMeOneWay">
+            <soap:operation style="rpc"/>
+            <input name="greetMeOneWay">
+                <soap:body 
+                    namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>
+            </input>
+        </operation>
+
+         <operation name="testRpcLitFault">
+            <soap:operation style="rpc"/>
+            <input>
+                <soap:body namespace="http://cxf.apache.org/hello_world_jms"  use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://cxf.apache.org/hello_world_jms"  use="literal"/>
+            </output>
+            <fault name="NoSuchCodeLitFault">
+                <soap:fault name="NoSuchCodeLitFault" use="literal"/>
+            </fault>
+            <fault name="BadRecordLitFault">
+                <soap:fault name="BadRecordLitFault" use="literal"/>
+            </fault>
+        </operation>
+    </binding>
+
+            
+    <service name="HelloWorldService">
+           <port binding="tns:HelloWorldPortBinding" name="HelloWorldPort">
+               <jms:clientConfig clientReceiveTimeout="500000" messageTimeToLive="500000"/>
+               <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory" 
+                   jndiDestinationName="dynamicQueues/test.jmstransport.text">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+               </jms:address>
+            
+               <jms:server durableSubscriberName="CXF_subscriber"/>
+           </port>
+    </service>
+    
+        
+</definitions>
+
+

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml?rev=718565&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml Tue Nov 18 04:27:34 2008
@@ -0,0 +1,46 @@
+<?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:ct="http://cxf.apache.org/configuration/types"
+    xmlns:jms="http://cxf.apache.org/transports/jms"
+    xmlns:p="http://www.springframework.org/schema/p"
+    xsi:schemaLocation="
+http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    
+    <jms:conduit name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.jms-conduit">
+      <jms:clientConfig clientReceiveTimeout="500000" messageTimeToLive="500000"/>
+      <jms:jmsConfig-ref>jmsConf1</jms:jmsConfig-ref>
+    </jms:conduit>
+    
+  
+  <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
+  </bean>
+  
+  <bean id="jmsConf1" class="org.apache.cxf.transport.jms.JMSConfiguration"
+  	p:connectionFactory-ref="connectionFactory"
+  	p:concurrentConsumers="10"
+  	p:maxConcurrentConsumers="10"/>
+
+</beans>

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message