You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Sanka Samaranayake <ss...@gmail.com> on 2005/10/07 18:40:20 UTC

[Sandesha2][Patch] Few more testcases

Dear Sandesha2 Committers,

Please accept this pactch which contains some testcases for *.wsrm.* 
package ...

--Sanka

Re: [Sandesha2][Patch] Few more testcases

Posted by Jaliya Ekanayake <ja...@opensource.lk>.
Applied. Thanks.

Jaliya
----- Original Message ----- 
From: "Sanka Samaranayake" <ss...@gmail.com>
To: <sa...@ws.apache.org>
Sent: Friday, October 07, 2005 11:40 AM
Subject: [Sandesha2][Patch] Few more testcases


> Dear Sandesha2 Committers,
>
> Please accept this pactch which contains some testcases for *.wsrm.*
> package ...
>
> --Sanka
>


--------------------------------------------------------------------------------


> Index: test-resources/SequenceAcknowledgement.xml
> ===================================================================
> --- test-resources/SequenceAcknowledgement.xml (revision 0)
> +++ test-resources/SequenceAcknowledgement.xml (revision 0)
> @@ -0,0 +1,20 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:8d8f8d80-1624-11da-a28e-b3b9c4e71445</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +         <wsrm:SequenceAcknowledgement soapenv:mustUnderstand="1">
> +            <wsrm:AcknowledgementRange Upper="2" Lower="1"/>
> + <wsrm:AcknowledgementRange Upper="6" Lower="4"/>
> + <wsrm:AcknowledgementRange Upper="10" Lower="8"/>
> +            <wsrm:Nack>3</wsrm:Nack>
> +            <wsrm:Nack>7</wsrm:Nack>
> + 
> <wsrm:Identifier>uuid:897ee740-1624-11da-a28e-b3b9c4e71445</wsrm:Identifier>
> +         </wsrm:SequenceAcknowledgement>
> +      </soapenv:Header>
> +      <soapenv:Body/>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/SequenceAcknowledgement.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/TerminateSequence.xml
> ===================================================================
> --- test-resources/TerminateSequence.xml (revision 0)
> +++ test-resources/TerminateSequence.xml (revision 0)
> @@ -0,0 +1,16 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:64f5c3c0-1625-11da-a28e-b3b9c4e71445</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <wsrm:TerminateSequence>
> + 
> <wsrm:Identifier>uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06</wsrm:Identifier>
> +         </wsrm:TerminateSequence>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/TerminateSequence.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/Sequence.xml
> ===================================================================
> --- test-resources/Sequence.xml (revision 0)
> +++ test-resources/Sequence.xml (revision 0)
> @@ -0,0 +1,21 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:8c00b020-1624-11da-a28e-b3b9c4e71445</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">urn:wsrm:echoStringResponse</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +         <wsa:RelatesTo RelationshipType="wsa:Reply" 
> soapenv:mustUnderstand="1">uuid:87a0b160-1624-11da-bed9-84d13db13902</wsa:RelatesTo>
> +         <wsrm:Sequence soapenv:mustUnderstand="1">
> + 
> <wsrm:Identifier>uuid:879da420-1624-11da-bed9-84d13db13902</wsrm:Identifier>
> +            <wsrm:MessageNumber>1</wsrm:MessageNumber>
> +         </wsrm:Sequence>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <ns1:echoStringResponse 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
> xmlns:ns1="http://tempuri.org/">
> +            <echoStringReturn xsi:type="soapenc:string" 
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Sandesha Echo 
> 1</echoStringReturn>
> +         </ns1:echoStringResponse>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/Sequence.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/CreateSequenceResponse.xml
> ===================================================================
> --- test-resources/CreateSequenceResponse.xml (revision 0)
> +++ test-resources/CreateSequenceResponse.xml (revision 0)
> @@ -0,0 +1,22 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:88754b00-161a-11da-b6d6-8198de3c47c5</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +         <wsa:RelatesTo 
> RelationshipType="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
> soapenv:mustUnderstand="1" 
> xmlns:http="wsa">uuid:872e4c10-161a-11da-9ef7-bd9ad94438a3</wsa:RelatesTo>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <wsrm:CreateSequenceResponse>
> + 
> <wsrm:Identifier>uuid:88754b00-161a-11da-b6d6-8198de3c47c5</wsrm:Identifier>
> +            <wsrm:Accept>
> +               <wsrm:AcksTo>
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +               </wsrm:AcksTo>
> +            </wsrm:Accept>
> +         </wsrm:CreateSequenceResponse>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/CreateSequenceResponse.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/CreateSequence.xml
> ===================================================================
> --- test-resources/CreateSequence.xml (revision 0)
> +++ test-resources/CreateSequence.xml (revision 0)
> @@ -0,0 +1,24 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="0">uuid:c3671020-15e0-11da-9b3a-f0439d4867bd</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="0">http://localhost:8070/axis/services/TestService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="0">
> + 
> <wsa:Address>http://192.168.1.4:9090/axis/services/RMService</wsa:Address>
> +         </wsa:From>
> +         <wsa:ReplyTo soapenv:mustUnderstand="0">
> + 
> <wsa:Address>http://127.0.0.1:9090/axis/services/RMService</wsa:Address>
> +         </wsa:ReplyTo>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <wsrm:CreateSequence>
> +            <wsrm:AcksTo>
> + 
> <wsa:Address>http://127.0.0.1:9090/axis/services/RMService</wsa:Address>
> +            </wsrm:AcksTo>
> +            <wsrm:Offer>
> + 
> <wsrm:Identifier>uuid:c3671020-15e0-11da-9b3b-f0439d4867bd</wsrm:Identifier>
> +            </wsrm:Offer>
> +         </wsrm:CreateSequence>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/CreateSequence.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
>


--------------------------------------------------------------------------------


