cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1568249 [2/2] - in /cxf/trunk: rt/transports/jms/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/ rt/transports/jms/src/main/resources/schemas/wsdl/ rt/transpo...
Date Fri, 14 Feb 2014 11:44:10 GMT
Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
Fri Feb 14 11:44:09 2014
@@ -25,7 +25,6 @@ import java.util.concurrent.ExecutionExc
 import java.util.concurrent.Future;
 
 import javax.activation.DataHandler;
-import javax.jms.DeliveryMode;
 import javax.xml.namespace.QName;
 import javax.xml.ws.AsyncHandler;
 import javax.xml.ws.Binding;
@@ -35,7 +34,6 @@ import javax.xml.ws.Holder;
 import javax.xml.ws.Response;
 import javax.xml.ws.soap.AddressingFeature;
 import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -55,10 +53,6 @@ import org.apache.cxf.hello_world_jms.No
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
-import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
-import org.apache.cxf.jms_greeter.JMSGreeterPortType;
-import org.apache.cxf.jms_greeter.JMSGreeterService;
-import org.apache.cxf.jms_greeter.JMSGreeterService2;
 import org.apache.cxf.jms_mtom.JMSMTOMPortType;
 import org.apache.cxf.jms_mtom.JMSMTOMService;
 import org.apache.cxf.jms_mtom.JMSOutMTOMService;
@@ -67,36 +61,26 @@ import org.apache.cxf.testutil.common.Ab
 import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher;
 import org.apache.cxf.transport.jms.AddressType;
 import org.apache.cxf.transport.jms.JMSConduit;
-import org.apache.cxf.transport.jms.JMSConfiguration;
 import org.apache.cxf.transport.jms.JMSConstants;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
 import org.apache.cxf.transport.jms.JMSNamingPropertyType;
-import org.apache.cxf.transport.jms.JMSOldConfigHolder;
 import org.apache.cxf.transport.jms.JMSPropertyType;
-import org.apache.cxf.transport.jms.JNDIConfiguration;
-import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
-import org.apache.cxf.transport.jms.uri.JMSEndpoint;
-import org.apache.cxf.transport.jms.util.JndiHelper;
-import org.apache.cxf.transport.jms.util.TestReceiver;
 import org.apache.hello_world_doc_lit.Greeter;
 import org.apache.hello_world_doc_lit.PingMeFault;
 import org.apache.hello_world_doc_lit.SOAPService2;
-import org.apache.hello_world_doc_lit.SOAPService7;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class JMSClientServerTest extends AbstractBusClientServerTestBase {
-    private static final String BROKER_URI = "vm://JMSClientServerTest" 
-        + "?jms.watchTopicAdvisories=false&broker.persistent=false";
  
     private static EmbeddedJMSBrokerLauncher broker;
     private String wsdlString;
     
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher(BROKER_URI);
+        broker = new EmbeddedJMSBrokerLauncher();
         launchServer(broker);
         launchServer(new Server(broker));
         createStaticBus();
@@ -209,11 +193,6 @@ public class JMSClientServerTest extends
         }
     }
 
