cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1141424 - in /cxf/trunk/rt/ws/rm/src: main/resources/schemas/wsdl/ test/java/org/apache/cxf/ws/rm/soap/ test/java/org/apache/cxf/ws/rm/soap/resources/
Date Thu, 30 Jun 2011 07:17:09 GMT
Author: ay
Date: Thu Jun 30 07:17:08 2011
New Revision: 1141424

URL: http://svn.apache.org/viewvc?rev=1141424&view=rev
Log:
[CXF-3623] WSRM AckRange's number parsing not tolerating whitespace after CXF 2.4 upgrade

Added:
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/resources/Acknowledgment2.xml
  (with props)
Modified:
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0-wsa15.xjb
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0.xjb
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xjb
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0-wsa15.xjb
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0-wsa15.xjb?rev=1141424&r1=1141423&r2=1141424&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0-wsa15.xjb (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0-wsa15.xjb Thu Jun 30 07:17:08
2011
@@ -36,35 +36,45 @@
     <jaxb:bindings schemaLocation="wsrm-1.0-wsa15.xsd" node="//xs:element[@name='Nack']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0-wsa15.xsd" node="//xs:element[@name='MessageNumber']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0-wsa15.xsd" node="//xs:element[@name='MaxMessageNumberUsed']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0-wsa15.xsd" node="//xs:attribute[@name='Upper']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0-wsa15.xsd" node="//xs:attribute[@name='Lower']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0.xjb
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0.xjb?rev=1141424&r1=1141423&r2=1141424&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0.xjb (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.0.xjb Thu Jun 30 07:17:08 2011
@@ -36,35 +36,45 @@
     <jaxb:bindings schemaLocation="wsrm-1.0.xsd" node="//xs:element[@name='Nack']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0.xsd" node="//xs:element[@name='MessageNumber']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0.xsd" node="//xs:element[@name='MaxMessageNumberUsed']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0.xsd" node="//xs:attribute[@name='Upper']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.0.xsd" node="//xs:attribute[@name='Lower']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xjb
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xjb?rev=1141424&r1=1141423&r2=1141424&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xjb (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xjb Thu Jun 30 07:17:08 2011
@@ -36,42 +36,54 @@
     <jaxb:bindings schemaLocation="wsrm-1.1.xsd" node="//xs:element[@name='Nack']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.1.xsd" node="//xs:element[@name='MessageNumber']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.1.xsd" node="//xs:attribute[@name='Upper']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.1.xsd" node="//xs:attribute[@name='Lower']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.1.xsd" node="//xs:complexType[@name='CloseSequenceType']//xs:element[@name='LastMsgNumber']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>
     <jaxb:bindings schemaLocation="wsrm-1.1.xsd" node="//xs:complexType[@name='TerminateSequenceType']//xs:element[@name='LastMsgNumber']">
         <jaxb:property>
             <jaxb:baseType>
-                <jaxb:javaType name="java.lang.Long"/>
+                <jaxb:javaType name="java.lang.Long"
+                    parseMethod="javax.xml.bind.DatatypeConverter.parseLong" 
+                    printMethod="javax.xml.bind.DatatypeConverter.printLong"/>
             </jaxb:baseType>
         </jaxb:property>
     </jaxb:bindings>

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java?rev=1141424&r1=1141423&r2=1141424&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
(original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
Thu Jun 30 07:17:08 2011
@@ -58,6 +58,7 @@ import org.apache.cxf.ws.rm.v200702.AckR
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.ObjectFactory;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -274,11 +275,45 @@ public class RMSoapInterceptorTest exten
         assertNotNull(ack);
         assertEquals(ack.getIdentifier().getValue(), SEQ_IDENTIFIER);
         assertEquals(2, ack.getAcknowledgementRange().size());
+        AcknowledgementRange r1 = ack.getAcknowledgementRange().get(0);
+        AcknowledgementRange r2 = ack.getAcknowledgementRange().get(1);
+        verifyRange(r1, 1, 1);
+        verifyRange(r2, 3, 3);
         assertNull(rmps.getSequence());
         assertNull(rmps.getAcksRequested());
     }
 
     @Test
+    public void testDecodeAcknowledgements2() throws XMLStreamException {
+        SoapMessage message = setUpInboundMessage("resources/Acknowledgment2.xml");
+        RMSoapInterceptor codec = new RMSoapInterceptor();
+        codec.handleMessage(message);
+        RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
+        Collection<SequenceAcknowledgement> acks = rmps.getAcks();
+        assertNotNull(acks);
+        assertEquals(1, acks.size());
+        SequenceAcknowledgement ack = acks.iterator().next();
+        assertNotNull(ack);
+        assertEquals(1, ack.getAcknowledgementRange().size());
+        AcknowledgementRange r1 = ack.getAcknowledgementRange().get(0);
+        verifyRange(r1, 1, 3);
+        assertNull(rmps.getSequence());
+        assertNull(rmps.getAcksRequested());
+    }
+
+    private void verifyRange(AcknowledgementRange r, int i, int j) {
+        assertNotNull(r);
+        if (i > 0) {
+            assertNotNull(r.getLower());
+            assertEquals(i, r.getLower().longValue());
+        }
+        if (j > 0) {
+            assertNotNull(r.getUpper());
+            assertEquals(j, r.getUpper().longValue());
+        }
+    }
+
+    @Test
     public void testDecodeAcksRequested() throws XMLStreamException {
         SoapMessage message = setUpInboundMessage("resources/Retransmission.xml");
         RMSoapInterceptor codec = new RMSoapInterceptor();

Added: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/resources/Acknowledgment2.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/resources/Acknowledgment2.xml?rev=1141424&view=auto
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/resources/Acknowledgment2.xml
(added)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/resources/Acknowledgment2.xml
Thu Jun 30 07:17:08 2011
@@ -0,0 +1,36 @@
+<?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.
+-->
+<S:Envelope xmlns:S12="http://www.w3.org/2003/05/soap-envelope"
+xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
+xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
+    <S:Header>
+        <wsa:MessageID>http://fabrikam123.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546810</wsa:MessageID>
+        <wsa:To>http://Business456.com/serviceA/789</wsa:To>
+        <wsa:From>
+            <wsa:Address>http://fabrikam123.com/serviceB/123</wsa:Address>
+        </wsa:From>
+        <wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</wsa:Action>
+        <wsrm:SequenceAcknowledgement> <wsrm:Identifier>http://Business456.com/RM/ABC</wsrm:Identifier>
+            <wsrm:AcknowledgementRange Upper=" 3" Lower=" 1 "/>
+        </wsrm:SequenceAcknowledgement>
+        </S:Header>
+    <S:Body/>
+</S:Envelope>

Propchange: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/resources/Acknowledgment2.xml
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message