cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r604372 - in /incubator/cxf/trunk/api/src: main/java/org/apache/cxf/service/model/AbstractMessageContainer.java test/java/org/apache/cxf/service/model/MessageInfoTest.java
Date Sat, 15 Dec 2007 02:23:09 GMT
Author: bimargulies
Date: Fri Dec 14 18:23:07 2007
New Revision: 604372

URL: http://svn.apache.org/viewvc?rev=604372&view=rev
Log:
Fix CXF-1294.

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessageInfoTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java?rev=604372&r1=604371&r2=604372&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
Fri Dec 14 18:23:07 2007
@@ -86,7 +86,11 @@
      * @param part the message part.
      */
     public void addMessagePart(MessagePartInfo part) {
-        part.setIndex(messageParts.size());
+        if (messageParts.containsKey(part.getName())) {
+            part.setIndex(messageParts.get(part.getName()).getIndex());
+        } else { 
+            part.setIndex(messageParts.size());
+        }
         messageParts.put(part.getName(), part);
     }
 

Modified: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessageInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessageInfoTest.java?rev=604372&r1=604371&r2=604372&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessageInfoTest.java
(original)
+++ incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessageInfoTest.java
Fri Dec 14 18:23:07 2007
@@ -50,6 +50,7 @@
         messageInfo.addMessagePart(qname);
         assertEquals(messageInfo.getMessageParts().size(), 1);
         MessagePartInfo messagePartInfo = messageInfo.getMessagePart(qname);
+        int indexAssigned = messagePartInfo.getIndex();
         assertEquals(messagePartInfo.getName().getLocalPart(), "testMessagePart");
         assertEquals(messagePartInfo.getName().getNamespaceURI(),
                      "http://apache.org/hello_world_soap_http");
@@ -59,6 +60,7 @@
         messageInfo.addMessagePart(messagePartInfo);
         //add two same part, so size is still 1
         assertEquals(messageInfo.getMessageParts().size(), 1);
+        assertEquals(indexAssigned, messagePartInfo.getIndex());
         messagePartInfo = new MessagePartInfo(new QName(
             "http://apache.org/hello_world_soap_http", "testMessagePart2"), messageInfo);
         messageInfo.addMessagePart(messagePartInfo);



Mime
View raw message