-    /*
-     * This test seems to do async calls with a temp queue. Which does not seem to work anymore.
-     * Not sure if it was ever intended that a DefaultMessageListenerContainer can listen
on a temp
-     * queue
-     */
     @Test
     public void testAsyncCall() throws Exception {
         QName serviceName = new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldService");
@@ -277,41 +256,6 @@ public class JMSClientServerTest extends
         f3 = null;
         f4 = null;
         f5 = null;
-
-        /*
-        int count = 20;
-        TestAsyncHandler handlers[] = new TestAsyncHandler[count];
-        Future<?> futures[] = new Future<?>[count];
-        for (int x = 0; x < count; x++) {
-            handlers[x] = new TestAsyncHandler("Handler" + x);
-            futures[x] = greeter.greetMeAsync("PauseForTwoSecs " + handlers[x].getExpected(),
-                                              handlers[x]);
-            //intersperse some sync calls in there....
-            if (x == 2 || x == 5) {
-                assertEquals("Hello World", greeter.greetMe("World"));
-            }
-            if (x == 10) {
-                assertEquals("Hello World", greeter.greetMe("PauseForTwoSecs World"));  
             
-            }
-        }
-        int countDone = 0;
-        for (int x = 0; x < count; x++) {
-            if (futures[x].isDone()) {
-                countDone++;
-            }
-        }
-        assertTrue("Should not all be done.", countDone < count);
-        for (int x = 0; x < count; x++) {
-            assertEquals("Hello " + handlers[x].getExpected(), futures[x].get());
-        }
-        countDone = 0;
-        for (int x = 0; x < count; x++) {
-            if (futures[x].isDone()) {
-                countDone++;
-            }
-        }
-        assertEquals(count, countDone);
-        */
         
         ((java.io.Closeable)greeter).close();
         greeter = null;
@@ -732,181 +676,5 @@ public class JMSClientServerTest extends
         assertEquals("The response file is not same with the original file.", size, bytes.length);
     }
     