> Index: test/org/apache/sandesha2/SimpleServerImpl.java
> ===================================================================
> --- test/org/apache/sandesha2/SimpleServerImpl.java (revision 307077)
> +++ test/org/apache/sandesha2/SimpleServerImpl.java (working copy)
> @@ -1,24 +0,0 @@
> -/*
> - * Created on Aug 26, 2005
> - *
> - * TODO To change the template for this generated file go to
> - * Window - Preferences - Java - Code Style - Code Templates
> - */
> -package org.apache.sandesha2;
> -
> -import java.io.IOException;
> -
> -import org.apache.axis2.transport.http.SimpleHTTPServer;
> -
> -/**
> - * @author
> - *
> - */
> -public class SimpleServerImpl {
> -
> -    public static void main(String[] args) throws IOException {
> -        SimpleHTTPServer simpleServer = new 
> SimpleHTTPServer("/home/sanka/tomcat/jakarta-tomcat-4.1.30/webapps/axis2/WEB-INF",8080);
> -        simpleServer.start();
> -        System.out.println ("Sandesha2 Simple Axis Server Started....");
> -    }
> -}
> Index: test/org/apache/sandesha2/SandeshaTestCase.java
> ===================================================================
> --- test/org/apache/sandesha2/SandeshaTestCase.java (revision 307077)
> +++ test/org/apache/sandesha2/SandeshaTestCase.java (working copy)
> @@ -5,6 +5,15 @@
> import org.apache.axis2.context.ConfigurationContext;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMAbstractFactory;
> +import org.apache.axis2.om.OMXMLParserWrapper;
> +import org.apache.axis2.om.impl.llom.factory.OMXMLBuilderFactory;
> +
> +import javax.xml.stream.XMLStreamReader;
> +import javax.xml.stream.XMLInputFactory;
> +import javax.xml.stream.XMLStreamException;
> +import java.io.*;
> /*
>  * Copyright 2004,2005 The Apache Software Foundation.
>  *
> @@ -22,11 +31,50 @@
>  */
>
> public class SandeshaTestCase extends TestCase {
> +    String resourceDir = "test-resources";
>
>     public SandeshaTestCase(String name) {
>         super(name);
> +        File baseDir = new File("");
> +        String testRource = baseDir.getAbsolutePath() + File.separator + 
> "test-resources";
> +        resourceDir = new File(testRource).getPath();
> +
>     }
>
> +    protected InputStreamReader getResource(String relativePath, String 
> resourceName) {
> +        String resourceFile = resourceDir + relativePath + File.separator 
> + resourceName;
> +        String file = new 
> File("/home/sanka/sandesha2-src/trunk/test-resources/CreateSequence.xml").getPath();
> +
> +        try {
> +            FileReader reader = new FileReader(resourceFile);
> +            return reader;
> +        } catch (FileNotFoundException e) {
> +            throw new RuntimeException("cannot load the test-resource", 
> e);
> +        }
> +    }
> +
> +    protected SOAPEnvelope getSOAPEnvelope() {
> +        return OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
> +    }
> +
> +    protected SOAPEnvelope getSOAPEnvelope(String relativePath, String 
> resourceName) {
> +        try {
> +            XMLStreamReader reader = 
> XMLInputFactory.newInstance().createXMLStreamReader(
> +                    getResource(relativePath, resourceName));
> +            OMXMLParserWrapper wrapper = 
> OMXMLBuilderFactory.createStAXSOAPModelBuilder(
> +                    OMAbstractFactory.getSOAP11Factory(), reader);
> +            return (SOAPEnvelope) wrapper.getDocumentElement();
> +
> +        } catch (XMLStreamException e) {
> +            throw new RuntimeException(e);
> +        }
> +    }
> +
> +    protected SOAPEnvelope getEmptySOAPEnvelope() {
> +        return OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
> +    }
> +
> +
>     private MessageContext getMessageContext() throws Exception{
>         AxisConfiguration axisConfig = new AxisConfigurationImpl();
>         ConfigurationContext configCtx = new 
> ConfigurationContext(axisConfig);
> Index: test/org/apache/sandesha2/storage/RetransmitterBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/RetransmitterBeanMgrTest.java 
> (revision 307077)
> +++ test/org/apache/sandesha2/storage/RetransmitterBeanMgrTest.java 
> (working copy)
> @@ -1,7 +1,7 @@
> package org.apache.sandesha2.storage;
>
> +import org.apache.sandesha2.SandeshaException;
> import org.apache.sandesha2.SandeshaTestCase;
> -import org.apache.sandesha2.SandeshaException;
> import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
> import org.apache.sandesha2.storage.beans.RetransmitterBean;
> import org.apache.axis2.engine.AxisConfiguration;
> Index: test/org/apache/sandesha2/storage/NextMsgBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/NextMsgBeanMgrTest.java (revision 
> 307077)
> +++ test/org/apache/sandesha2/storage/NextMsgBeanMgrTest.java (working 
> copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
> import org.apache.sandesha2.storage.beans.NextMsgBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/storage/CreateSeqBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/CreateSeqBeanMgrTest.java (revision 
> 307077)
> +++ test/org/apache/sandesha2/storage/CreateSeqBeanMgrTest.java (working 
> copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
> import org.apache.sandesha2.storage.beans.CreateSeqBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/storage/SequencePropertyBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/SequencePropertyBeanMgrTest.java 
> (revision 307077)
> +++ test/org/apache/sandesha2/storage/SequencePropertyBeanMgrTest.java 
> (working copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
> import org.apache.sandesha2.storage.beans.SequencePropertyBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/storage/StorageMapBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/StorageMapBeanMgrTest.java (revision 
> 307077)
> +++ test/org/apache/sandesha2/storage/StorageMapBeanMgrTest.java (working 
> copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.StorageMapBeanMgr;
> import org.apache.sandesha2.storage.beans.StorageMapBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/wsrm/SequenceAcknowledgementTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/SequenceAcknowledgementTest.java 
> (revision 0)
> +++ test/org/apache/sandesha2/wsrm/SequenceAcknowledgementTest.java 
> (revision 0)
> @@ -0,0 +1,80 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +import java.util.Iterator;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 3:52:12 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class SequenceAcknowledgementTest extends SandeshaTestCase {
> +
> +    public SequenceAcknowledgementTest() {
> +        super("SequenceAcknowledgementTest");
> +    }
> +
> +    public void testFromOMElement() {
> +        SequenceAcknowledgement sequenceAck = new 
> SequenceAcknowledgement();
> +        SOAPEnvelope env = getSOAPEnvelope("", 
> "SequenceAcknowledgement.xml");
> +        sequenceAck.fromOMElement(env.getHeader());
> +
> +        Identifier identifier = sequenceAck.getIdentifier();
> +        assertEquals("uuid:897ee740-1624-11da-a28e-b3b9c4e71445", 
> identifier.getIdentifier());
> +
> +        Iterator iterator = 
> sequenceAck.getAcknowledgementRanges().iterator();
> +        while (iterator.hasNext()) {
> +            AcknowledgementRange ackRange = (AcknowledgementRange) 
> iterator.next();
> +            if (ackRange.getLowerValue() == 1){
> +                assertEquals(2, ackRange.getUpperValue());
> +
> +            } else if (ackRange.getLowerValue() == 4) {
> +                assertEquals(6, ackRange.getUpperValue());
> +
> +            } else if (ackRange.getLowerValue() == 8) {
> +                assertEquals(10, ackRange.getUpperValue());
> +            }
> +        }
> +
> +        iterator = sequenceAck.getNackList().iterator();
> +        while (iterator.hasNext()) {
> +            Nack nack = (Nack) iterator.next();
> +            if (nack.getNackNumber() == 3) {
> +
> +            } else if (nack.getNackNumber() == 7) {
> +
> +            } else {
> +                fail("invalid nack : " +  nack.getNackNumber());
> +            }
> +        }
> +
> +
> +    }
> +
> +    public void testToOMElement() {
> +        SequenceAcknowledgement seqAck = new SequenceAcknowledgement();
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:897ee740-1624-11da-a28e-b3b9c4e71445");
> +        seqAck.setIdentifier(identifier);
> +
> +        SOAPEnvelope env = getEmptySOAPEnvelope();
> +        seqAck.toSOAPEnvelope(env);
> +
> +        OMElement sequenceAckPart = 
> env.getHeader().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.SEQUENCE_ACK));
> +        OMElement identifierPart = sequenceAckPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:897ee740-1624-11da-a28e-b3b9c4e71445", 
> identifierPart.getText());
> +
> +
> +
> +
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/TerminateSequenceTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/TerminateSequenceTest.java (revision 0)
> +++ test/org/apache/sandesha2/wsrm/TerminateSequenceTest.java (revision 0)
> @@ -0,0 +1,47 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 3:36:59 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class TerminateSequenceTest extends SandeshaTestCase {
> +
> +    public TerminateSequenceTest() {
> +        super("TerminateSequenceTest");
> +    }
> +
> +    public void testFromOMElement() {
> +        TerminateSequence terminateSequence =  new TerminateSequence();
> +        SOAPEnvelope env = getSOAPEnvelope("", "TerminateSequence.xml");
> +        terminateSequence.fromOMElement(env.getBody());
> +
> +        Identifier identifier = terminateSequence.getIdentifier();
> +        assertEquals("uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06", 
> identifier.getIdentifier());
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        TerminateSequence terminateSequence = new TerminateSequence();
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06");
> +        terminateSequence.setIdentifier(identifier);
> +
> +        SOAPEnvelope env = getEmptySOAPEnvelope();
> +        terminateSequence.toSOAPEnvelope(env);
> +
> +        OMElement terminateSeqPart = env.getBody().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.TERMINATE_SEQUENCE));
> +        OMElement identifierPart = 
> terminateSeqPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06", 
> identifierPart.getText());
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/SequenceTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/SequenceTest.java (revision 0)
> +++ test/org/apache/sandesha2/wsrm/SequenceTest.java (revision 0)
> @@ -0,0 +1,60 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 4:31:54 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class SequenceTest extends SandeshaTestCase {
> +
> +    public SequenceTest() {
> +        super("SequenceTest");
> +
> +    }
> +
> +    public void testFromOMElement() {
> +        SOAPEnvelope env = getSOAPEnvelope("", "Sequence.xml");
> +        Sequence sequence = new Sequence();
> +        sequence.fromOMElement(env.getHeader());
> +
> +        Identifier identifier = sequence.getIdentifier();
> +        assertEquals("uuid:879da420-1624-11da-bed9-84d13db13902", 
> identifier.getIdentifier());
> +
> +        MessageNumber msgNo = sequence.getMessageNumber();
> +        assertEquals(1, msgNo.getMessageNumber());
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        Sequence sequence = new Sequence();
> +
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:879da420-1624-11da-bed9-84d13db13902");
> +        sequence.setIdentifier(identifier);
> +
> +        MessageNumber msgNo = new MessageNumber();
> +        msgNo.setMessageNumber(1);
> +        sequence.setMessageNumber(msgNo);
> +
> +        SOAPEnvelope envelope = getEmptySOAPEnvelope();
> +        sequence.toSOAPEnvelope(envelope);
> +
> +        OMElement sequencePart = 
> envelope.getHeader().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.SEQUENCE));
> +        OMElement identifierPart = sequencePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:879da420-1624-11da-bed9-84d13db13902", 
> identifierPart.getText());
> +
> +        OMElement msgNumberPart = sequencePart.getFirstChildWithName(
> + new QName (Constants.WSRM.NS_URI_RM,Constants.WSRM.MSG_NUMBER));
> +        assertEquals(1, Long.parseLong(msgNumberPart.getText()));
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/CreateSequenceResponseTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/CreateSequenceResponseTest.java 
> (revision 0)
> +++ test/org/apache/sandesha2/wsrm/CreateSequenceResponseTest.java 
> (revision 0)
> @@ -0,0 +1,72 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.addressing.EndpointReference;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 2:43:50 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class CreateSequenceResponseTest extends SandeshaTestCase {
> +
> +    public CreateSequenceResponseTest() {
> +        super("CreateSequenceResponseTest");
> +
> +    }
> +
> +    public void testFromOMElement() {
> +        CreateSequenceResponse res = new CreateSequenceResponse();
> +        SOAPEnvelope env = getSOAPEnvelope("", 
> "CreateSequenceResponse.xml");
> +        res.fromOMElement(env.getBody());
> +
> +        Identifier identifier = res.getIdentifier();
> +        assertEquals("uuid:88754b00-161a-11da-b6d6-8198de3c47c5", 
> identifier.getIdentifier());
> +
> +        Accept accept = res.getAccept();
> +        AcksTo  acksTo = accept.getAcksTo();
> +        Address address = acksTo.getAddress();
> +        assertEquals("http://localhost:8070/axis/services/TestService", 
> address.getEpr().getAddress());
> +
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        CreateSequenceResponse res = new CreateSequenceResponse();
> +
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:88754b00-161a-11da-b6d6-8198de3c47c5");
> +        res.setIdentifier(identifier);
> +
> +        Accept accept = new Accept();
> +        AcksTo acksTo = new AcksTo();
> +        Address address = new Address();
> +        address.setEpr(new 
> EndpointReference("http://localhost:8070/axis/services/TestService"));
> +        acksTo.setAddress(address);
> +        accept.setAcksTo(acksTo);
> +        res.setAccept(accept);
> +
> +        SOAPEnvelope env = getEmptySOAPEnvelope();
> +        res.toSOAPEnvelope(env);
> +
> +        OMElement createSeqResponsePart = 
> env.getBody().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.CREATE_SEQUENCE_RESPONSE));
> +        OMElement identifierPart = 
> createSeqResponsePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:88754b00-161a-11da-b6d6-8198de3c47c5", 
> identifierPart.getText());
> +
> +        OMElement acceptPart = 
> createSeqResponsePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.ACCEPT));
> +        OMElement acksToPart = acceptPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.ACKS_TO));
> +        OMElement addressPart = acksToPart.getFirstChildWithName(new 
> QName(
> + Constants.WSA.NS_URI_ADDRESSING, Constants.WSA.ADDRESS));
> +        assertEquals("http://localhost:8070/axis/services/TestService", 
> addressPart.getText());
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/CreateSequenceTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/CreateSequenceTest.java (revision 0)
> +++ test/org/apache/sandesha2/wsrm/CreateSequenceTest.java (revision 0)
> @@ -0,0 +1,71 @@
> +package org.apache.sandesha2.org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.sandesha2.wsrm.*;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.addressing.EndpointReference;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 6, 2005
> + * Time: 10:39:03 PM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class CreateSequenceTest extends SandeshaTestCase {
> +
> +    public CreateSequenceTest() {
> +        super("CreateSequenceTest");
> +    }
> +
> +    public void testfromOMElement() {
> +        CreateSequence createSequence = new CreateSequence();
> +        createSequence.fromOMElement(getSOAPEnvelope("", 
> "CreateSequence.xml").getBody());
> +
> +        AcksTo acksTo = createSequence.getAcksTo();
> +        Address address = acksTo.getAddress();
> +        assertEquals("http://127.0.0.1:9090/axis/services/RMService", 
> address.getEpr().getAddress());
> +
> +        SequenceOffer offer = createSequence.getSequenceOffer();
> +        Identifier identifier = offer.getIdentifer();
> +        assertEquals("uuid:c3671020-15e0-11da-9b3b-f0439d4867bd", 
> identifier.getIdentifier());
> +
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        CreateSequence createSequence = new CreateSequence();
> +
> +        AcksTo acksTo = new AcksTo();
> +        Address address = new Address();
> +        address.setEpr(new 
> EndpointReference("http://127.0.0.1:9090/axis/services/RMService"));
> +        acksTo.setAddress(address);
> +        createSequence.setAcksTo(acksTo);
> +
> +        SequenceOffer sequenceOffer = new SequenceOffer();
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:c3671020-15e0-11da-9b3b-f0439d4867bd");
> +        sequenceOffer.setIdentifier(identifier);
> +        createSequence.setSequenceOffer(sequenceOffer);
> +
> +        SOAPEnvelope envelope = getEmptySOAPEnvelope();
> +        createSequence.toSOAPEnvelope(envelope);
> +
> +        OMElement createSequencePart = 
> envelope.getBody().getFirstChildWithName(new 
> QName(Constants.WSRM.NS_URI_RM,
> +                        Constants.WSRM.CREATE_SEQUENCE));
> +        OMElement acksToPart = 
> createSequencePart.getFirstChildWithName(new QName(
> + Constants.WSRM.NS_URI_RM, Constants.WSRM.ACKS_TO));
> + OMElement addressPart = acksToPart.getFirstChildWithName(new QName(
> +                Constants.WSA.NS_URI_ADDRESSING, Constants.WSA.ADDRESS));
> +        assertEquals("http://127.0.0.1:9090/axis/services/RMService", 
> addressPart.getText());
> +
> +        OMElement offerPart = createSequencePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.SEQUENCE_OFFER));
> +        OMElement identifierPart = offerPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:c3671020-15e0-11da-9b3b-f0439d4867bd", 
> identifierPart.getText());
> +    }
> +}
>
>


