ws-wsif-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/providers/jms WSIFOperation_Jms.java
Date Thu, 01 May 2003 13:02:44 GMT
antelder    2003/05/01 06:02:44

  Modified:    java/test/jms ServerSidePropertiesTest.java
               java/src/org/apache/wsif/providers/jms
                        WSIFOperation_Jms.java
  Log:
  Fix the JMS setJMSMessageOutputHeaderProperties method to remove the JMS property part from
the WSIFMessage after setting them
  
  Revision  Changes    Path
  1.3       +14 -1     xml-axis-wsif/java/test/jms/ServerSidePropertiesTest.java
  
  Index: ServerSidePropertiesTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/jms/ServerSidePropertiesTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServerSidePropertiesTest.java	16 Apr 2003 10:11:04 -0000	1.2
  +++ ServerSidePropertiesTest.java	1 May 2003 13:02:44 -0000	1.3
  @@ -57,6 +57,7 @@
   
   package jms;
   
  +import java.util.Iterator;
   import java.util.Map;
   
   import javax.jms.Message;
  @@ -69,7 +70,6 @@
   import junit.framework.TestSuite;
   
   import org.apache.wsif.WSIFMessage;
  -import org.apache.wsif.WSIFRequest;
   import org.apache.wsif.WSIFResponse;
   import org.apache.wsif.WSIFService;
   import org.apache.wsif.WSIFServiceFactory;
  @@ -146,6 +146,8 @@
               WSIFMessage wsifMsg = new WSIFDefaultMessage();
               wsifMsg.setObjectPart("userOutPropPart1", value1);
               wsifMsg.setObjectPart("userOutPropPart2", value2);
  +            
  +            wsifMsg.setObjectPart("realPart", "realValue");
   
               WSIFOperation_Jms.setJMSMessageOutputHeaderProperties(
                   jmsMsg,
  @@ -156,6 +158,17 @@
               assertTrue("property not correctly set!!", value1.equals(x));
               x = jmsMsg.getStringProperty("userOutProperty2");
               assertTrue("property not correctly set!!", value2.equals(x));
  +
  +            Iterator i = wsifMsg.getPartNames();
  +            assertTrue("lost realpart from wsifMsg!!", i.hasNext());
  +
  +            String partName = (String) i.next();            
  +            assertTrue("realpart name wrong in wsifMsg!!", "realPart".equals(partName));
  +
  +            String partValue = (String) wsifMsg.getObjectPart(partName);            
  +            assertTrue("realpart value wrong in wsifMsg!!", "realValue".equals(partValue));
  +
  +            assertTrue("extra parts in wsifMsg!!", !i.hasNext());
   
           } catch (Exception e) {
               e.printStackTrace();
  
  
  
  1.42      +19 -9     xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java
  
  Index: WSIFOperation_Jms.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- WSIFOperation_Jms.java	16 Apr 2003 16:07:02 -0000	1.41
  +++ WSIFOperation_Jms.java	1 May 2003 13:02:44 -0000	1.42
  @@ -1057,6 +1057,8 @@
   
       /**
        * Sets JMS properties on a JMS message
  +     * This has the side effect of removing the JMS properties
  +     * from the srcMsg WSIFMessage.
        * @param targetMsg   the JMS message where properties will be set
        * @param srcMsg   WSIF message containing the JMS property values
        * @param formatter   JMSFormatter holding WSDL definitions defining
  @@ -1082,20 +1084,28 @@
           
           WSIFJMSProperties jmsProps = new WSIFJMSProperties(WSIFJMSProperties.OUT);
   
  +        Map newParts = new HashMap();
           Map properties = getJMSOutputProperties(formatter);
  -        for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) {
  -        	String wsifMsgPart = (String) i.next();
  -        	String jmsProperty = (String) properties.get(wsifMsgPart);
  -        	Object value = null;
  -        	try {
  -        		value = srcMsg.getObjectPart(wsifMsgPart);
  -            	jmsProps.put(jmsProperty, value);
  -        	} catch (WSIFException e) {
  -        		Trc.ignoredException(e);
  +        for (Iterator i = srcMsg.getPartNames(); i.hasNext(); ) {
  +        	String partName = (String) i.next();
  +           	Object value = null;
  +           	try {
  +               	value = srcMsg.getObjectPart(partName);
  +       	    } catch (WSIFException e) {
  +       		    Trc.ignoredException(e);
  +       	    }
  +        	if (properties.containsKey(partName)) {
  +            	String jmsProperty = (String) properties.get(partName);
  +               	jmsProps.put(jmsProperty, value);
  +         	} else {
  +                newParts.put(partName, value);         		
           	}
           }
   
           jmsProps.set(null, targetMsg);        
  +
  +        // replace srcMsg contents to only have non-jms property parts
  +		srcMsg.setParts(newParts);
   
           Trc.exit();
       }
  
  
  

Mime
View raw message