axis-java-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/test/util WSIFTestRunner.java
Date Thu, 20 Jun 2002 11:14:06 GMT
antelder    2002/06/20 04:14:06

  Modified:    java/test/inout InoutTest.java
               java/test/jms NativeJMSTest.java
               java/test/inout/wsiftypes Mutablestring.java
               java/samples/addressbook/wsifservice AddressBook.wsdl
               java/test/inout/wsifservice Inout.wsdl
               java/test/org/apache/wsif/util/jms
                        NativeJMSRequestListener.java
               java/test/addressbook AddressBookTest.java
               java/test/async AsyncTest.java
               java/test/util WSIFTestRunner.java
  Log:
  Improve native JMS testcases
  
  Revision  Changes    Path
  1.4       +41 -16    xml-axis-wsif/java/test/inout/InoutTest.java
  
  Index: InoutTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/inout/InoutTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- InoutTest.java	12 Jun 2002 10:27:25 -0000	1.3
  +++ InoutTest.java	20 Jun 2002 11:14:05 -0000	1.4
  @@ -125,6 +125,7 @@
       private final static String SOAP = "soap";
       private final static String AXIS = "axis";
       private final static String JAVA = "java";
  +    private final static String NJMS = "nativeJMS";                                  
   
       public InoutTest(String name) {
           super(name);
  @@ -157,10 +158,14 @@
       public void testAxisJms() {
           doit("SOAPJMSPort", AXIS, RPC, ADDRESS);
       }
  +    public void testNativeJms() { 
  +    	doit("NativeJMSPort" ,NJMS, RPC, ADDRESS);
  +    } 
       //public void testAxisDoc       () { doit("SOAPDocPort"   ,AXIS,DOC, ADDRESS ); } FAILS
       //public void testSoapDoc       () { doit("SOAPDocPort"   ,SOAP,DOC, ADDRESS ); } FAILS
       //public void testSoapJmsDoc    () { doit("SOAPJMSDocPort",SOAP,DOC, ADDRESS ); } FAILS
       //public void testAxisJmsDoc    () { doit("SOAPJMSDocPort",AXIS,DOC, ADDRESS ); } FAILS
  +    //public void testNativeJmsDoc  () { doit("NativeJMSPort" ,NJMS,DOC, ADDRESS ); } FAILS
   
       //public void testNNAxis        () { doit("SOAPPort"      ,AXIS,RPC, NULLNAME); } FAILS
       //public void testNNSoap        () { doit("SOAPPort"      ,SOAP,RPC, NULLNAME); } FAILS
  @@ -169,6 +174,7 @@
       }
       //public void testNNSoapJms     () { doit("SOAPJMSPort"   ,SOAP,RPC, NULLNAME); } FAILS
       //public void testNNAxisJms     () { doit("SOAPJMSPort"   ,AXIS,RPC, NULLNAME); } FAILS
  +    //public void testNNNativeJms   () { doit("NativeJMSPort" ,NJMS,RPC, NULLNAME); } 
   
       //public void testAddAxis       () { doit("SOAPPort"      ,AXIS,RPC, ADD     ); } FAILS
       public void testAddSoap() {
  @@ -181,6 +187,9 @@
           doit("SOAPJMSPort", SOAP, RPC, ADD);
       }
       //public void testAddAxisJms    () { doit("SOAPJMSPort"   ,AXIS,RPC, ADD     ); } FAILS
  +    public void testAddNativeJms() { 
  +    	doit("NativeJMSPort" , NJMS, RPC, ADD ); 
  +    } 
   
       //public void testDateAxis      () { doit("SOAPPort"      ,AXIS,RPC, DATE    ); } FAILS
       public void testDateSoap() {
  @@ -193,6 +202,9 @@
           doit("SOAPJMSPort", SOAP, RPC, DATE);
       }
       //public void testDateAxisJms   () { doit("SOAPJMSPort"   ,AXIS,RPC, DATE    ); } FAILS
  +    public void testDateNativeJms() { 
  +    	doit("NativeJMSPort" , NJMS, RPC, DATE ); 
  +    } 
   
       public void testSupCAxis() {
           doit("SOAPPort", AXIS, RPC, SUPC);
  @@ -209,6 +221,9 @@
       public void testSupCAxisJms() {
           doit("SOAPJMSPort", AXIS, RPC, SUPC);
       }
  +    public void testSupCNativeJms() {
  +    	doit("NativeJMSPort" , NJMS, RPC, SUPC );
  +    } 
       public void testGenCAxis() {
           doit("SOAPPort", AXIS, RPC, GENC);
       }
  @@ -224,7 +239,9 @@
       public void testGenCAxisJms() {
           doit("SOAPJMSPort", AXIS, RPC, GENC);
       }
  -
  +    public void testGenCNativeJms() {
  +    	doit("NativeJMSPort" , NJMS, RPC, GENC );
  +     } 
   
       //public void testWhoAxis       () { doit("SOAPPort"      ,AXIS,RPC, WHOAMI  ); } FAILS
       public void testWhoSoap() {
  @@ -237,6 +254,9 @@
           doit("SOAPJMSPort", SOAP, RPC, WHOAMI);
       }
       //public void testWhoAxisJms    () { doit("SOAPJMSPort"   ,AXIS,RPC, WHOAMI  ); } FAILS
  +    public void testWhoNativeJms() {
  +    	doit("NativeJMSPort" , NJMS, RPC, WHOAMI );
  +     } 
   
       // The inout test will never work for any form of soap since soap does not
       // support inout or multiple output parameters.
  @@ -381,21 +401,6 @@
           public void dubiousMethod() throws WSIFException;
       }
   
  -    private class SubAddress extends Address {
  -        public SubAddress() {
  -            super();
  -        }
  -        public SubAddress(Address a) {
  -            super(
  -                a.getStreetNum(),
  -                a.getStreetName(),
  -                a.getCity(),
  -                a.getState(),
  -                a.getZip(),
  -                a.getPhoneNumber());
  -        }
  -    }
  -
       private void supc(WSIFService service, String portName) throws Exception {
           SubInout stub = (SubInout) service.getStub(portName, SubInout.class);
   
  @@ -476,4 +481,24 @@
           boolean success = stub.getAddressFromName(msName1, resp1);
           assertTrue(success && new AddressUtility(resp1).equals(addr1));
       }
  +
   }
  +
  +class SubAddress extends Address {
  +
  +   public SubAddress() {
  +      super();
  +   }
  +
  +   public SubAddress(Address a) {
  +      super(
  +         a.getStreetNum(),
  +         a.getStreetName(),
  +         a.getCity(),
  +         a.getState(),
  +         a.getZip(),
  +         a.getPhoneNumber());
  +   }
  +
  +}
  +
  
  
  
  1.4       +2 -14     xml-axis-wsif/java/test/jms/NativeJMSTest.java
  
  Index: NativeJMSTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/jms/NativeJMSTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NativeJMSTest.java	18 Jun 2002 09:37:07 -0000	1.3
  +++ NativeJMSTest.java	20 Jun 2002 11:14:05 -0000	1.4
  @@ -90,8 +90,6 @@
    */
   public class NativeJMSTest extends TestCase {
   
  -  NativeJMSRequestListener nativeReqListener;
  -  
     public static String name1 = "Purdue Boilermaker";
     public static Address addr1 =
       new Address(
  @@ -116,17 +114,6 @@
   
     public void setUp() {
       TestUtilities.setUpExtensionsAndProviders();
  -    try {
  -       nativeReqListener = 
  -          new NativeJMSRequestListener( 
  -             TestUtilities.getWsifProperty("wsif.nativejms.requestq") );
  -    } catch (WSIFException ex) {
  -    	ex.printStackTrace();
  -    }
  -  }
  -
  -  public void tearDown() {
  -    if ( nativeReqListener != null ) nativeReqListener.stop();
     }
   
     public void testStockQuote() { 
  @@ -243,7 +230,8 @@
   
         WSIFPort port = service.getPort(portName);
   
  -      WSIFOperation operation = port.createOperation(operationName);
  +      WSIFOperation operation = port.createOperation(operationName,
  +                                  "AddEntryWholeNameRequest", null);
   
         WSIFMessage input = operation.createInputMessage();
         input.setObjectPart("name", name1);
  
  
  
  1.2       +3 -1      xml-axis-wsif/java/test/inout/wsiftypes/Mutablestring.java
  
  Index: Mutablestring.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/inout/wsiftypes/Mutablestring.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Mutablestring.java	6 Jun 2002 08:28:56 -0000	1.1
  +++ Mutablestring.java	20 Jun 2002 11:14:05 -0000	1.2
  @@ -57,7 +57,9 @@
   
   package inout.wsiftypes;
   
  -public class Mutablestring{
  +import java.io.Serializable;
  +
  +public class Mutablestring implements Serializable {
   	private String	str;
   	public Mutablestring () { }
   	public Mutablestring (String str) { this.str = str;	}
  
  
  
  1.4       +13 -5     xml-axis-wsif/java/samples/addressbook/wsifservice/AddressBook.wsdl
  
  Index: AddressBook.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/samples/addressbook/wsifservice/AddressBook.wsdl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AddressBook.wsdl	19 Jun 2002 14:07:23 -0000	1.3
  +++ AddressBook.wsdl	20 Jun 2002 11:14:05 -0000	1.4
  @@ -168,20 +168,26 @@
     
     <binding name="NativeJmsBinding" type="tns:AddressBook">
         <jms:binding type="ObjectMessage"/>
  -      <!-- executeInputOnlyOperation(WSIFMessage) -->
  +
         <format:typeMapping encoding="Java" style="Java">
            <format:typeMap typeName="typens:address" formatType="com.ibm.www.namespace.wsif.samples.ab.types.Address"
/>
            <format:typeMap typeName="xsd:string" formatType="java.lang.String" />
         </format:typeMapping>
  +
         <operation name="addEntry">
           <input name="AddEntryWholeNameRequest"/>       	
         </operation>  
  +
  +      <operation name="addEntry">
  +        <input name="AddEntryFirstAndLastNamesRequest"/>
  +      </operation>
  +
         <operation name="getAddressFromName">      	
  -      	<!-- executeRequestResponseAsync(WSIFMessage,WSIFResponseHandler) -->
         	<input name="GetAddressFromNameRequest"/>
         	<output name="GetAddressFromNameResponse"/>
  -    	</operation>   
  -  </binding>
  +      </operation>   
  +
  +  </binding>   
   
     <!-- service decln -->
     <service name="AddressBookService">
  @@ -203,7 +209,9 @@
                      destinationStyle="queue"
                      jndiConnectionFactoryName="WSIFSampleQCF"
                      initialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory" 
  -                   jndiProviderURL="file:///JNDI-Directory"/>
  +                   jndiProviderURL="file:///JNDI-Directory">
  +                   <jms:propertyValue name="JMSReplyTo" type="xsd:string" value="NativeJmsResponseQueue"/>
  +      </jms:address>
       </port>
     </service>
   
  
  
  
  1.3       +124 -0    xml-axis-wsif/java/test/inout/wsifservice/Inout.wsdl
  
  Index: Inout.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/inout/wsifservice/Inout.wsdl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Inout.wsdl	19 Jun 2002 14:07:23 -0000	1.2
  +++ Inout.wsdl	20 Jun 2002 11:14:05 -0000	1.3
  @@ -752,6 +752,121 @@
       </operation>
     </binding>
   
  +  <binding name="NativeJmsBinding" type="tns:Inout">
  +    <jms:binding type="ObjectMessage"/>
  +    <format:typeMapping encoding="Java" style="Java">
  +      <format:typeMap typeName="typeabns:address" 
  +                      formatType="com.ibm.www.namespace.wsif.samples.ab.types.Address"
/>
  +      <format:typeMap typeName="typeions:mutablestring" 
  +                      formatType="com.ibm.www.namespace.wsif.tests.io.types.Mutablestring"
/>
  +      <format:typeMap typeName="xsd:string" 
  +                      formatType="java.lang.String" />
  +      <format:typeMap typeName="typeions:arrayofint" 
  +                      formatType="[I" />
  +      <format:typeMap typeName="xsd:timeInstant" 
  +                      formatType="java.util.Date" />
  +      <format:typeMap typeName="xsd:float" 
  +                      formatType="float" />
  +      <format:typeMap typeName="xsd:int" 
  +                      formatType="int" />
  +      <format:typeMap typeName="xsd:boolean" 
  +                      formatType="boolean" />
  +    </format:typeMapping>
  +    <operation name="addEntry">
  +      <java:operation
  +         methodName="addEntry"
  +         parameterOrder="name address"
  +         methodType="instance" />
  +      <input name="AddEntryWholeNameRequest"/>
  +    </operation>
  +    <operation name="addEntry">
  +      <java:operation
  +         methodName="addEntry"
  +         parameterOrder="firstName lastName address"
  +         methodType="instance" />
  +      <input name="AddEntryFirstAndLastNamesRequest"/>
  +    </operation>
  +    <operation name="getAddressFromName">
  +      <java:operation
  +         methodName="getAddressFromName"
  +         parameterOrder="name"
  +         methodType="instance"
  +         returnPart="address" />
  +      <input name="GetAddressFromNameRequest"/>
  +      <output name="GetAddressFromNameResponse"/>
  +    </operation>
  +    <operation name="getAddressFromName">
  +      <java:operation
  +         methodName="getAddressFromName"
  +         parameterOrder="name"
  +         methodType="instance"
  +         returnPart="address" />
  +      <input name="GetAddressFromNameMSRequest"/>
  +      <output name="GetAddressFromNameMSResponse"/>
  +    </operation>
  +    <operation name="getAddressFromName">
  +      <java:operation
  +         methodName="getAddressFromName"
  +         parameterOrder="name address"
  +         methodType="instance"
  +         returnPart="success" />
  +      <input name="GetAddressFromNameMSARequest"/>
  +      <output name="GetAddressFromNameMSAResponse"/>
  +    </operation>
  +    <operation name="addNumbers">
  +      <java:operation
  +         methodName="addNumbers"
  +         parameterOrder="nums"
  +         methodType="instance" />
  +      <input name="AddNumbersRequest"/>
  +      <output name="AddNumbersResponse"/>
  +    </operation>
  +    <operation name="getDate">
  +      <java:operation
  +         methodName="getDate"
  +         methodType="instance" 
  +         returnPart="date"/>
  +      <input name="GetDateRequest"/>
  +      <output name="GetDateResponse"/>
  +    </operation>
  +    <operation name="whoami">
  +      <java:operation
  +         methodName="whoami"
  +         parameterOrder="string"
  +         methodType="instance" 
  +         returnPart="type"/>
  +      <input name="WhoamiStringRequest"/>
  +      <output name="WhoamiStringResponse"/>
  +    </operation>
  +    <operation name="whoami">
  +      <java:operation
  +         methodName="whoami"
  +         parameterOrder="float"
  +         methodType="instance" 
  +         returnPart="type"/>
  +      <input name="WhoamiFloatRequest"/>
  +      <output name="WhoamiFloatResponse"/>
  +    </operation>
  +    <operation name="whoami">
  +      <java:operation
  +         methodName="whoami"
  +         parameterOrder="int"
  +         methodType="instance" 
  +         returnPart="type"/>
  +      <input name="WhoamiIntRequest"/>
  +      <output name="WhoamiIntResponse"/>
  +    </operation>
  +    <operation name="whoami">
  +      <java:operation
  +         methodName="whoami"
  +         parameterOrder="address"
  +         methodType="instance" 
  +         returnPart="type"/>
  +      <input name="WhoamiAddressRequest"/>
  +      <output name="WhoamiAddressResponse"/>
  +    </operation>
  +  </binding>
  +
     <!-- service decln -->
     <service name="InoutService">
       <port name="SOAPPort" binding="tns:SOAPHttpBinding">
  @@ -776,6 +891,15 @@
                      jndiConnectionFactoryName="WSIFSampleQCF"
                      initialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory"
                      jndiProviderURL="file:///JNDI-Directory"/>
  +    </port>
  +    <port name="NativeJMSPort" binding="tns:NativeJmsBinding">
  +      <jms:address jndiDestinationName="NativeJmsRequestQueue"
  +                   destinationStyle="queue"
  +                   jndiConnectionFactoryName="WSIFSampleQCF"
  +                   initialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory" 
  +                   jndiProviderURL="file://C:/JNDI-Directory">
  +                   <jms:propertyValue name="JMSReplyTo" type="xsd:string" value="NativeJmsResponseQueue"/>
  +      </jms:address>
       </port>
     </service>
   
  
  
  
  1.3       +117 -16   xml-axis-wsif/java/test/org/apache/wsif/util/jms/NativeJMSRequestListener.java
  
  Index: NativeJMSRequestListener.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/org/apache/wsif/util/jms/NativeJMSRequestListener.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NativeJMSRequestListener.java	19 Jun 2002 14:07:24 -0000	1.2
  +++ NativeJMSRequestListener.java	20 Jun 2002 11:14:05 -0000	1.3
  @@ -72,6 +72,8 @@
   import addressbook.wsiftypes.Phone;
   import stockquote.wsifservice.StockquotePT;
   import stockquote.wsiftypes.StockQuote;
  +import inout.wsiftypes.InoutImpl;
  +import inout.wsiftypes.Mutablestring;
   
   import java.io.Serializable;
   import java.util.*;
  @@ -92,8 +94,12 @@
   
       private Thread listener;
   
  -    AddressBook ab = new AddressBook();
  -    StockQuote sq = new StockQuote();
  +    static AddressBook ab = new AddressBook();
  +    static StockQuote sq = new StockQuote();
  +    static InoutImpl inout = new InoutImpl();
  +
  +    static final Object LOCK = new Lock();
  +    static class Lock {}
       
       private WSIFJMSListener list = new WSIFJMSListener() {
           public void onException(JMSException arg1) {
  @@ -105,7 +111,9 @@
   
           public void onMessage(Message message) {
               Tr.entry(this, message);
  -            processResponse(message);
  +  	        synchronized ( getLock() ) {
  +               processResponse(message);
  +  	        }
               Tr.exit();
           }
       };
  @@ -175,21 +183,58 @@
       	try {
               HashMap hm = (HashMap) ((ObjectMessage)msg).getObject();
   
  -            String name = (String)hm.get( "name" );
  -            String symbol = (String)hm.get( "symbol" );
  -            Address addr = (Address)hm.get( "address" );
  +            boolean name = false;
  +            boolean msName = false;
  +            boolean addr = false;
  +            boolean symbol = false;
  +            boolean nums = false;
  +            boolean firstName = false;
  +            boolean lastName = false;
  +            boolean unknown = false;
               
  +            for (Iterator i = hm.keySet().iterator(); i.hasNext(); ) {
  +            	String key = (String) i.next();
  +            	if ( key.equals( "name" ) ) name = true;
  +            	else if ( key.equals( "address" ) ) addr = true;
  +            	else if ( key.equals( "symbol" ) ) symbol = true;
  +            	else if ( key.equals( "nums" ) ) nums = true;
  +            	else if ( key.equals( "firstName" ) ) firstName = true;
  +            	else if ( key.equals( "lastName" ) ) lastName = true;
  +            	else unknown = true;
  +            }
  +
  +            Object o =hm.get( "name" );
  +            if ( o instanceof Mutablestring ) {
  +            	name = false;
  +            	msName = msName = true;
  +            }
  +
               Object reply = null;
  -            if ( symbol != null ) {
  +            if ( symbol ) {
               	reply = new Float( sqGetQuote( (ObjectMessage)msg ) );
                   sendReply( msg, reply );
  -            } else if ( addr != null && name != null ) {
  +            } else if ( addr && name ) {
               	abAddEntry( (ObjectMessage) msg );
  -            } else if ( name != null ) {
  +            } else if ( addr && firstName && lastName ) {
  +            	abAddEntryFL( (ObjectMessage) msg );
  +            } else if ( name ) {
               	reply = abGetAddressFromName( (ObjectMessage) msg );
                   sendReply( msg, reply );
  +            } else if ( msName ) {
  +            	reply = inoutGetAddressFromName( (ObjectMessage) msg );
  +                sendReply( msg, reply );
  +            } else if ( nums ) {
  +            	reply = inoutAddNumbers( (ObjectMessage) msg );
  +                sendReply( msg, reply );
  +            } else if ( !name && !msName && !addr && !symbol &&
!nums && !unknown ) {
  +            	reply = inoutGetDate( (ObjectMessage) msg );
  +                sendReply( msg, reply );
  +            } else { // assume anything else is a whoami request
  +            	reply = inoutWhoami( (ObjectMessage) msg );
  +                sendReply( msg, reply );
               }
   
  +
       	} catch (Exception ex) {
       		ex.printStackTrace();
       	}
  @@ -200,6 +245,16 @@
          String name = (String)hm.get( "name" );  	
          Address addr = (Address)hm.get( "address" );  	
          ab.addEntry( name, addr );
  +       inout.addEntry( name, addr );
  +    }
  +
  +    private void abAddEntryFL(ObjectMessage msg) throws JMSException { 
  +       HashMap hm = (HashMap) msg.getObject();
  +       String first = (String)hm.get( "firstName" );  	
  +       String last = (String)hm.get( "lastName" );  	
  +       Address addr = (Address)hm.get( "address" );  	
  +       ab.addEntry( first, last, addr );
  +       inout.addEntry( first, last, addr );
       }
   
       private Address abGetAddressFromName(ObjectMessage msg) throws JMSException { 
  @@ -214,21 +269,67 @@
          return sq.getQuote( name );
       }
       
  +    private Address inoutGetAddressFromName(ObjectMessage msg) throws JMSException { 
  +       HashMap hm = (HashMap) msg.getObject();
  +       Mutablestring name = (Mutablestring)hm.get( "name" );  	
  +       return inout.getAddressFromName( name );
  +    }
  +    
  +    private Date inoutGetDate(ObjectMessage msg) throws JMSException { 
  +       return inout.getDate();
  +    }
  +    
  +    private String inoutWhoami(ObjectMessage msg) throws JMSException { 
  +       HashMap hm = (HashMap) msg.getObject();
  +       String wamStr = (String)hm.get( "string" );
  +       if ( wamStr != null ) {
  +          return inout.whoami( wamStr );
  +       }
  +       Address wamAddr = (Address)hm.get( "address" );
  +       if ( wamAddr != null ) {
  +          return inout.whoami( wamAddr );
  +       }
  +       Object o = hm.get( "int" );
  +       if ( o != null ) {
  +          return inout.whoami( ((Integer)o).intValue() );
  +       }
  +       o = hm.get( "float" );
  +       if ( o != null ) {
  +          return inout.whoami( ((Float)o).floatValue() );
  +       } 
  +       return "errror - unknown obj";
  +    }
  +    
  +    private Integer inoutAddNumbers(ObjectMessage msg) throws JMSException { 
  +       HashMap hm = (HashMap) msg.getObject();
  +       int[] nums = (int[])hm.get( "nums" );
  +       return new Integer( inout.addNumbers( nums ) );
  +    }
  +    
       private void sendReply(Message msg, Object response) throws Exception {    
  -    		    Message replyMsg = session.createObjectMessage();
  -                ((ObjectMessage)replyMsg).setObject((Serializable) response );
  +       Message replyMsg = session.createObjectMessage();
  +       ((ObjectMessage)replyMsg).setObject((Serializable) response );
   
  -        	    String replyq = ((Queue)msg.getJMSReplyTo()).getQueueName().substring( 9 );
  +       String replyq = ((Queue)msg.getJMSReplyTo()).getQueueName().substring( 9 );
               
  -                WSIFJMSDestination dest = new WSIFJMSDestination(
  -                      new WSIFJMSFinderForJndi(null,
  +       WSIFJMSDestination dest = new WSIFJMSDestination(
  +          new WSIFJMSFinderForJndi(null,
                                      initialContextFactory, 
                                      jndiUrl,
                                      WSIFJMSFinder.STYLE_QUEUE,
                                      queueConnectionFactory,
                                      replyq )
  -                );
  -                dest.send( replyMsg, msg.getJMSMessageID() );
  +          );
  +       dest.send( replyMsg, msg.getJMSMessageID() );
  +    }
  +
  +    /**
  +     * this is needed as the native JMS inputonly method really is inputonly
  +     * so doesn't wait for a response. Therefore the next request, such as an
  +     * addressbook lookup may run before the previous add has completed.
  +     */
  +    public final Object getLock() {
  +        return LOCK;
       }
   
   }
  
  
  
  1.5       +3 -0      xml-axis-wsif/java/test/addressbook/AddressBookTest.java
  
  Index: AddressBookTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/addressbook/AddressBookTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AddressBookTest.java	12 Jun 2002 15:35:38 -0000	1.4
  +++ AddressBookTest.java	20 Jun 2002 11:14:05 -0000	1.5
  @@ -139,6 +139,9 @@
       public void testAxisJms() {
           doit("SOAPJMSPort", "axis");
       }
  +    public void testNativeJms() {
  +        doit("NativeJmsPort", "" ); 
  +    }
       public void testDynamicSOAP() {
           doitDyn("SOAPPort");
       }
  
  
  
  1.9       +1 -0      xml-axis-wsif/java/test/async/AsyncTest.java
  
  Index: AsyncTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/async/AsyncTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AsyncTest.java	12 Jun 2002 15:35:38 -0000	1.8
  +++ AsyncTest.java	20 Jun 2002 11:14:05 -0000	1.9
  @@ -78,6 +78,7 @@
   import org.apache.wsif.base.WSIFServiceImpl;
   import org.apache.wsif.providers.soap.apacheaxis.WSIFDynamicProvider_ApacheAxis;
   import util.TestUtilities;
  +
   import org.apache.wsif.util.jms.JMSAsyncListener;
   
   /**
  
  
  
  1.8       +13 -0     xml-axis-wsif/java/test/util/WSIFTestRunner.java
  
  Index: WSIFTestRunner.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/util/WSIFTestRunner.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WSIFTestRunner.java	19 Jun 2002 14:07:24 -0000	1.7
  +++ WSIFTestRunner.java	20 Jun 2002 11:14:06 -0000	1.8
  @@ -66,9 +66,11 @@
   import junit.framework.Test;
   import junit.framework.TestSuite;
   import junit.textui.TestRunner;
  +import org.apache.wsif.WSIFException;
   import org.apache.wsif.util.jms.JMS2HTTPBridge;
   import org.apache.wsif.util.jms.JMS2HTTPBridgeDestination;
   import org.apache.wsif.util.jms.JMSAsyncListener;
  +import org.apache.wsif.util.jms.NativeJMSRequestListener;
   import org.apache.wsif.base.WSIFDefaultCorrelationService;
   import org.apache.wsif.util.WSIFCorrelationServiceLocator;
   import providers.ProvidersInitialisationTest;
  @@ -121,11 +123,19 @@
           BridgeThread jmsAb = null;
           BridgeThread jmsSq = null;
           JMSAsyncListener asyncListener = null; 
  +        NativeJMSRequestListener nativeReqListener = null;
   
           if (TestUtilities.areWeTesting("jms")) {
               wtr = new WSIFTestRunner();
               jmsAb = wtr.new BridgeThread("AddressBook");
               jmsSq = wtr.new BridgeThread("Stockquote");
  +            try { 	
  +               nativeReqListener = 
  +                  new NativeJMSRequestListener( 
  +                     TestUtilities.getWsifProperty("wsif.nativejms.requestq") );
  +    	    } catch (WSIFException ex) {
  +    	  	   ex.printStackTrace();
  +    	    }
               jmsAb.start();
               jmsSq.start();
           }
  @@ -146,6 +156,9 @@
               jmsSq.interrupt();
       	if (TestUtilities.areWeTesting("async")) {
              asyncListener.stop();
  +           if ( nativeReqListener != null ) {
  +              nativeReqListener.stop();
  +           }
              ((WSIFDefaultCorrelationService)WSIFCorrelationServiceLocator.
                 getCorrelationService()).shutdown();
       	}
  
  
  

Mime
View raw message