--------------------------------------------------------------------------------


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org 



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Re: [Sandesha2][Patch] Few more testcases

Posted by Jaliya Ekanayake <ja...@opensource.lk>.
Applied. Thanks.

Jaliya
----- Original Message ----- 
From: "Sanka Samaranayake" <ss...@gmail.com>
To: <sa...@ws.apache.org>
Sent: Friday, October 07, 2005 11:40 AM
Subject: [Sandesha2][Patch] Few more testcases


> Dear Sandesha2 Committers,
>
> Please accept this pactch which contains some testcases for *.wsrm.*
> package ...
>
> --Sanka
>


--------------------------------------------------------------------------------


> Index: test-resources/SequenceAcknowledgement.xml
> ===================================================================
> --- test-resources/SequenceAcknowledgement.xml (revision 0)
> +++ test-resources/SequenceAcknowledgement.xml (revision 0)
> @@ -0,0 +1,20 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:8d8f8d80-1624-11da-a28e-b3b9c4e71445</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +         <wsrm:SequenceAcknowledgement soapenv:mustUnderstand="1">
> +            <wsrm:AcknowledgementRange Upper="2" Lower="1"/>
> + <wsrm:AcknowledgementRange Upper="6" Lower="4"/>
> + <wsrm:AcknowledgementRange Upper="10" Lower="8"/>
> +            <wsrm:Nack>3</wsrm:Nack>
> +            <wsrm:Nack>7</wsrm:Nack>
> + 
> <wsrm:Identifier>uuid:897ee740-1624-11da-a28e-b3b9c4e71445</wsrm:Identifier>
> +         </wsrm:SequenceAcknowledgement>
> +      </soapenv:Header>
> +      <soapenv:Body/>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/SequenceAcknowledgement.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/TerminateSequence.xml
> ===================================================================
> --- test-resources/TerminateSequence.xml (revision 0)
> +++ test-resources/TerminateSequence.xml (revision 0)
> @@ -0,0 +1,16 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:64f5c3c0-1625-11da-a28e-b3b9c4e71445</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <wsrm:TerminateSequence>
> + 
> <wsrm:Identifier>uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06</wsrm:Identifier>
> +         </wsrm:TerminateSequence>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/TerminateSequence.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/Sequence.xml
> ===================================================================
> --- test-resources/Sequence.xml (revision 0)
> +++ test-resources/Sequence.xml (revision 0)
> @@ -0,0 +1,21 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:8c00b020-1624-11da-a28e-b3b9c4e71445</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">urn:wsrm:echoStringResponse</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +         <wsa:RelatesTo RelationshipType="wsa:Reply" 
> soapenv:mustUnderstand="1">uuid:87a0b160-1624-11da-bed9-84d13db13902</wsa:RelatesTo>
> +         <wsrm:Sequence soapenv:mustUnderstand="1">
> + 
> <wsrm:Identifier>uuid:879da420-1624-11da-bed9-84d13db13902</wsrm:Identifier>
> +            <wsrm:MessageNumber>1</wsrm:MessageNumber>
> +         </wsrm:Sequence>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <ns1:echoStringResponse 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
> xmlns:ns1="http://tempuri.org/">
> +            <echoStringReturn xsi:type="soapenc:string" 
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Sandesha Echo 
> 1</echoStringReturn>
> +         </ns1:echoStringResponse>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/Sequence.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/CreateSequenceResponse.xml
> ===================================================================
> --- test-resources/CreateSequenceResponse.xml (revision 0)
> +++ test-resources/CreateSequenceResponse.xml (revision 0)
> @@ -0,0 +1,22 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="1">uuid:88754b00-161a-11da-b6d6-8198de3c47c5</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="1">http://127.0.0.1:9070/axis/services/RMService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="1">
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +         </wsa:From>
> +         <wsa:RelatesTo 
> RelationshipType="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
> soapenv:mustUnderstand="1" 
> xmlns:http="wsa">uuid:872e4c10-161a-11da-9ef7-bd9ad94438a3</wsa:RelatesTo>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <wsrm:CreateSequenceResponse>
> + 
> <wsrm:Identifier>uuid:88754b00-161a-11da-b6d6-8198de3c47c5</wsrm:Identifier>
> +            <wsrm:Accept>
> +               <wsrm:AcksTo>
> + 
> <wsa:Address>http://localhost:8070/axis/services/TestService</wsa:Address>
> +               </wsrm:AcksTo>
> +            </wsrm:Accept>
> +         </wsrm:CreateSequenceResponse>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/CreateSequenceResponse.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
> Index: test-resources/CreateSequence.xml
> ===================================================================
> --- test-resources/CreateSequence.xml (revision 0)
> +++ test-resources/CreateSequence.xml (revision 0)
> @@ -0,0 +1,24 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> +      <soapenv:Header>
> +         <wsa:MessageID 
> soapenv:mustUnderstand="0">uuid:c3671020-15e0-11da-9b3a-f0439d4867bd</wsa:MessageID>
> +         <wsa:To 
> soapenv:mustUnderstand="0">http://localhost:8070/axis/services/TestService</wsa:To>
> +         <wsa:Action 
> soapenv:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</wsa:Action>
> +         <wsa:From soapenv:mustUnderstand="0">
> + 
> <wsa:Address>http://192.168.1.4:9090/axis/services/RMService</wsa:Address>
> +         </wsa:From>
> +         <wsa:ReplyTo soapenv:mustUnderstand="0">
> + 
> <wsa:Address>http://127.0.0.1:9090/axis/services/RMService</wsa:Address>
> +         </wsa:ReplyTo>
> +      </soapenv:Header>
> +      <soapenv:Body>
> +         <wsrm:CreateSequence>
> +            <wsrm:AcksTo>
> + 
> <wsa:Address>http://127.0.0.1:9090/axis/services/RMService</wsa:Address>
> +            </wsrm:AcksTo>
> +            <wsrm:Offer>
> + 
> <wsrm:Identifier>uuid:c3671020-15e0-11da-9b3b-f0439d4867bd</wsrm:Identifier>
> +            </wsrm:Offer>
> +         </wsrm:CreateSequence>
> +      </soapenv:Body>
> +   </soapenv:Envelope>
> \ No newline at end of file
>
> Property changes on: test-resources/CreateSequence.xml
> ___________________________________________________________________
> Name: svn:executable
>   + *
>
>


