cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r993429 - in /cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java test/java/org/apache/cxf/jaxws/spi/ProviderImplTest.java
Date Tue, 07 Sep 2010 17:05:46 GMT
Author: sergeyb
Date: Tue Sep  7 17:05:45 2010
New Revision: 993429

URL: http://svn.apache.org/viewvc?rev=993429&view=rev
Log:
Minor update to ProviderImpl to check null or empty custom metadata

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spi/ProviderImplTest.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java?rev=993429&r1=993428&r2=993429&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java Tue
Sep  7 17:05:45 2010
@@ -215,7 +215,7 @@ public class ProviderImpl extends javax.
             if (wsdlDocumentLocation != null
                 || interfaceName != null
                 || serviceName != null
-                || metadata != null) {
+                || (metadata != null && metadata.size() > 0)) {
                 
                         
                 writer.writeStartElement(JAXWSAConstants.WSA_PREFIX, JAXWSAConstants.WSA_METADATA_NAME,

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spi/ProviderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spi/ProviderImplTest.java?rev=993429&r1=993428&r2=993429&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spi/ProviderImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spi/ProviderImplTest.java
Tue Sep  7 17:05:45 2010
@@ -69,6 +69,19 @@ public class ProviderImplTest extends or
     }
     
     @org.junit.Test
+    public void testCreateW3CEprNoMetadataEmptyCustomMetadata() throws Exception {
+        ProviderImpl impl = new ProviderImpl();
+        W3CEndpointReference w3Epr = impl.createW3CEndpointReference(
+           "http://myaddress", null, null, new ArrayList<Element>(), null, null);
+        
+        java.io.StringWriter sw = new java.io.StringWriter();
+        StreamResult result = new StreamResult(sw);
+        w3Epr.writeTo(result);
+        assertTrue("Address is expected", sw.toString().contains("Address"));
+        assertFalse("empty Metadata element should be dropped", sw.toString().contains("Metadata"));
+    }
+    
+    @org.junit.Test
     public void testCreateW3CEprMetadataInterfaceNameOnly() throws Exception {
         QName serviceName = new QName("http://cxf.apache.org", "IntfName");
         ProviderImpl impl = new ProviderImpl();



Mime
View raw message