-    @Test
-    public void testSpecJMS() throws Exception {
-        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService");
-        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort");
-        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
-        JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
-
-        String response1 = new String("Hello Milestone-");
-        String response2 = new String("Bonjour");
-        JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
-        for (int idx = 0; idx < 5; idx++) {
-
-            greeter.greetMeOneWay("test String");
-
-            String greeting = greeter.greetMe("Milestone-" + idx);
-            assertNotNull("no response received from service", greeting);
-            String exResponse = response1 + idx;
-            assertEquals(exResponse, greeting);
-
-            String reply = greeter.sayHi();
-            assertNotNull("no response received from service", reply);
-            assertEquals(response2, reply);
-        }
-    }
-    
-    @Test
-    public void testWsdlExtensionSpecJMS() throws Exception {
-        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService");
-        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort");
-        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
-        assertNotNull(wsdl);
-
-        JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
-        assertNotNull(service);
 
-        String response = new String("Bonjour");
-        try {
-            JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
-            Map<String, Object> requestContext = ((BindingProvider)greeter).getRequestContext();
-            JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
-            requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
-            
-            String reply = greeter.sayHi();
-            assertNotNull("no response received from service", reply);
-            assertEquals(response, reply);
-            
-            requestContext = ((BindingProvider)greeter).getRequestContext();
-            requestHeader = (JMSMessageHeadersType)requestContext
-                .get(JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
-            assertEquals(requestHeader.getSOAPJMSBindingVersion(), "1.0");
-            assertEquals(requestHeader.getSOAPJMSSOAPAction(), "\"test\"");
-            assertEquals(requestHeader.getTimeToLive(), 3000);
-            assertEquals(requestHeader.getJMSDeliveryMode(), DeliveryMode.PERSISTENT);
-            assertEquals(requestHeader.getJMSPriority(), 7);
-            
-            Map<String, Object> responseContext = ((BindingProvider)greeter).getResponseContext();
-            JMSMessageHeadersType responseHeader = (JMSMessageHeadersType)responseContext
-                .get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
-            assertEquals(responseHeader.getSOAPJMSBindingVersion(), "1.0");
-            assertEquals(responseHeader.getSOAPJMSSOAPAction(), null);
-            assertEquals(responseHeader.getJMSDeliveryMode(), DeliveryMode.PERSISTENT);
-            assertEquals(responseHeader.getJMSPriority(), 7);
-            
-        } catch (UndeclaredThrowableException ex) {
-            throw (Exception)ex.getCause();
-        }
-    }
-
-    @Test
-    public void testWsdlExtensionSpecJMSPortError() throws Exception {
-        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService2");
-        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort2");
-        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
-        assertNotNull(wsdl);
-
-        JMSGreeterService2 service = new JMSGreeterService2(wsdl, serviceName);
-        assertNotNull(service);
-
-        String response = new String("Bonjour");
-        JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
   
-        String reply = greeter.sayHi();
-        assertNotNull("no response received from service", reply);
-        assertEquals(response, reply); 
-    }
-    
-    @Test 
-    public void testSpecNoWsdlService() throws Exception {
-        specNoWsdlService(null);
-    }
-    
-    @Test
-    public void testSpecNoWsdlServiceWithDifferentMessageType() throws Exception {
-        specNoWsdlService("text");
-        specNoWsdlService("byte");
-        specNoWsdlService("binary");
-    }
-    
-    private void specNoWsdlService(String messageType) throws Exception {
-        String address = "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue3"
-            + "?jndiInitialContextFactory"
-            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-            + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=" 
-            + broker.getEncodedBrokerURL();
-        if (messageType != null) {
-            address = address + "&messageType=" + messageType;
-        }
-
-        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
-        factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
-        factory.setServiceClass(Hello.class);
-        factory.setAddress(address);
-        Hello client = (Hello)factory.create();
-        String reply = client.sayHi(" HI");
-        assertEquals(reply, "get HI");
-    }
-    
-    @Test
-    public void testBindingVersionError() throws Exception {
-        QName serviceName = new QName("http://cxf.apache.org/jms_greeter", "JMSGreeterService");
-        QName portName = new QName("http://cxf.apache.org/jms_greeter", "GreeterPort");
-        URL wsdl = getWSDLURL("/wsdl/jms_spec_test.wsdl");
-
-        JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
-
-        JMSGreeterPortType greeter = service.getPort(portName, JMSGreeterPortType.class);
-        BindingProvider  bp = (BindingProvider)greeter;
-        
-        Map<String, Object> requestContext = bp.getRequestContext();
-        JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
-        requestHeader.setSOAPJMSBindingVersion("0.3");
-        requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
- 
-        try {
-            greeter.greetMe("Milestone-");
-            fail("Should have thrown a fault");
-        } catch (SOAPFaultException ex) {
-            assertTrue(ex.getMessage().contains("0.3"));
-            Map<String, Object> responseContext = bp.getResponseContext();
-            JMSMessageHeadersType responseHdr = 
-                 (JMSMessageHeadersType)responseContext.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
-            if (responseHdr == null) {
-                fail("response Header should not be null");
-            }
-            assertTrue(responseHdr.isSOAPJMSIsFault());
-        }
-
-    }
-    
-    @Test
-    public void testReplyToConfig() throws Exception {
-        JMSEndpoint endpoint = new JMSEndpoint();
-        endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
-        endpoint.setJndiURL(broker.getBrokerURL());
-        endpoint.setJndiConnectionFactoryName("ConnectionFactory");
-
-        final JMSConfiguration jmsConfig = new JMSConfiguration();        
-        JndiHelper jt = new JndiHelper(JMSOldConfigHolder.getInitialContextEnv(endpoint));
-        
-        JNDIConfiguration jndiConfig = new JNDIConfiguration();
-        jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
-        jmsConfig.setJndiTemplate(jt);
-        jmsConfig.setJndiConfig(jndiConfig);
-        
-        TestReceiver receiver = new TestReceiver(jmsConfig.getConnectionFactory(), 
-                                                 "dynamicQueues/SoapService7.replyto.queue",
false);
-        receiver.setStaticReplyQueue("dynamicQueues/SoapService7.reply.queue");
-        receiver.runAsync();
-        
-        QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService7");
-        QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort7");
-        URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
-        SOAPService7 service = new SOAPService7(wsdl, serviceName);        
-        Greeter greeter = service.getPort(portName, Greeter.class);
-        String name = "FooBar";
-        String reply = greeter.greetMe(name);
-        assertEquals(reply, "Hello " + name);
-    }
 }

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSSharedQueueTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSSharedQueueTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSSharedQueueTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSSharedQueueTest.java
Fri Feb 14 11:44:09 2014
@@ -43,15 +43,15 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class JMSSharedQueueTest extends AbstractBusClientServerTestBase {
-    private static final String BROKER_URI = "vm://SharedQueueTest" 
-        + "?jms.watchTopicAdvisories=false&broker.persistent=false";
+//    private static final String BROKER_URI = "vm://SharedQueueTest" 
+//        + "?jms.watchTopicAdvisories=false&broker.persistent=false";
  
     private static EmbeddedJMSBrokerLauncher broker;
     private String wsdlString;
     
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher(BROKER_URI);
+        broker = new EmbeddedJMSBrokerLauncher();
         launchServer(broker);
         launchServer(new Server(broker));
         createStaticBus();

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsClientServerTest.java
Fri Feb 14 11:44:09 2014
@@ -68,7 +68,7 @@ public class HelloWorldContinuationsClie
 
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher("vm://HelloWorldContinuationsClientServerTest");
+        broker = new EmbeddedJMSBrokerLauncher();
         System.setProperty("EmbeddedBrokerURL", broker.getBrokerURL());
         launchServer(broker);
         launchServer(new Server(broker));

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldContinuationsThrottleTest.java
Fri Feb 14 11:44:09 2014
@@ -59,7 +59,7 @@ public class HelloWorldContinuationsThro
     }
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher("vm://HelloWorldContinuationsThrottleTest");
+        broker = new EmbeddedJMSBrokerLauncher();
         System.setProperty("EmbeddedBrokerURL", broker.getBrokerURL());
         launchServer(broker);
         launchServer(new Server());

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/JMSContinuationsClientServerTest.java
Fri Feb 14 11:44:09 2014
@@ -55,7 +55,7 @@ public class JMSContinuationsClientServe
     
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher("vm://JMSContinuationsClientServerTest");
+        broker = new EmbeddedJMSBrokerLauncher();
         System.setProperty("EmbeddedBrokerURL", broker.getBrokerURL());
         launchServer(broker);
         launchServer(new Server());

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/continuations/ProviderJMSContinuationTest.java
Fri Feb 14 11:44:09 2014
@@ -57,7 +57,7 @@ public class ProviderJMSContinuationTest
     
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher("vm://ProviderJMSContinuationTest");
+        broker = new EmbeddedJMSBrokerLauncher();
         System.setProperty("EmbeddedBrokerURL", broker.getBrokerURL());
         launchServer(broker);
         launchServer(new Server());