--------------------------------------------------------------------------------


> Index: test/org/apache/sandesha2/SimpleServerImpl.java
> ===================================================================
> --- test/org/apache/sandesha2/SimpleServerImpl.java (revision 307077)
> +++ test/org/apache/sandesha2/SimpleServerImpl.java (working copy)
> @@ -1,24 +0,0 @@
> -/*
> - * Created on Aug 26, 2005
> - *
> - * TODO To change the template for this generated file go to
> - * Window - Preferences - Java - Code Style - Code Templates
> - */
> -package org.apache.sandesha2;
> -
> -import java.io.IOException;
> -
> -import org.apache.axis2.transport.http.SimpleHTTPServer;
> -
> -/**
> - * @author
> - *
> - */
> -public class SimpleServerImpl {
> -
> -    public static void main(String[] args) throws IOException {
> -        SimpleHTTPServer simpleServer = new 
> SimpleHTTPServer("/home/sanka/tomcat/jakarta-tomcat-4.1.30/webapps/axis2/WEB-INF",8080);
> -        simpleServer.start();
> -        System.out.println ("Sandesha2 Simple Axis Server Started....");
> -    }
> -}
> Index: test/org/apache/sandesha2/SandeshaTestCase.java
> ===================================================================
> --- test/org/apache/sandesha2/SandeshaTestCase.java (revision 307077)
> +++ test/org/apache/sandesha2/SandeshaTestCase.java (working copy)
> @@ -5,6 +5,15 @@
> import org.apache.axis2.context.ConfigurationContext;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMAbstractFactory;
> +import org.apache.axis2.om.OMXMLParserWrapper;
> +import org.apache.axis2.om.impl.llom.factory.OMXMLBuilderFactory;
> +
> +import javax.xml.stream.XMLStreamReader;
> +import javax.xml.stream.XMLInputFactory;
> +import javax.xml.stream.XMLStreamException;
> +import java.io.*;
> /*
>  * Copyright 2004,2005 The Apache Software Foundation.
>  *
> @@ -22,11 +31,50 @@
>  */
>
> public class SandeshaTestCase extends TestCase {
> +    String resourceDir = "test-resources";
>
>     public SandeshaTestCase(String name) {
>         super(name);
> +        File baseDir = new File("");
> +        String testRource = baseDir.getAbsolutePath() + File.separator + 
> "test-resources";
> +        resourceDir = new File(testRource).getPath();
> +
>     }
>
> +    protected InputStreamReader getResource(String relativePath, String 
> resourceName) {
> +        String resourceFile = resourceDir + relativePath + File.separator 
> + resourceName;
> +        String file = new 
> File("/home/sanka/sandesha2-src/trunk/test-resources/CreateSequence.xml").getPath();
> +
> +        try {
> +            FileReader reader = new FileReader(resourceFile);
> +            return reader;
> +        } catch (FileNotFoundException e) {
> +            throw new RuntimeException("cannot load the test-resource", 
> e);
> +        }
> +    }
> +
> +    protected SOAPEnvelope getSOAPEnvelope() {
> +        return OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
> +    }
> +
> +    protected SOAPEnvelope getSOAPEnvelope(String relativePath, String 
> resourceName) {
> +        try {
> +            XMLStreamReader reader = 
> XMLInputFactory.newInstance().createXMLStreamReader(
> +                    getResource(relativePath, resourceName));
> +            OMXMLParserWrapper wrapper = 
> OMXMLBuilderFactory.createStAXSOAPModelBuilder(
> +                    OMAbstractFactory.getSOAP11Factory(), reader);
> +            return (SOAPEnvelope) wrapper.getDocumentElement();
> +
> +        } catch (XMLStreamException e) {
> +            throw new RuntimeException(e);
> +        }
> +    }
> +
> +    protected SOAPEnvelope getEmptySOAPEnvelope() {
> +        return OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
> +    }
> +
> +
>     private MessageContext getMessageContext() throws Exception{
>         AxisConfiguration axisConfig = new AxisConfigurationImpl();
>         ConfigurationContext configCtx = new 
> ConfigurationContext(axisConfig);
> Index: test/org/apache/sandesha2/storage/RetransmitterBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/RetransmitterBeanMgrTest.java 
> (revision 307077)
> +++ test/org/apache/sandesha2/storage/RetransmitterBeanMgrTest.java 
> (working copy)
> @@ -1,7 +1,7 @@
> package org.apache.sandesha2.storage;
>
> +import org.apache.sandesha2.SandeshaException;
> import org.apache.sandesha2.SandeshaTestCase;
> -import org.apache.sandesha2.SandeshaException;
> import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
> import org.apache.sandesha2.storage.beans.RetransmitterBean;
> import org.apache.axis2.engine.AxisConfiguration;
> Index: test/org/apache/sandesha2/storage/NextMsgBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/NextMsgBeanMgrTest.java (revision 
> 307077)
> +++ test/org/apache/sandesha2/storage/NextMsgBeanMgrTest.java (working 
> copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
> import org.apache.sandesha2.storage.beans.NextMsgBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/storage/CreateSeqBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/CreateSeqBeanMgrTest.java (revision 
> 307077)
> +++ test/org/apache/sandesha2/storage/CreateSeqBeanMgrTest.java (working 
> copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
> import org.apache.sandesha2.storage.beans.CreateSeqBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/storage/SequencePropertyBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/SequencePropertyBeanMgrTest.java 
> (revision 307077)
> +++ test/org/apache/sandesha2/storage/SequencePropertyBeanMgrTest.java 
> (working copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
> import org.apache.sandesha2.storage.beans.SequencePropertyBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/storage/StorageMapBeanMgrTest.java
> ===================================================================
> --- test/org/apache/sandesha2/storage/StorageMapBeanMgrTest.java (revision 
> 307077)
> +++ test/org/apache/sandesha2/storage/StorageMapBeanMgrTest.java (working 
> copy)
> @@ -1,8 +1,8 @@
> package org.apache.sandesha2.storage;
>
> -import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.sandesha2.storage.beanmanagers.StorageMapBeanMgr;
> import org.apache.sandesha2.storage.beans.StorageMapBean;
> +import org.apache.sandesha2.SandeshaTestCase;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisConfigurationImpl;
> import org.apache.axis2.context.ConfigurationContext;
> Index: test/org/apache/sandesha2/wsrm/SequenceAcknowledgementTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/SequenceAcknowledgementTest.java 
> (revision 0)
> +++ test/org/apache/sandesha2/wsrm/SequenceAcknowledgementTest.java 
> (revision 0)
> @@ -0,0 +1,80 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +import java.util.Iterator;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 3:52:12 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class SequenceAcknowledgementTest extends SandeshaTestCase {
> +
> +    public SequenceAcknowledgementTest() {
> +        super("SequenceAcknowledgementTest");
> +    }
> +
> +    public void testFromOMElement() {
> +        SequenceAcknowledgement sequenceAck = new 
> SequenceAcknowledgement();
> +        SOAPEnvelope env = getSOAPEnvelope("", 
> "SequenceAcknowledgement.xml");
> +        sequenceAck.fromOMElement(env.getHeader());
> +
> +        Identifier identifier = sequenceAck.getIdentifier();
> +        assertEquals("uuid:897ee740-1624-11da-a28e-b3b9c4e71445", 
> identifier.getIdentifier());
> +
> +        Iterator iterator = 
> sequenceAck.getAcknowledgementRanges().iterator();
> +        while (iterator.hasNext()) {
> +            AcknowledgementRange ackRange = (AcknowledgementRange) 
> iterator.next();
> +            if (ackRange.getLowerValue() == 1){
> +                assertEquals(2, ackRange.getUpperValue());
> +
> +            } else if (ackRange.getLowerValue() == 4) {
> +                assertEquals(6, ackRange.getUpperValue());
> +
> +            } else if (ackRange.getLowerValue() == 8) {
> +                assertEquals(10, ackRange.getUpperValue());
> +            }
> +        }
> +
> +        iterator = sequenceAck.getNackList().iterator();
> +        while (iterator.hasNext()) {
> +            Nack nack = (Nack) iterator.next();
> +            if (nack.getNackNumber() == 3) {
> +
> +            } else if (nack.getNackNumber() == 7) {
> +
> +            } else {
> +                fail("invalid nack : " +  nack.getNackNumber());
> +            }
> +        }
> +
> +
> +    }
> +
> +    public void testToOMElement() {
> +        SequenceAcknowledgement seqAck = new SequenceAcknowledgement();
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:897ee740-1624-11da-a28e-b3b9c4e71445");
> +        seqAck.setIdentifier(identifier);
> +
> +        SOAPEnvelope env = getEmptySOAPEnvelope();
> +        seqAck.toSOAPEnvelope(env);
> +
> +        OMElement sequenceAckPart = 
> env.getHeader().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.SEQUENCE_ACK));
> +        OMElement identifierPart = sequenceAckPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:897ee740-1624-11da-a28e-b3b9c4e71445", 
> identifierPart.getText());
> +
> +
> +
> +
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/TerminateSequenceTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/TerminateSequenceTest.java (revision 0)
> +++ test/org/apache/sandesha2/wsrm/TerminateSequenceTest.java (revision 0)
> @@ -0,0 +1,47 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 3:36:59 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class TerminateSequenceTest extends SandeshaTestCase {
> +
> +    public TerminateSequenceTest() {
> +        super("TerminateSequenceTest");
> +    }
> +
> +    public void testFromOMElement() {
> +        TerminateSequence terminateSequence =  new TerminateSequence();
> +        SOAPEnvelope env = getSOAPEnvelope("", "TerminateSequence.xml");
> +        terminateSequence.fromOMElement(env.getBody());
> +
> +        Identifier identifier = terminateSequence.getIdentifier();
> +        assertEquals("uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06", 
> identifier.getIdentifier());
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        TerminateSequence terminateSequence = new TerminateSequence();
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06");
> +        terminateSequence.setIdentifier(identifier);
> +
> +        SOAPEnvelope env = getEmptySOAPEnvelope();
> +        terminateSequence.toSOAPEnvelope(env);
> +
> +        OMElement terminateSeqPart = env.getBody().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.TERMINATE_SEQUENCE));
> +        OMElement identifierPart = 
> terminateSeqPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:59b0c910-1625-11da-bdfc-b09ed76a1f06", 
> identifierPart.getText());
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/SequenceTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/SequenceTest.java (revision 0)
> +++ test/org/apache/sandesha2/wsrm/SequenceTest.java (revision 0)
> @@ -0,0 +1,60 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 4:31:54 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class SequenceTest extends SandeshaTestCase {
> +
> +    public SequenceTest() {
> +        super("SequenceTest");
> +
> +    }
> +
> +    public void testFromOMElement() {
> +        SOAPEnvelope env = getSOAPEnvelope("", "Sequence.xml");
> +        Sequence sequence = new Sequence();
> +        sequence.fromOMElement(env.getHeader());
> +
> +        Identifier identifier = sequence.getIdentifier();
> +        assertEquals("uuid:879da420-1624-11da-bed9-84d13db13902", 
> identifier.getIdentifier());
> +
> +        MessageNumber msgNo = sequence.getMessageNumber();
> +        assertEquals(1, msgNo.getMessageNumber());
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        Sequence sequence = new Sequence();
> +
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:879da420-1624-11da-bed9-84d13db13902");
> +        sequence.setIdentifier(identifier);
> +
> +        MessageNumber msgNo = new MessageNumber();
> +        msgNo.setMessageNumber(1);
> +        sequence.setMessageNumber(msgNo);
> +
> +        SOAPEnvelope envelope = getEmptySOAPEnvelope();
> +        sequence.toSOAPEnvelope(envelope);
> +
> +        OMElement sequencePart = 
> envelope.getHeader().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.SEQUENCE));
> +        OMElement identifierPart = sequencePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:879da420-1624-11da-bed9-84d13db13902", 
> identifierPart.getText());
> +
> +        OMElement msgNumberPart = sequencePart.getFirstChildWithName(
> + new QName (Constants.WSRM.NS_URI_RM,Constants.WSRM.MSG_NUMBER));
> +        assertEquals(1, Long.parseLong(msgNumberPart.getText()));
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/CreateSequenceResponseTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/CreateSequenceResponseTest.java 
> (revision 0)
> +++ test/org/apache/sandesha2/wsrm/CreateSequenceResponseTest.java 
> (revision 0)
> @@ -0,0 +1,72 @@
> +package org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.addressing.EndpointReference;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 7, 2005
> + * Time: 2:43:50 AM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class CreateSequenceResponseTest extends SandeshaTestCase {
> +
> +    public CreateSequenceResponseTest() {
> +        super("CreateSequenceResponseTest");
> +
> +    }
> +
> +    public void testFromOMElement() {
> +        CreateSequenceResponse res = new CreateSequenceResponse();
> +        SOAPEnvelope env = getSOAPEnvelope("", 
> "CreateSequenceResponse.xml");
> +        res.fromOMElement(env.getBody());
> +
> +        Identifier identifier = res.getIdentifier();
> +        assertEquals("uuid:88754b00-161a-11da-b6d6-8198de3c47c5", 
> identifier.getIdentifier());
> +
> +        Accept accept = res.getAccept();
> +        AcksTo  acksTo = accept.getAcksTo();
> +        Address address = acksTo.getAddress();
> +        assertEquals("http://localhost:8070/axis/services/TestService", 
> address.getEpr().getAddress());
> +
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        CreateSequenceResponse res = new CreateSequenceResponse();
> +
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:88754b00-161a-11da-b6d6-8198de3c47c5");
> +        res.setIdentifier(identifier);
> +
> +        Accept accept = new Accept();
> +        AcksTo acksTo = new AcksTo();
> +        Address address = new Address();
> +        address.setEpr(new 
> EndpointReference("http://localhost:8070/axis/services/TestService"));
> +        acksTo.setAddress(address);
> +        accept.setAcksTo(acksTo);
> +        res.setAccept(accept);
> +
> +        SOAPEnvelope env = getEmptySOAPEnvelope();
> +        res.toSOAPEnvelope(env);
> +
> +        OMElement createSeqResponsePart = 
> env.getBody().getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.CREATE_SEQUENCE_RESPONSE));
> +        OMElement identifierPart = 
> createSeqResponsePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:88754b00-161a-11da-b6d6-8198de3c47c5", 
> identifierPart.getText());
> +
> +        OMElement acceptPart = 
> createSeqResponsePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.ACCEPT));
> +        OMElement acksToPart = acceptPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.ACKS_TO));
> +        OMElement addressPart = acksToPart.getFirstChildWithName(new 
> QName(
> + Constants.WSA.NS_URI_ADDRESSING, Constants.WSA.ADDRESS));
> +        assertEquals("http://localhost:8070/axis/services/TestService", 
> addressPart.getText());
> +    }
> +}
> Index: test/org/apache/sandesha2/wsrm/CreateSequenceTest.java
> ===================================================================
> --- test/org/apache/sandesha2/wsrm/CreateSequenceTest.java (revision 0)
> +++ test/org/apache/sandesha2/wsrm/CreateSequenceTest.java (revision 0)
> @@ -0,0 +1,71 @@
> +package org.apache.sandesha2.org.apache.sandesha2.wsrm;
> +
> +import org.apache.sandesha2.SandeshaTestCase;
> +import org.apache.sandesha2.Constants;
> +import org.apache.sandesha2.wsrm.*;
> +import org.apache.axis2.soap.SOAPEnvelope;
> +import org.apache.axis2.addressing.EndpointReference;
> +import org.apache.axis2.om.OMElement;
> +
> +import javax.xml.namespace.QName;
> +
> +/**
> + * Created by IntelliJ IDEA.
> + * User: sanka
> + * Date: Oct 6, 2005
> + * Time: 10:39:03 PM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class CreateSequenceTest extends SandeshaTestCase {
> +
> +    public CreateSequenceTest() {
> +        super("CreateSequenceTest");
> +    }
> +
> +    public void testfromOMElement() {
> +        CreateSequence createSequence = new CreateSequence();
> +        createSequence.fromOMElement(getSOAPEnvelope("", 
> "CreateSequence.xml").getBody());
> +
> +        AcksTo acksTo = createSequence.getAcksTo();
> +        Address address = acksTo.getAddress();
> +        assertEquals("http://127.0.0.1:9090/axis/services/RMService", 
> address.getEpr().getAddress());
> +
> +        SequenceOffer offer = createSequence.getSequenceOffer();
> +        Identifier identifier = offer.getIdentifer();
> +        assertEquals("uuid:c3671020-15e0-11da-9b3b-f0439d4867bd", 
> identifier.getIdentifier());
> +
> +    }
> +
> +    public void testToSOAPEnvelope() {
> +        CreateSequence createSequence = new CreateSequence();
> +
> +        AcksTo acksTo = new AcksTo();
> +        Address address = new Address();
> +        address.setEpr(new 
> EndpointReference("http://127.0.0.1:9090/axis/services/RMService"));
> +        acksTo.setAddress(address);
> +        createSequence.setAcksTo(acksTo);
> +
> +        SequenceOffer sequenceOffer = new SequenceOffer();
> +        Identifier identifier = new Identifier();
> + 
> identifier.setIndentifer("uuid:c3671020-15e0-11da-9b3b-f0439d4867bd");
> +        sequenceOffer.setIdentifier(identifier);
> +        createSequence.setSequenceOffer(sequenceOffer);
> +
> +        SOAPEnvelope envelope = getEmptySOAPEnvelope();
> +        createSequence.toSOAPEnvelope(envelope);
> +
> +        OMElement createSequencePart = 
> envelope.getBody().getFirstChildWithName(new 
> QName(Constants.WSRM.NS_URI_RM,
> +                        Constants.WSRM.CREATE_SEQUENCE));
> +        OMElement acksToPart = 
> createSequencePart.getFirstChildWithName(new QName(
> + Constants.WSRM.NS_URI_RM, Constants.WSRM.ACKS_TO));
> + OMElement addressPart = acksToPart.getFirstChildWithName(new QName(
> +                Constants.WSA.NS_URI_ADDRESSING, Constants.WSA.ADDRESS));
> +        assertEquals("http://127.0.0.1:9090/axis/services/RMService", 
> addressPart.getText());
> +
> +        OMElement offerPart = createSequencePart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.SEQUENCE_OFFER));
> +        OMElement identifierPart = offerPart.getFirstChildWithName(
> +                new QName(Constants.WSRM.NS_URI_RM, 
> Constants.WSRM.IDENTIFIER));
> +        assertEquals("uuid:c3671020-15e0-11da-9b3b-f0439d4867bd", 
> identifierPart.getText());
> +    }
> +}
>
>


--------------------------------------------------------------------------------


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org 



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org