[xgws-dev] CVS Update: codes/xsul/java/tests/xsul/msg_box

Aleksander Andrzej Slominski xgws-dev_at_extreme.indiana.edu
Mon May 1 18:09:01 2006


aslom       06/05/01 18:08:34

  Modified:    xsul/java/modules/msg_box/xsul/msg_box MsgBoxClient.java
               xsul/java/tests/xsul/msg_box TestMsgBox.java
  Log:
  modified unit test to chack MsgBox with WSA 1.0 and 2004/08
  
  Revision  Changes    Path
  1.11      +6 -1      codes/xsul/java/modules/msg_box/xsul/msg_box/MsgBoxClient.java
  
  Index: MsgBoxClient.java
  ===================================================================
  RCS file: /l/extreme/cvs/codes/xsul/java/modules/msg_box/xsul/msg_box/MsgBoxClient.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -t -w -r1.10 -r1.11
  --- MsgBoxClient.java	21 Apr 2006 20:05:32 -0000	1.10
  +++ MsgBoxClient.java	1 May 2006 22:08:33 -0000	1.11
  @@ -4,7 +4,7 @@
    *
    * This software is open source. See the bottom of this file for the licence.
    *
  - * $Id: MsgBoxClient.java,v 1.10 2006/04/21 20:05:32 aslom Exp $
  + * $Id: MsgBoxClient.java,v 1.11 2006/05/01 22:08:33 aslom Exp $
    */
   package xsul.msg_box;
   
  @@ -15,6 +15,7 @@
   import java.util.List;
   import org.xmlpull.v1.builder.XmlElement;
   import org.xmlpull.v1.builder.XmlInfosetBuilder;
  +import org.xmlpull.v1.builder.XmlNamespace;
   import xsul.MLogger;
   import xsul.XmlConstants;
   import xsul.XsulException;
  @@ -46,6 +47,10 @@
           this(new WsaEndpointReference(location));
       }
       
  +    public MsgBoxClient(XmlNamespace wsaNs, URI location) {
  +        this(new WsaEndpointReference(wsaNs, location));
  +    }
  +    
       public WsaEndpointReference createMsgBox() throws XsulException {
           invoker.setDefaultAction(MsgBoxConstants.ACTION_CREATE_BOX);
           XmlElement message = builder.newFragment(MsgBoxConstants.MSG_BOX_NS,
  
  
  
  1.13      +8 -4      codes/xsul/java/tests/xsul/msg_box/TestMsgBox.java
  
  Index: TestMsgBox.java
  ===================================================================
  RCS file: /l/extreme/cvs/codes/xsul/java/tests/xsul/msg_box/TestMsgBox.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -t -w -r1.12 -r1.13
  --- TestMsgBox.java	1 May 2006 21:57:48 -0000	1.12
  +++ TestMsgBox.java	1 May 2006 22:08:33 -0000	1.13
  @@ -4,7 +4,7 @@
    *
    * This software is open source. See the bottom of this file for the licence.
    *
  - * $Id: TestMsgBox.java,v 1.12 2006/05/01 21:57:48 aslom Exp $
  + * $Id: TestMsgBox.java,v 1.13 2006/05/01 22:08:33 aslom Exp $
    */
   
   package xsul.msg_box;
  @@ -31,7 +31,7 @@
   /**
    * Tests simple interaction with WS-MsgBox.
    *
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    * @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
    */
   public class TestMsgBox extends XsulTestCase {
  @@ -59,14 +59,14 @@
       
       public void testClientUsingMB() throws Exception
       {
  -        //testClientUsingMB(WsAddressing.NS_WSA);
  +        testClientUsingMB(WsAddressing.NS_WSA);
           testClientUsingMB(WsAddressing.NS_2004_08);
       }
       
       private void testClientUsingMB(XmlNamespace wsaNs) throws Exception
       {
           // create mailbox
  -        MsgBoxClient msgBoxService = new MsgBoxClient(messageBoxLocation);
  +        MsgBoxClient msgBoxService = new MsgBoxClient(wsaNs, messageBoxLocation);
           
           WsaEndpointReference msgBoxAddr = msgBoxService.createMsgBox();
           //System.out.println(getClass()+" msgBoxId="+msgBoxAddr);
  @@ -79,6 +79,9 @@
                   MESSAGE_URI, "addOne");
               message.addChild("777");
               
  +            //avoid possible reordering due toasync nature of calls
  +            Thread.currentThread().sleep(100L);
  +            
               WsaEndpointReference serviceEpr = new WsaEndpointReference(new URI(webServiceLocation));
               WsaInvoker invoker = new WsaInvoker();
               invoker.setTargetEPR(serviceEpr);
  @@ -157,3 +160,4 @@
   
   
   
  +