cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r826471 - in /cxf/trunk: rt/core/src/main/java/org/apache/cxf/test/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/beanpostprocessor/
Date Sun, 18 Oct 2009 17:26:58 GMT
Author: bimargulies
Date: Sun Oct 18 17:26:57 2009
New Revision: 826471

URL: http://svn.apache.org/viewvc?rev=826471&view=rev
Log:
CXF-1355: avoid use of old HTTP binding in test, come up with other scheme for
verifying customization somewhat.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsWebServicePublisherBeanPostProcessor.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/beanpostprocessor/CustomizedfBeanPostProcessorTest.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java?rev=826471&r1=826470&r2=826471&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java Sun Oct
18 17:26:57 2009
@@ -37,7 +37,7 @@
 public abstract class AbstractCXFSpringTest extends AbstractCXFTest {
     // subvert JUnit. We want to set up the application context ONCE, since it
     // is likely to include a Jetty or something else that we can't get rid of.
-    private static GenericApplicationContext applicationContext;
+    protected static GenericApplicationContext applicationContext;
     private DefaultResourceLoader resourceLoader;
     private Class<?> configContextClass = AbstractCXFSpringTest.class;
     /**

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsWebServicePublisherBeanPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsWebServicePublisherBeanPostProcessor.java?rev=826471&r1=826470&r2=826471&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsWebServicePublisherBeanPostProcessor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsWebServicePublisherBeanPostProcessor.java
Sun Oct 18 17:26:57 2009
@@ -87,6 +87,9 @@
     private String prototypeDataBindingBeanName;
     private String prototypeServerFactoryBeanName;
     private BeanFactory beanFactory;
+    // for testing
+    private boolean customizedServerFactory;
+    private boolean customizedDataBinding;
     
     public JaxWsWebServicePublisherBeanPostProcessor() throws SecurityException, 
            NoSuchMethodException, ClassNotFoundException {
@@ -160,7 +163,8 @@
             }
             serverFactory = (ServerFactoryBean)
                              beanFactory.getBean(prototypeServerFactoryBeanName, 
-                                                 ServerFactoryBean.class); 
+                                                 ServerFactoryBean.class);
+            customizedServerFactory = true;
         } else {
             serverFactory = new JaxWsServerFactoryBean();
         }
@@ -176,6 +180,7 @@
                     new IllegalArgumentException(
                         "prototypeDataBindingBeanName must indicate a scope='prototype' bean");
             }
+            customizedDataBinding = true;
             dataBinding = (DataBinding)
                              beanFactory.getBean(prototypeDataBindingBeanName, 
                                                  DataBinding.class); 
@@ -249,4 +254,20 @@
     public void setPrototypeDataBindingBeanName(String prototypeDataBindingBeanName) {
         this.prototypeDataBindingBeanName = prototypeDataBindingBeanName;
     }
+    
+    /**
+     * For Unit Test.
+     * @return
+     */
+    public boolean isCustomizedServerFactory() {
+        return customizedServerFactory;
+    }
+
+    /**
+     * For Unit Test.
+     * @return
+     */
+    public boolean isCustomizedDataBinding() {
+        return customizedDataBinding;
+    }
 }

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/beanpostprocessor/CustomizedfBeanPostProcessorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/beanpostprocessor/CustomizedfBeanPostProcessorTest.java?rev=826471&r1=826470&r2=826471&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/beanpostprocessor/CustomizedfBeanPostProcessorTest.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/beanpostprocessor/CustomizedfBeanPostProcessorTest.java
Sun Oct 18 17:26:57 2009
@@ -19,15 +19,7 @@
 
 package org.apache.cxf.systest.jaxws.beanpostprocessor;
 
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.cxf.aegis.databinding.AegisDatabinding;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.jaxws.JaxWsClientFactoryBean;
-import org.apache.cxf.service.Service;
+import org.apache.cxf.jaxws.spring.JaxWsWebServicePublisherBeanPostProcessor;
 import org.apache.cxf.test.AbstractCXFSpringTest;
 
 import org.junit.Test;
@@ -39,19 +31,11 @@
     
     @Test
     public void verifyServices() throws Exception {
-        JaxWsClientFactoryBean cf = new JaxWsClientFactoryBean();
-        cf.setAddress("local://services/Alger");
-        cf.setServiceClass(IWebServiceRUs.class);
-        cf.setBindingId("http://apache.org/cxf/binding/http");
-        Client client = cf.create();
-        String response = (String)client.invoke("consultTheOracle")[0];
-        assertEquals("All your bases belong to us.", response);
-        Service service = WebServiceRUs.getService();
-        assertEquals(AegisDatabinding.class, service.getDataBinding().getClass());
-        Map<QName, Endpoint> endpoints = service.getEndpoints();
-        Endpoint ep = endpoints.values().iterator().next();
-        assertEquals("http://apache.org/cxf/binding/http",
-                     ep.getBinding().getBindingInfo().getBindingId());
+        JaxWsWebServicePublisherBeanPostProcessor 
+            bpp = (JaxWsWebServicePublisherBeanPostProcessor)applicationContext.getBean("postprocess");
+        assertTrue(bpp.isCustomizedDataBinding());
+        assertTrue(bpp.isCustomizedServerFactory());
+        
     }
 
     @Override



Mime
View raw message