Modified: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/swa/ClientServerSwaTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/swa/ClientServerSwaTest.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/swa/ClientServerSwaTest.java
(original)
+++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/swa/ClientServerSwaTest.java
Fri Feb 14 11:44:09 2014
@@ -67,8 +67,7 @@ public class ClientServerSwaTest extends
 
     @BeforeClass
     public static void startServers() throws Exception {
-        broker = new EmbeddedJMSBrokerLauncher("vm://ClientServerSwaTest" 
-            + "?jms.watchTopicAdvisories=false&broker.persistent=false");
+        broker = new EmbeddedJMSBrokerLauncher();
         System.setProperty("EmbeddedBrokerURL", broker.getBrokerURL());
         launchServer(broker);
         launchServer(new Server());

Modified: cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/EmbeddedJMSBrokerLauncher.java
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/EmbeddedJMSBrokerLauncher.java?rev=1568249&r1=1568248&r2=1568249&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/EmbeddedJMSBrokerLauncher.java
(original)
+++ cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/EmbeddedJMSBrokerLauncher.java
Fri Feb 14 11:44:09 2014
@@ -169,13 +169,14 @@ public class EmbeddedJMSBrokerLauncher e
     public final void run() {
         try {             
             broker = new BrokerService();
+            broker.setPersistent(false);
             broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
             broker.setTmpDataDirectory(new File("./target"));
             broker.setUseJmx(false);
             if (brokerName != null) {
                 broker.setBrokerName(brokerName);
             }
-            broker.addConnector(brokerUrl1 + "?daemon=true");
+            broker.addConnector(brokerUrl1);
             broker.start();  
         } catch (Exception e) {
             e.printStackTrace();



Mime
View raw message