You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sc...@apache.org on 2008/05/03 04:23:19 UTC

svn commit: r652968 [3/3] - in /webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws: anytype/tests/ catalog/ client/ client/dispatch/ client/proxy/ description/ dispatch/ nonanonymous/complextype/ provider/ proxy/ rpclit/...

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java Fri May  2 19:23:18 2008
@@ -69,8 +69,9 @@
      */
     public void testFaultsService0() {
         Exception exception = null;
+        FaultsServicePortType proxy = getProxy();
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "BaseFault", 2);
             
@@ -88,14 +89,35 @@
         BaseFault bf = (BaseFault) fault;
         assertTrue(bf.getA() == 2);
         
+        // Repeat to verify 
+        try{
+            exception = null;
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "BaseFault", 2);
+            
+        }catch(BaseFault_Exception e){
+            exception = e;
+        } catch (ComplexFault_Exception e) {
+            fail("Should not get ComplexFault_Exception in this testcase");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        fault = ((BaseFault_Exception)exception).getFaultInfo();
+        assertTrue(fault.getClass() == BaseFault.class);
+        bf = (BaseFault) fault;
+        assertTrue(bf.getA() == 2);
+        
     }
     /**
      * Tests that that BaseFault (DerivedFault1) is thrown
      */
     public void testFaultsService1() {
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "DerivedFault1", 2);
             
@@ -114,14 +136,36 @@
         assertTrue(df.getA() == 2);
         assertTrue(df.getB().equals("DerivedFault1"));
         
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "DerivedFault1", 2);
+            
+        }catch(BaseFault_Exception e){
+            exception = e;
+        } catch (ComplexFault_Exception e) {
+            fail("Should not get ComplexFault_Exception in this testcase");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        fault = ((BaseFault_Exception)exception).getFaultInfo();
+        assertTrue(fault.getClass() == DerivedFault1.class);
+        df = (DerivedFault1) fault;
+        assertTrue(df.getA() == 2);
+        assertTrue(df.getB().equals("DerivedFault1"));
+        
     }
     /**
      * Tests that that BaseFault (DerivedFault1) is thrown
      */
     public void testFaultsService2() {
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "DerivedFault2", 2);
             
@@ -140,15 +184,38 @@
         assertTrue(df.getA() == 2);
         assertTrue(df.getB().equals("DerivedFault2"));  
         assertTrue(df.getC() == 2);
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "DerivedFault2", 2);
+            
+        }catch(BaseFault_Exception e){
+            exception = e;
+        } catch (ComplexFault_Exception e) {
+            fail("Should not get ComplexFault_Exception in this testcase");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        fault = ((BaseFault_Exception)exception).getFaultInfo();
+        assertTrue(fault.getClass() == DerivedFault2.class);
+        df = (DerivedFault2) fault;
+        assertTrue(df.getA() == 2);
+        assertTrue(df.getB().equals("DerivedFault2"));  
+        assertTrue(df.getC() == 2);
     }
     
     /**
      * Tests that that ComplxFaultFault is thrown 
      */
     public void testFaultsService3(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "Complex", 2);  // "Complex" will cause service to throw ComplexFault_Exception
@@ -169,15 +236,58 @@
         assertTrue(cf.getB().equals("Complex"));  
         assertTrue(cf.getC() == 2);
         assertTrue(cf.getD() == 5);
+        
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "Complex", 2);  // "Complex" will cause service to throw ComplexFault_Exception
+            
+        }catch(BaseFault_Exception e){
+            fail("Should not get BaseFault_Exception in this testcase");
+        } catch (ComplexFault_Exception e) {
+            exception = e;
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        fault = ((ComplexFault_Exception)exception).getFaultInfo();
+        assertTrue(fault.getClass() == ComplexFault.class);
+        cf = (ComplexFault) fault;
+        assertTrue(cf.getA() == 2);
+        assertTrue(cf.getB().equals("Complex"));  
+        assertTrue(cf.getC() == 2);
+        assertTrue(cf.getD() == 5);
     }
     
+    
     /**
      * Tests that throwing of SimpleFault
      */
     public void testFaultsService4(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            float total = proxy.getQuote("SMPL");
+            fail( "Expected SimpleFault but no fault was thrown ");
+        }catch(SimpleFault e){
+            SimpleFault fault = (SimpleFault) e;
+
+            int faultInfo = fault.getFaultInfo();
+            assertTrue(faultInfo == 100);
+        } catch (Exception e) {
+            fail("Wrong exception thrown.  Expected SimpleFault but received " + e.getClass());
+        }
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             float total = proxy.getQuote("SMPL");
@@ -198,9 +308,10 @@
      * Disabled while I fix this test
      */
     public void testFaultsService5(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            
             
             // the invoke will throw an exception, if the test is performed right
             float total = proxy.getQuote("LEGC");
@@ -213,16 +324,44 @@
         } catch (Exception e) {
             fail("Wrong exception thrown.  Expected InvalidTickerFault_Exception but received " + e.getClass());
         }
+        
+        // Repeat to verify behavior
+        try {
+            // the invoke will throw an exception, if the test is performed right
+            float total = proxy.getQuote("LEGC");
+            fail( "Expected InvalidTickerFault_Exception but no fault was thrown ");
+        }catch(InvalidTickerFault_Exception e){
+            InvalidTickerFault_Exception fault = (InvalidTickerFault_Exception) e;
+
+            assertTrue(fault.getLegacyData1().equals("LEGC"));
+            assertTrue(fault.getLegacyData2() == 123);
+        } catch (Exception e) {
+            fail("Wrong exception thrown.  Expected InvalidTickerFault_Exception but received " + e.getClass());
+        }
     }
     
     /**
      * Tests that throwing of BaseFault_Exception
      */
     public void testFaultsService6(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
-            
+            // the invoke will throw an exception, if the test is performed right
+            float total = proxy.getQuote("BASE");
+            fail( "Expected BaseFault_Exception but no fault was thrown ");
+        }catch(BaseFault_Exception e){
+            BaseFault_Exception fault = (BaseFault_Exception) e;
+
+            BaseFault faultInfo = fault.getFaultInfo();
+            assertTrue(faultInfo != null);
+            assertTrue(faultInfo.getA() == 400);
+        } catch (Exception e) {
+            fail("Wrong exception thrown.  Expected BaseFault_Exception but received " + e.getClass());
+        }
+        
+        // Repeat to verify behavior
+        try{
             // the invoke will throw an exception, if the test is performed right
             float total = proxy.getQuote("BASE");
             fail( "Expected BaseFault_Exception but no fault was thrown ");
@@ -241,10 +380,25 @@
      * Tests that throwing of DerivedFault1_Exception
      */
     public void testFaultsService7(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
-            
+            // the invoke will throw an exception, if the test is performed right
+            float total = proxy.getQuote("DF1");
+            fail( "Expected DerivedFault1_Exception but no fault was thrown");
+        }catch(DerivedFault1_Exception e){
+            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;
+
+            DerivedFault1 faultInfo = fault.getFaultInfo();
+            assertTrue(faultInfo != null);
+            assertTrue(faultInfo.getA() == 100);
+            assertTrue(faultInfo.getB().equals("DF1"));
+        } catch (Exception e) {
+            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
+        }
+        
+        // Repeat to verify behavior
+        try{
             // the invoke will throw an exception, if the test is performed right
             float total = proxy.getQuote("DF1");
             fail( "Expected DerivedFault1_Exception but no fault was thrown");
@@ -264,10 +418,26 @@
      * Tests that throwing of DerivedFault1_Exception
      */
     public void testFaultsService8(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
-            
+            // the invoke will throw an exception, if the test is performed right
+            float total = proxy.getQuote("DF2");
+            fail( "Expected DerivedFault2_Exception but no fault was thrown ");
+        }catch(DerivedFault2_Exception e){
+            DerivedFault2_Exception fault = (DerivedFault2_Exception) e;
+
+            DerivedFault2 faultInfo = fault.getFaultInfo();
+            assertTrue(faultInfo != null);
+            assertTrue(faultInfo.getA() == 200);
+            assertTrue(faultInfo.getB().equals("DF2"));
+            assertTrue(faultInfo.getC() == 80.0F);
+        } catch (Exception e) {
+            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
+        }
+        
+        // Repeat to verify behavior
+        try{
             // the invoke will throw an exception, if the test is performed right
             float total = proxy.getQuote("DF2");
             fail( "Expected DerivedFault2_Exception but no fault was thrown ");
@@ -288,9 +458,10 @@
      * Tests that that SOAPFaultException is thrown 
      */
     public void testFaultsService9a(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "SOAPFaultException", 2);  // "SOAPFaultException" will cause service to throw SOAPFaultException
@@ -311,15 +482,40 @@
         assertTrue(soapFault.getFaultString().equals("hello world"));
         assertTrue(soapFault.getFaultActor().equals("actor"));
         assertTrue(soapFault.getDetail() == null);
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "SOAPFaultException", 2);  // "SOAPFaultException" will cause service to throw SOAPFaultException
+            
+        }catch(SOAPFaultException e){
+            // Okay
+            exception = e;
+        } catch (Exception e) {
+            fail("Did not get a SOAPFaultException");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        sfe = (SOAPFaultException) exception;
+        soapFault = sfe.getFault();
+        assertTrue(soapFault != null);
+        assertTrue(soapFault.getFaultString().equals("hello world"));
+        assertTrue(soapFault.getFaultActor().equals("actor"));
+        assertTrue(soapFault.getDetail() == null);
     }
     
     /**
      * Tests that that SOAPFaultException is thrown 
      */
     public void testFaultsService9b(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "SOAPFaultException2", 2);  // "SOAPFaultException" will cause service to throw SOAPFaultException
@@ -345,15 +541,45 @@
         assertTrue(de.getNamespaceURI().equals("urn://sample"));
         assertTrue(de.getLocalName().equals("detailEntry"));
         assertTrue(de.getValue().equals("Texas"));
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "SOAPFaultException2", 2);  // "SOAPFaultException" will cause service to throw SOAPFaultException
+            
+        }catch(SOAPFaultException e){
+            // Okay
+            exception = e;
+        } catch (Exception e) {
+            fail("Did not get a SOAPFaultException");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        sfe = (SOAPFaultException) exception;
+        soapFault = sfe.getFault();
+        assertTrue(soapFault != null);
+        assertTrue(soapFault.getFaultString().equals("hello world2"));
+        assertTrue(soapFault.getFaultActor().equals("actor2"));
+        assertTrue(soapFault.getDetail() != null);
+        de = (DetailEntry) soapFault.getDetail().getDetailEntries().next();
+        assertTrue(de != null);
+        assertTrue(de.getNamespaceURI().equals("urn://sample"));
+        assertTrue(de.getLocalName().equals("detailEntry"));
+        assertTrue(de.getValue().equals("Texas"));
     }
     
     /**
      * Tests that that SOAPFaultException (NPE) is thrown 
      */
     public void testFaultsService10(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "NPE", 2);  // "NPE" will cause service to throw NPE System Exception
@@ -372,15 +598,38 @@
         SOAPFault soapFault = sfe.getFault();
         assertTrue(soapFault != null);
         assertTrue(soapFault.getFaultString().equals("java.lang.NullPointerException"));
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "NPE", 2);  // "NPE" will cause service to throw NPE System Exception
+            
+        }catch(SOAPFaultException e){
+            // Okay
+            exception = e;
+        } catch (Exception e) {
+            fail("Did not get a SOAPFaultException");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        sfe = (SOAPFaultException) exception;
+        soapFault = sfe.getFault();
+        assertTrue(soapFault != null);
+        assertTrue(soapFault.getFaultString().equals("java.lang.NullPointerException"));
     }
     
     /**
      * Tests that that SOAPFaultException (NPE) is thrown 
      */
     public void testFaultsService10a(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "NPE2", 2);  // "NPE" will cause service to throw NPE System Exception
@@ -399,15 +648,39 @@
         SOAPFault soapFault = sfe.getFault();
         assertTrue(soapFault != null);
         assertTrue(soapFault.getFaultString().equals("Null Pointer Exception occurred"));
+        
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "NPE2", 2);  // "NPE" will cause service to throw NPE System Exception
+            
+        }catch(SOAPFaultException e){
+            // Okay
+            exception = e;
+        } catch (Exception e) {
+            fail("Did not get a SOAPFaultException");
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        sfe = (SOAPFaultException) exception;
+        soapFault = sfe.getFault();
+        assertTrue(soapFault != null);
+        assertTrue(soapFault.getFaultString().equals("Null Pointer Exception occurred"));
     }
     
     /**
      * Tests that that SOAPFaultException (for WebServiceException) is thrown 
      */
     public void testFaultsService11(){
+        FaultsServicePortType proxy = getProxy();
         Exception exception = null;
         try{
-            FaultsServicePortType proxy = getProxy();
+            exception = null;
             
             // the invoke will throw an exception, if the test is performed right
             int total = proxy.throwFault(2, "WSE", 2);  // "WSE" will cause service to throw WebServiceException System Exception
@@ -419,6 +692,7 @@
             fail("Did not get a SOAPFaultException");
         }
 
+        
         TestLogger.logger.debug("----------------------------------");
         
         assertNotNull(exception);
@@ -426,6 +700,29 @@
         SOAPFault soapFault = sfe.getFault();
         assertTrue(soapFault != null);
         assertTrue(soapFault.getFaultString().equals("This is a WebServiceException"));
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.throwFault(2, "WSE", 2);  // "WSE" will cause service to throw WebServiceException System Exception
+            
+        }catch(SOAPFaultException e){
+            // Okay...on the client a SOAPFaultException should be thrown
+            exception = e;
+        } catch (Exception e) {
+            fail("Did not get a SOAPFaultException");
+        }
+
+        
+        TestLogger.logger.debug("----------------------------------");
+        
+        assertNotNull(exception);
+        sfe = (SOAPFaultException) exception;
+        soapFault = sfe.getFault();
+        assertTrue(soapFault != null);
+        assertTrue(soapFault.getFaultString().equals("This is a WebServiceException"));
     }
     
     /**
@@ -438,5 +735,11 @@
         
         // If resource injection occurred properly, then the a value of 1234567 is expected
         assertTrue("Resource Injection Failed", total == 1234567);
+        
+        // Repeat to verify behavior
+        total = proxy.getQuote("INJECTION");
+        
+        // If resource injection occurred properly, then the a value of 1234567 is expected
+        assertTrue("Resource Injection Failed", total == 1234567);
     }
 }

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java Fri May  2 19:23:18 2008
@@ -52,12 +52,14 @@
 
 
     public void testFaultyWebService(){
+        TestLogger.logger.debug("----------------------------------");
+        TestLogger.logger.debug("test: " + getName());
+        FaultyWebServiceService service = new FaultyWebServiceService();
+        FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
+        
         FaultyWebServiceFault_Exception exception = null;
         try{
-            TestLogger.logger.debug("----------------------------------");
-            TestLogger.logger.debug("test: " + getName());
-            FaultyWebServiceService service = new FaultyWebServiceService();
-            FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
+            exception = null;
             BindingProvider p =	(BindingProvider)proxy;
             p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
 
@@ -78,21 +80,72 @@
         assertNotNull(exception.getFaultInfo());
         assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
         assertEquals("bean custom message", exception.getFaultInfo().getMessage());
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+            BindingProvider p = (BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.faultyWebService(10);
+
+        }catch(FaultyWebServiceFault_Exception e){
+            exception = e;
+        }catch(Exception e) {
+            e.printStackTrace();
+            fail(e.toString());
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+
+        assertNotNull(exception);
+        assertEquals("custom exception", exception.getMessage());
+        assertNotNull(exception.getFaultInfo());
+        assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
+        assertEquals("bean custom message", exception.getFaultInfo().getMessage());
 
     }
 
     public void testFaultyWebService_badEndpoint(){
 
+        TestLogger.logger.debug("----------------------------------");
+        TestLogger.logger.debug("test: " + getName());
+        FaultyWebServiceService service = new FaultyWebServiceService();
+        FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
+        
         String host = "this.is.a.bad.endpoint.terrible.in.fact";
         String badEndpoint = "http://" + host;
 
         WebServiceException exception = null;
 
         try{
-            TestLogger.logger.debug("----------------------------------");
-            TestLogger.logger.debug("test: " + getName());
-            FaultyWebServiceService service = new FaultyWebServiceService();
-            FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
+            exception = null;
+            BindingProvider p = (BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,badEndpoint);
+
+            // the invoke will throw an exception, if the test is performed right
+            int total = proxy.faultyWebService(10);
+
+        }catch(FaultyWebServiceFault_Exception e) {
+            // shouldn't get this exception
+            fail(e.toString());
+        }catch(WebServiceException e) {
+            exception = e;
+        }catch(Exception e) {
+            fail("This testcase should only produce a WebServiceException.  We got: " + e.toString());
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+
+        assertNotNull(exception);
+        assertTrue(exception.getCause() instanceof UnknownHostException);
+        assertTrue(exception.getCause().getMessage().indexOf(host)!=-1);
+        
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
             BindingProvider p = (BindingProvider)proxy;
             p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,badEndpoint);
 
@@ -121,20 +174,41 @@
 
 
     public void testFaultyWebService_badEndpoint_oneWay() {
-
         String host = "this.is.a.bad.endpoint.terrible.in.fact";
         String badEndpoint = "http://" + host;
+        
+        DocLitWrapService service = new DocLitWrapService();
+        DocLitWrap proxy = service.getDocLitWrapPort();
+        BindingProvider p = (BindingProvider)proxy;
+        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,badEndpoint);
+        
+       
 
         WebServiceException exception = null;
 
         TestLogger.logger.debug("------------------------------");
         TestLogger.logger.debug("Test : " + getName());
         try{
+            exception = null;
+           
+            proxy.oneWayVoid();
 
-            DocLitWrapService service = new DocLitWrapService();
-            DocLitWrap proxy = service.getDocLitWrapPort();
-            BindingProvider p = (BindingProvider)proxy;
-            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,badEndpoint);
+        }catch(WebServiceException e) {
+            exception = e;
+        }catch(Exception e) {
+            fail("This testcase should only produce a WebServiceException.  We got: " + e.toString());
+        }
+
+        TestLogger.logger.debug("----------------------------------");
+
+        assertNotNull(exception);
+        assertTrue(exception.getCause() instanceof UnknownHostException);
+        assertTrue(exception.getCause().getMessage().indexOf(host)!=-1);
+        
+        // Repeat to verify behavior
+        try{
+            exception = null;
+           
             proxy.oneWayVoid();
 
         }catch(WebServiceException e) {
@@ -185,6 +259,28 @@
                    + "SOAPFaultException.  Found type: "
                    + e.getCause().getClass(), e.getCause().getClass()
                    .isAssignableFrom(SOAPFaultException.class));
+        
+        // Repeat to verify behavior
+        callback = new FaultyAsyncHandler();
+        future = proxy.faultyWebServiceAsync(1, callback);
+
+        while (!future.isDone()) {
+            Thread.sleep(1000);
+            TestLogger.logger.debug("Async invocation incomplete");
+        }
+
+        e = callback.getException();
+
+        // Section 4.3.3 states that the top level Exception should be
+        // an ExecutionException, with a WebServiceException underneath.
+        assertNotNull("The exception was null.", e);
+        assertTrue("The thrown exception should be an ExecutionException.", e
+                   .getClass().equals(ExecutionException.class));
+        assertTrue(
+                   "The expected fault type under the ExecutionException should be a "
+                   + "SOAPFaultException.  Found type: "
+                   + e.getCause().getClass(), e.getCause().getClass()
+                   .isAssignableFrom(SOAPFaultException.class));
 
     }
 
@@ -226,6 +322,32 @@
                    + "SOAPFaultException.  Found type: "
                    + e.getCause().getClass(), e.getCause().getClass()
                    .isAssignableFrom(SOAPFaultException.class));
+        
+        
+        // Repeat to verify behavior
+        proxy.faultyWebServiceAsync(1);
+        while (!future.isDone()) {
+            Thread.sleep(1000);
+            TestLogger.logger.debug("Async invocation incomplete");
+        }
+
+        e = null;
+        try {
+            Object obj = future.get();
+        } catch (Exception ex) {
+            e = ex;
+        }
+
+        // Section 4.3.3 states that the top level Exception should be
+        // an ExecutionException, with a WebServiceException underneath.
+        assertNotNull("The exception was null.", e);
+        assertTrue("The thrown exception should be an ExecutionException.", e
+                   .getClass().equals(ExecutionException.class));
+        assertTrue(
+                   "The expected fault type under the ExecutionException should be a "
+                   + "SOAPFaultException.  Found type: "
+                   + e.getCause().getClass(), e.getCause().getClass()
+                   .isAssignableFrom(SOAPFaultException.class));
 
     }
 
@@ -260,6 +382,28 @@
         assertTrue("The expected fault type under the ExecutionException should be a " +
                    "FaultyWebServiceFault_Exception.  Found type: " + e.getCause().getClass(), 
                    e.getCause().getClass().isAssignableFrom(FaultyWebServiceFault_Exception.class));
+        
+        
+        // Repeat to verify behavior
+        callback = new FaultyAsyncHandler();
+        future = proxy.faultyWebServiceAsync(1, callback);
+
+        while (!future.isDone()) {
+            Thread.sleep(1000);
+            TestLogger.logger.debug("Async invocation incomplete");
+        }
+
+        e = callback.getException();
+        e.printStackTrace();
+
+        // Section 4.3.3 states that the top level Exception should be
+        // an ExecutionException, with a WebServiceException underneath.
+        assertNotNull("The exception was null.", e);
+        assertTrue("The thrown exception should be an ExecutionException.", 
+                   e.getClass().equals(ExecutionException.class));
+        assertTrue("The expected fault type under the ExecutionException should be a " +
+                   "FaultyWebServiceFault_Exception.  Found type: " + e.getCause().getClass(), 
+                   e.getCause().getClass().isAssignableFrom(FaultyWebServiceFault_Exception.class));
     }
 
 

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleByteArrayTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleByteArrayTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleByteArrayTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleByteArrayTests.java Fri May  2 19:23:18 2008
@@ -54,7 +54,7 @@
      * -- setMTOMEnabled([true|false])
      * Using SOAP11
      */
-    public void testAttachmentByteArrayAPI11() throws Exception {
+    public void _testAttachmentByteArrayAPI11() throws Exception {
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
     	
@@ -84,6 +84,13 @@
       	assertNotNull(response);
         assertNotNull(response.getOutput().getImageData());
         checkText(response.getOutput());
+        
+        // Repeat to verify behavior
+        response = (SendImageResponse) dispatch.invoke(request);
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        checkText(response.getOutput());
     }
     
     /*
@@ -121,6 +128,13 @@
         assertNotNull(response);
         assertNotNull(response.getOutput().getImageData());
         checkText(response.getOutput());
+        
+        // Repeat to verify behavior
+        response = (SendImageResponse) dispatch.invoke(request);
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        checkText(response.getOutput());
     }
     
     /*
@@ -128,6 +142,7 @@
      * property for MTOM.
      */
     public void testAttachmentByteArrayProperty11() throws Exception {
+        
         TestLogger.logger.debug("----------------------------------");
         TestLogger.logger.debug("test: " + getName());
     	
@@ -155,6 +170,13 @@
         assertNotNull(response.getOutput().getImageData());
         checkText(response.getOutput());
         
+        // Repeat to verify behavior
+        response = (SendImageResponse) dispatch.invoke(request);
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        checkText(response.getOutput());
+        
     }
     
     private static final String text = "Binary Attachments are radical";

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java Fri May  2 19:23:18 2008
@@ -122,6 +122,12 @@
         
         assertNotNull(response);
         assertNotNull(response.getOutput().getImageData());
+        
+        // Repeat to verify behavior
+        response = (SendImageResponse) dispatch.invoke(request);
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
     }
     
     /*
@@ -180,6 +186,27 @@
         
         int numCIDs = (cids == null) ? 0 : cids.size();
         assertTrue("Expected one attachment but there were:" + numCIDs, numCIDs == 1);
+        
+        // Repeat to verify behavior
+        response = null;
+        try {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(true);
+            response = (SendImageResponse) dispatch.invoke(request);
+            
+            // The cids are collected in the monitor.  We will check
+            // this to make sure the response mtom is not inlined
+            cids = JAXBAttachmentUnmarshallerMonitor.getBlobCIDs();
+        } finally {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(false);
+        }
+        
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        
+        
+        numCIDs = (cids == null) ? 0 : cids.size();
+        assertTrue("Expected one attachment but there were:" + numCIDs, numCIDs == 1);
     }
     
     /*
@@ -237,6 +264,28 @@
         
         int numCIDs = (cids == null) ? 0 : cids.size();
         assertTrue("Expected zero attachments but there were:" + numCIDs, numCIDs == 0);
+        
+        
+        // Repeat to verify behavior
+        response = null;
+        try {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(true);
+            response = (SendImageResponse) dispatch.invoke(request);
+            
+            // The cids are collected in the monitor.  We will check
+            // this to make sure the response mtom is not inlined
+            cids = JAXBAttachmentUnmarshallerMonitor.getBlobCIDs();
+        } finally {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(false);
+        }
+        
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        
+        
+        numCIDs = (cids == null) ? 0 : cids.size();
+        assertTrue("Expected zero attachments but there were:" + numCIDs, numCIDs == 0);
     }
     
     /*
@@ -295,6 +344,28 @@
         
         int numCIDs = (cids == null) ? 0 : cids.size();
         assertTrue("Expected zero attachments but there were:" + numCIDs, numCIDs == 0);
+        
+        
+        // Repeat to verify behavior
+        response = null;
+        try {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(true);
+            response = (SendImageResponse) dispatch.invoke(request);
+            
+            // The cids are collected in the monitor.  We will check
+            // this to make sure the response mtom is not inlined
+            cids = JAXBAttachmentUnmarshallerMonitor.getBlobCIDs();
+        } finally {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(false);
+        }
+        
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        
+        
+        numCIDs = (cids == null) ? 0 : cids.size();
+        assertTrue("Expected zero attachments but there were:" + numCIDs, numCIDs == 0);
     }
     
     /*
@@ -352,6 +423,27 @@
         
         int numCIDs = (cids == null) ? 0 : cids.size();
         assertTrue("Expected one attachment but there were:" + numCIDs, numCIDs == 1);
+        
+        // Repeat to verify behavior
+        response = null;
+        try {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(true);
+            response = (SendImageResponse) dispatch.invoke(request);
+            
+            // The cids are collected in the monitor.  We will check
+            // this to make sure the response mtom is not inlined
+            cids = JAXBAttachmentUnmarshallerMonitor.getBlobCIDs();
+        } finally {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(false);
+        }
+        
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        
+        
+        numCIDs = (cids == null) ? 0 : cids.size();
+        assertTrue("Expected one attachment but there were:" + numCIDs, numCIDs == 1);
     }
     
     /*
@@ -409,6 +501,28 @@
         
         int numCIDs = (cids == null) ? 0 : cids.size();
         assertTrue("Expected one attachment but there were:" + numCIDs, numCIDs == 1);
+        
+        
+        // Repeat to verify behavior
+        response = null;
+        try {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(true);
+            response = (SendImageResponse) dispatch.invoke(request);
+            
+            // The cids are collected in the monitor.  We will check
+            // this to make sure the response mtom is not inlined
+            cids = JAXBAttachmentUnmarshallerMonitor.getBlobCIDs();
+        } finally {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(false);
+        }
+        
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        
+        
+        numCIDs = (cids == null) ? 0 : cids.size();
+        assertTrue("Expected one attachment but there were:" + numCIDs, numCIDs == 1);
     }
     
     /*
@@ -450,6 +564,12 @@
         
         assertNotNull(response);
         assertNotNull(response.getOutput().getImageData());
+        
+        // Repeat to verify behavior
+        response = (SendImageResponse) dispatch.invoke(request);
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
     }
     
     /*
@@ -496,6 +616,12 @@
         
         assertNotNull(response);
         assertNotNull(response.getOutput().getImageData());
+        
+        // Repeat to verify behavior
+        response = (SendImageResponse) dispatch.invoke(request);
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
     }
     
     /*
@@ -559,8 +685,30 @@
             }
         }
         
-        //assertNotNull(response);
-        //assertNotNull(response.getOutput().getImageData());
+        // Repeat to verify behavior
+        try {
+            SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
+            fail("Was expecting an exception due to sending SOAP12 message to SOAP11 endpoint.");
+        } catch (Exception e) {
+            assertNotNull(e);
+            if (CHECK_VERSIONMISMATCH) {
+                assertTrue("Expected SOAPFaultException, but received: "+ e.getClass(),
+                           e instanceof SOAPFaultException);
+                SOAPFaultException sfe = (SOAPFaultException) e;
+
+                SOAPFault fault = sfe.getFault();
+
+                assertTrue("SOAPFault is null ",
+                           fault != null);
+                QName faultCode = sfe.getFault().getFaultCodeAsQName();
+
+
+                assertTrue("Expected VERSION MISMATCH but received: "+ faultCode,
+                           new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "VersionMismatch", SOAPConstants.SOAP_ENV_PREFIX).equals(faultCode));
+
+            }
+        }
+        
         
 
 	}
@@ -630,10 +778,31 @@
 
             }
         }
-        /*
-        assertNotNull(response);
-        assertNotNull(response.getOutput().getImageData());
-        */
+        
+        // Repeat to verify behavior
+        try {
+            SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
+            fail("Was expecting an exception due to sending SOAP12 message to SOAP11 endpoint.");
+        } catch (Exception e) {
+            assertNotNull(e);
+            if (CHECK_VERSIONMISMATCH) {
+                assertTrue("Expected SOAPFaultException, but received: "+ e.getClass(),
+                           e instanceof SOAPFaultException);
+                SOAPFaultException sfe = (SOAPFaultException) e;
+
+                SOAPFault fault = sfe.getFault();
+
+                assertTrue("SOAPFault is null ",
+                           fault != null);
+                QName faultCode = sfe.getFault().getFaultCodeAsQName();
+
+
+                assertTrue("Expected VERSION MISMATCH but received: "+ faultCode,
+                          new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "VersionMismatch", SOAPConstants.SOAP_ENV_PREFIX).equals(faultCode));
+
+            }
+        }
+       
     }
     /*
      * Enable attachment Optimization but call an endpoint with @MTOM(enable=true, Threshold = 99000)
@@ -691,6 +860,27 @@
         //There shold be no cid as attachment should be inlined.
         int numCIDs = (cids == null) ? 0 : cids.size();
         assertTrue("Expected one attachment inlined:" + numCIDs, numCIDs == 0);
+        
+        // Repeat to verify behavior
+        response = null;
+        try {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(true);
+            response = (SendImageResponse) dispatch.invoke(request);
+            
+            // The cids are collected in the monitor.  We will check
+            // this to make sure the response mtom is not inlined
+            cids = JAXBAttachmentUnmarshallerMonitor.getBlobCIDs();
+        } finally {
+            JAXBAttachmentUnmarshallerMonitor.setMonitoring(false);
+        }
+        
+        
+        assertNotNull(response);
+        assertNotNull(response.getOutput().getImageData());
+        
+        //There shold be no cid as attachment should be inlined.
+        numCIDs = (cids == null) ? 0 : cids.size();
+        assertTrue("Expected one attachment inlined:" + numCIDs, numCIDs == 0);
     }
     
 }

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/NonWrapTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/NonWrapTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/NonWrapTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/NonWrapTests.java Fri May  2 19:23:18 2008
@@ -46,26 +46,30 @@
         return getTestSetup(new TestSuite(NonWrapTests.class));
     }
 	
-	public void testTwoWaySync(){
+    public void testTwoWaySync(){
         TestLogger.logger.debug("------------------------------");
         TestLogger.logger.debug("Test : " + getName());
-		try{
-			TwoWay twoWay = new ObjectFactory().createTwoWay();
-			twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
-			DocLitNonWrapService service = new DocLitNonWrapService();
-			DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
-			
-			BindingProvider p =	(BindingProvider)proxy;
-			p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
-			
-			ReturnType returnValue = proxy.twoWay(twoWay);
+        try{
+            TwoWay twoWay = new ObjectFactory().createTwoWay();
+            twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
+            DocLitNonWrapService service = new DocLitNonWrapService();
+            DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
+
+            BindingProvider p =	(BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+
+            ReturnType returnValue = proxy.twoWay(twoWay);
+            TestLogger.logger.debug(returnValue.getReturnStr());
+            
+            // Repeat to verify behavior
+            returnValue = proxy.twoWay(twoWay);
             TestLogger.logger.debug(returnValue.getReturnStr());
             TestLogger.logger.debug("------------------------------");
-		}catch(Exception e){
-			e.printStackTrace();
-			fail();
-		}
-	}
+        }catch(Exception e){
+            e.printStackTrace();
+            fail();
+        }
+    }
     
     public void _testTwoWaySyncNull() throws Exception{
         TestLogger.logger.debug("------------------------------");
@@ -80,6 +84,9 @@
             
             ReturnType returnValue = proxy.twoWay(twoWay);
             
+            // Repeat to verify behavior
+            returnValue = proxy.twoWay(twoWay);
+            
             // TODO Revisit JAXB validation
             // JAXWS does not make the decision of whether a
             // null parameter can be marshalled.  This decision is
@@ -98,82 +105,102 @@
         }
     }
 
-	public void testTwoWayASyncCallback(){
+    public void testTwoWayASyncCallback(){
         TestLogger.logger.debug("------------------------------");
         TestLogger.logger.debug("Test : " + getName());
-		try{
-			TwoWay twoWay = new ObjectFactory().createTwoWay();
-			twoWay.setTwowayStr("testing Async call for java bean non wrap endpoint");
-			DocLitNonWrapService service = new DocLitNonWrapService();
-			DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
-			
-			BindingProvider p =	(BindingProvider)proxy;
-			p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
-			
-			AsyncCallback callback = new AsyncCallback();
-			Future<?> monitor = proxy.twoWayAsync(twoWay, callback);
-			assertNotNull(monitor);
+        try{
+            TwoWay twoWay = new ObjectFactory().createTwoWay();
+            twoWay.setTwowayStr("testing Async call for java bean non wrap endpoint");
+            DocLitNonWrapService service = new DocLitNonWrapService();
+            DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
+
+            BindingProvider p =	(BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+
+            AsyncCallback callback = new AsyncCallback();
+            Future<?> monitor = proxy.twoWayAsync(twoWay, callback);
+            assertNotNull(monitor);
+            
+            // Repeat to verify behavior
+            callback = new AsyncCallback();
+            monitor = proxy.twoWayAsync(twoWay, callback);
+            assertNotNull(monitor);
             TestLogger.logger.debug("------------------------------");
-		}catch(Exception e){
-			e.printStackTrace();
-			fail();
-		}
-	}
-	public void testTwoWayHolder(){
+        }catch(Exception e){
+            e.printStackTrace();
+            fail();
+        }
+    }
+    
+    public void testTwoWayHolder(){
         TestLogger.logger.debug("------------------------------");
         TestLogger.logger.debug("Test : " + getName());
-		try{
-			TwoWayHolder twh = new TwoWayHolder();
-			twh.setTwoWayHolderInt(new Integer(0));
-			twh.setTwoWayHolderStr(new String("Request Holder String"));
-			Holder<TwoWayHolder> holder = new Holder<TwoWayHolder>(twh);
-			TwoWay twoWay = new ObjectFactory().createTwoWay();
-			twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
-			DocLitNonWrapService service = new DocLitNonWrapService();
-			DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
-			
-			BindingProvider p =	(BindingProvider)proxy;
-			p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
-			
-			proxy.twoWayHolder(holder);
-			twh = holder.value;
+        try{
+            TwoWayHolder twh = new TwoWayHolder();
+            twh.setTwoWayHolderInt(new Integer(0));
+            twh.setTwoWayHolderStr(new String("Request Holder String"));
+            Holder<TwoWayHolder> holder = new Holder<TwoWayHolder>(twh);
+            TwoWay twoWay = new ObjectFactory().createTwoWay();
+            twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
+            DocLitNonWrapService service = new DocLitNonWrapService();
+            DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
+
+            BindingProvider p =	(BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+
+            proxy.twoWayHolder(holder);
+            twh = holder.value;
+            TestLogger.logger.debug("Holder string =" + twh.getTwoWayHolderStr());
+            TestLogger.logger.debug("Holder int =" + twh.getTwoWayHolderInt());
+            
+            // Repeat to verify behavior
+            proxy.twoWayHolder(holder);
+            twh = holder.value;
             TestLogger.logger.debug("Holder string =" + twh.getTwoWayHolderStr());
             TestLogger.logger.debug("Holder int =" + twh.getTwoWayHolderInt());
 
             TestLogger.logger.debug("------------------------------");
-		}catch(Exception e){
-			e.printStackTrace();
-			fail();
-		}
-	}
+        }catch(Exception e){
+            e.printStackTrace();
+            fail();
+        }
+    }
 	
-	public void testTwoWayHolderAsync(){
+    public void testTwoWayHolderAsync(){
         TestLogger.logger.debug("------------------------------");
         TestLogger.logger.debug("Test : " + getName());
-		try{
-			TwoWayHolder twh = new TwoWayHolder();
-			twh.setTwoWayHolderInt(new Integer(0));
-			twh.setTwoWayHolderStr(new String("Request Holder String"));
-			Holder<TwoWayHolder> holder = new Holder<TwoWayHolder>(twh);
-			TwoWay twoWay = new ObjectFactory().createTwoWay();
-			twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
-			DocLitNonWrapService service = new DocLitNonWrapService();
-			DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
-			
-			BindingProvider p =	(BindingProvider)proxy;
-			p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
-			
-			AsyncCallback callback = new AsyncCallback();
-			Future<?> monitor =proxy.twoWayHolderAsync(twh, callback);
-			while(!monitor.isDone()){
-				Thread.sleep(1000);
-			}
-			assertNotNull(monitor);
+        try{
+            TwoWayHolder twh = new TwoWayHolder();
+            twh.setTwoWayHolderInt(new Integer(0));
+            twh.setTwoWayHolderStr(new String("Request Holder String"));
+            Holder<TwoWayHolder> holder = new Holder<TwoWayHolder>(twh);
+            TwoWay twoWay = new ObjectFactory().createTwoWay();
+            twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
+            DocLitNonWrapService service = new DocLitNonWrapService();
+            DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
+
+            BindingProvider p =	(BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+
+            AsyncCallback callback = new AsyncCallback();
+            Future<?> monitor =proxy.twoWayHolderAsync(twh, callback);
+            while(!monitor.isDone()){
+                Thread.sleep(1000);
+            }
+            assertNotNull(monitor);
+            
+            // Repeat to verify behavior
+            callback = new AsyncCallback();
+            monitor =proxy.twoWayHolderAsync(twh, callback);
+            while(!monitor.isDone()){
+                Thread.sleep(1000);
+            }
+            assertNotNull(monitor);
 
             TestLogger.logger.debug("------------------------------");
-		}catch(Exception e){
-			e.printStackTrace();
-			fail();
-		}
-	}
+        }catch(Exception e){
+            e.printStackTrace();
+            fail();
+        }
+    }
 }

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java Fri May  2 19:23:18 2008
@@ -53,6 +53,12 @@
             assertTrue("The response was null", response != null);
             assertTrue("The response was not succesful: " + response, 
                        response.indexOf("SUCCESS") >= 0);
+            
+            // Repeat to verify behavior
+            response = proxy.testInjection("sample");
+            assertTrue("The response was null", response != null);
+            assertTrue("The response was not succesful: " + response, 
+                       response.indexOf("SUCCESS") >= 0);
         
     }
    

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java Fri May  2 19:23:18 2008
@@ -53,5 +53,13 @@
         for (int i = 0; i < expected.length; i++) {
             assertEquals(expected[i], retString[i]);
         }
+        
+        // Repeat to ensure validity
+        retString = portType.stringList(send);
+        assertNotNull(retString);
+        assertEquals(expected.length, retString.length);
+        for (int i = 0; i < expected.length; i++) {
+            assertEquals(expected[i], retString[i]);
+        }
     }
 }

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WSGenTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WSGenTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WSGenTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WSGenTests.java Fri May  2 19:23:18 2008
@@ -54,6 +54,12 @@
 
             TestLogger.logger.debug("String s = " + s);
             assertEquals(outString, s);
+            
+            // Repeat to ensure validity
+            s = proxy.echoString(outString);
+
+            TestLogger.logger.debug("String s = " + s);
+            assertEquals(outString, s);
             TestLogger.logger.debug("----------------------------------");
         } catch(Exception e) {
             e.printStackTrace();

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WrapTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WrapTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WrapTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/WrapTests.java Fri May  2 19:23:18 2008
@@ -85,6 +85,9 @@
                 DocLitWrapService service = new DocLitWrapService();
                 DocLitWrap proxy = getProxy();
                 proxy.oneWayVoid();
+                
+                // Repeat to ensure correct behavior
+                proxy.oneWayVoid();
 
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
@@ -105,6 +108,11 @@
                 proxy.twoWayHolder(strHolder, intHolder);
                 TestLogger.logger.debug("Holder Response String =" + strHolder.value);;
                 TestLogger.logger.debug("Holder Response Integer =" + intHolder.value);
+                
+                // Repeat to ensure correct behavior
+                proxy.twoWayHolder(strHolder, intHolder);
+                TestLogger.logger.debug("Holder Response String =" + strHolder.value);;
+                TestLogger.logger.debug("Holder Response Integer =" + intHolder.value);
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -128,6 +136,12 @@
                 hp0=holder.value;
                 TestLogger.logger.debug("Holder Response String =" + hp0.getHeaderType());
                 TestLogger.logger.debug("Header Response Long =" + hr.getOut());
+                
+                // Repeat to ensure correct behavior
+                hr = proxy.header(header, holder, hp1);
+                hp0=holder.value;
+                TestLogger.logger.debug("Holder Response String =" + hp0.getHeaderType());
+                TestLogger.logger.debug("Header Response Long =" + hr.getOut());
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -147,6 +161,11 @@
                 proxy.twoWayHolder(strHolder, intHolder);
                 TestLogger.logger.debug("Holder Response String =" + strHolder.value);;
                 TestLogger.logger.debug("Holder Response Integer =" + intHolder.value);
+                
+                // Repeat 
+                proxy.twoWayHolder(strHolder, intHolder);
+                TestLogger.logger.debug("Holder Response String =" + strHolder.value);;
+                TestLogger.logger.debug("Holder Response Integer =" + intHolder.value);
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -166,6 +185,10 @@
                 DocLitWrap proxy = getProxy();
                 String response = proxy.echoStringWSGEN1(request);
                 assertTrue(response.equals(request));
+                
+                // Repeat
+                response = proxy.echoStringWSGEN1(request);
+                assertTrue(response.equals(request));
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -187,6 +210,10 @@
                 DocLitWrap proxy = getProxy();
                 String response = proxy.echoStringWSGEN1(request);
                 assertTrue(response.equals(request));
+                
+                // Repeat
+                response = proxy.echoStringWSGEN1(request);
+                assertTrue(response.equals(request));
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -209,6 +236,10 @@
                 DocLitWrap proxy = getProxy();
                 String response = proxy.echoStringWSGEN2(request);
                 assertTrue(response.equals(request));
+                
+                // Repeat
+                response = proxy.echoStringWSGEN2(request);
+                assertTrue(response.equals(request));
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -228,6 +259,10 @@
                 DocLitWrap proxy = getProxy();
                 String response = proxy.echoStringWSGEN1(request);
                 assertTrue(response.equals(request));
+                
+                // Repeat
+                response = proxy.echoStringWSGEN1(request);
+                assertTrue(response.equals(request));
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -249,6 +284,10 @@
                 DocLitWrap proxy = getProxy();
                 String response = proxy.echoStringWSGEN1(request);
                 assertTrue(response.equals(request));
+                
+                // Repeat
+                response = proxy.echoStringWSGEN1(request);
+                assertTrue(response.equals(request));
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();
@@ -271,6 +310,10 @@
                 DocLitWrap proxy = getProxy();
                 String response = proxy.echoStringWSGEN2(request);
                 assertTrue(response.equals(request));
+                
+                // Repeat
+                response = proxy.echoStringWSGEN2(request);
+                assertTrue(response.equals(request));
                 TestLogger.logger.debug("------------------------------");
             }catch(Exception e){
                 e.printStackTrace();

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/BasicAuthSecurityTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/BasicAuthSecurityTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/BasicAuthSecurityTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/security/BasicAuthSecurityTests.java Fri May  2 19:23:18 2008
@@ -58,6 +58,12 @@
         TestLogger.logger.debug(">> Response [" + retVal + "]");
         
         assertTrue(retVal != null);
+        
+        // Invoke a second time to verify
+        retVal = dispatch.invoke(xmlString);
+        TestLogger.logger.debug(">> Response [" + retVal + "]");
+        
+        assertTrue(retVal != null);
     }
     
     public void testBasicAuth_uid_pwd() throws Exception {
@@ -76,6 +82,13 @@
         TestLogger.logger.debug(">> Response [" + retVal + "]");
         
         assertTrue(retVal != null);
+        
+        // Invoke a second time to verify
+        TestLogger.logger.debug(">> Invoking Dispatch<String> BasicAuthSecurityService");
+        retVal = dispatch.invoke(xmlString);
+        TestLogger.logger.debug(">> Response [" + retVal + "]");
+        
+        assertTrue(retVal != null);
     }
     
     public void testBasicAuth_uid()throws Exception{
@@ -91,6 +104,11 @@
         TestLogger.logger.debug(">> Invoking Dispatch<String> BasicAuthSecurityService");
         String retVal = dispatch.invoke(xmlString);
        	TestLogger.logger.debug(">> Response [" + retVal + "]");
+        
+        // Invoke a second time to verify
+        TestLogger.logger.debug(">> Invoking Dispatch<String> BasicAuthSecurityService");
+        retVal = dispatch.invoke(xmlString);
+        TestLogger.logger.debug(">> Response [" + retVal + "]");
     }
     
     public void testBasicAuth_pwd()throws Exception{
@@ -98,17 +116,30 @@
         TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch(Service.Mode.PAYLOAD,
-        		                                endpointUrl,
-        		                                SOAPBinding.SOAP11HTTP_BINDING);
-        
-		dispatch.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, PASSWORD);
+                                                endpointUrl,
+                                                SOAPBinding.SOAP11HTTP_BINDING);
+
+        dispatch.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, PASSWORD);
 
         TestLogger.logger.debug(">> Invoking Dispatch<String> BasicAuthSecurityService");
+
+        try{
+            String retVal = dispatch.invoke(xmlString);
+            TestLogger.logger.debug(">> Response [" + retVal + "]");
+
+            fail("Set PASSWORD with no USERID: WebServiceException is expected");
+        }
+        catch(WebServiceException wse){
+            TestLogger.logger.debug(getName() + ": " + wse);
+        }
         
+        // Try a second time to verify
+        TestLogger.logger.debug(">> Invoking Dispatch<String> BasicAuthSecurityService");
+
         try{
-        	String retVal = dispatch.invoke(xmlString);
+            String retVal = dispatch.invoke(xmlString);
             TestLogger.logger.debug(">> Response [" + retVal + "]");
-            
+
             fail("Set PASSWORD with no USERID: WebServiceException is expected");
         }
         catch(WebServiceException wse){

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/swamtom/SWAMTOMTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/swamtom/SWAMTOMTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/swamtom/SWAMTOMTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/swamtom/SWAMTOMTests.java Fri May  2 19:23:18 2008
@@ -144,6 +144,42 @@
         if (bytes[0] != 'S' || bytes[1] != 'W' || bytes[2] != 'A') { 
             fail("Did not receive a modified attachment"); 
         }
+        
+        
+        // Invoke a second time to verify
+
+        // invoke
+        reply = dispatch.invoke(request);
+
+        // iterate over the attachments, there should only be one
+        it = reply.getAttachments();
+        ap = null;
+
+        // verify that the attachment is not null or empty
+        if ((ap = (AttachmentPart) it.next()) == null){
+            fail("Attachment is null");
+        }
+        
+
+        // verify that the attachment is not null or empty
+        if (it.hasNext()){
+            fail("Detected more then 1 attachment");
+        }
+
+        sb = reply.getSOAPBody();
+        if (sb.getChildElements().hasNext()) {
+            fail("Message contains soap:body payload");
+        }
+
+        bytes = ap.getRawContentBytes();
+        if (bytes.length == 0) { 
+            fail("Attachment is empty"); 
+        }
+
+        // verify that endpoint has been able to modify the attachment
+        if (bytes[0] != 'S' || bytes[1] != 'W' || bytes[2] != 'A') { 
+            fail("Did not receive a modified attachment"); 
+        }
     }
     
     /**
@@ -229,6 +265,45 @@
         if (bytes[0] != 'S' || bytes[1] != 'W' || bytes[2] != 'A') { 
             fail("Did not receive a modified attachment"); 
         }
+        
+        // Invoke a second time to verify
+
+        // invoke
+        reply = dispatch.invoke(request);
+
+        // iterate over the attachments, there should only be one
+        it = reply.getAttachments();
+        ap = null;
+
+        // verify that the attachment is not null or empty
+        if ((ap = (AttachmentPart) it.next()) == null){
+            fail("Attachment is null");
+        }
+        
+        // Make sure the content id starts with the appropriate SWA name
+        if (!ap.getContentId().startsWith("jpegImageResponse=")) {
+            fail("Expected content id to start with jpegImageResponse");
+        }
+
+        // verify that the attachment is not null or empty
+        if (it.hasNext()){
+            fail("Detected more then 1 attachment");
+        }
+
+        sb = reply.getSOAPBody();
+        if (sb.getChildElements().hasNext()) {
+            fail("Message contains soap:body payload");
+        }
+
+        bytes = ap.getRawContentBytes();
+        if (bytes.length == 0) { 
+            fail("Attachment is empty"); 
+        }
+
+        // verify that endpoint has been able to modify the attachment
+        if (bytes[0] != 'S' || bytes[1] != 'W' || bytes[2] != 'A') { 
+            fail("Did not receive a modified attachment"); 
+        }
     }
     
     /**
@@ -322,6 +397,60 @@
         if (bytes4[0] != '4') { 
             fail("The response attachment is not correct"); 
         }
+        
+        
+        // Invoke a second time to verify
+        reply = dispatch.invoke(request);
+
+        // iterate over the attachments, there should only be one
+        it = reply.getAttachments();
+        ap3 = null;
+
+        // verify that the attachment is not null or empty
+        if ((ap3 = (AttachmentPart) it.next()) == null){
+            fail("Attachment is null");
+        }
+        
+        // Make sure the content id starts with the appropriate SWA name
+        if (!ap3.getContentId().startsWith("jpegImage1Response=")) {
+            fail("Expected content id to start with jpegImage1Response");
+        }
+        
+        ap4 = null;
+        // verify that the second attachment is not null or empty
+        if ((ap4 = (AttachmentPart) it.next()) == null){
+            fail("Attachment is null");
+        }
+        
+        // Make sure the content id starts with the appropriate SWA name
+        if (!ap4.getContentId().startsWith("jpegImage2Response=")) {
+            fail("Expected content id to start with jpegImage2Response");
+        }
+
+        if (it.hasNext()){
+            fail("Detected more then 2 attachment");
+        }
+
+        sb = reply.getSOAPBody();
+        if (sb.getChildElements().hasNext()) {
+            fail("Message contains soap:body payload");
+        }
+
+        bytes3 = ap3.getRawContentBytes();
+        if (bytes3.length == 0) { 
+            fail("Attachment is empty"); 
+        }
+        if (bytes3[0] != '3') { 
+            fail("The response attachment is not correct"); 
+        }
+        
+        bytes4 = ap4.getRawContentBytes();
+        if (bytes4.length == 0) { 
+            fail("Attachment is empty"); 
+        }
+        if (bytes4[0] != '4') { 
+            fail("The response attachment is not correct"); 
+        }
     }
     
     /**
@@ -416,6 +545,61 @@
         if (bytes4[0] != '4') { 
             fail("The response attachment is not correct"); 
         }
+        
+        // Invoke a second time to verify
+        
+        // invoke
+        reply = dispatch.invoke(request);
+
+        // iterate over the attachments, there should only be one
+        it = reply.getAttachments();
+        ap3 = null;
+
+        // verify that the attachment is not null or empty
+        if ((ap3 = (AttachmentPart) it.next()) == null){
+            fail("Attachment is null");
+        }
+        
+        // Make sure the content id starts with the appropriate SWA name
+        if (!ap3.getContentId().startsWith("jpegImage1Response=")) {
+            fail("Expected content id to start with jpegImage1Response");
+        }
+        
+        ap4 = null;
+        // verify that the second attachment is not null or empty
+        if ((ap4 = (AttachmentPart) it.next()) == null){
+            fail("Attachment is null");
+        }
+        
+        // Make sure the content id starts with the appropriate SWA name
+        if (!ap4.getContentId().startsWith("jpegImage2Response=")) {
+            fail("Expected content id to start with jpegImage2Response");
+        }
+
+        if (it.hasNext()){
+            fail("Detected more then 2 attachment");
+        }
+
+        sb = reply.getSOAPBody();
+        if (sb.getChildElements().hasNext()) {
+            fail("Message contains soap:body payload");
+        }
+
+        bytes3 = ap3.getRawContentBytes();
+        if (bytes3.length == 0) { 
+            fail("Attachment is empty"); 
+        }
+        if (bytes3[0] != '3') { 
+            fail("The response attachment is not correct"); 
+        }
+        
+        bytes4 = ap4.getRawContentBytes();
+        if (bytes4.length == 0) { 
+            fail("Attachment is empty"); 
+        }
+        if (bytes4[0] != '4') { 
+            fail("The response attachment is not correct"); 
+        }
     }
     // TODO:  Add similar code to invoke the mtom enabled operation
 }
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/jaxb/DispatchXPayloadJAXBTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/jaxb/DispatchXPayloadJAXBTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/jaxb/DispatchXPayloadJAXBTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/jaxb/DispatchXPayloadJAXBTests.java Fri May  2 19:23:18 2008
@@ -69,12 +69,26 @@
        request.setInput("SYNC JAXB XML PAYLOAD TEST");
        
        // Invoke the Dispatch<Object>
-        TestLogger.logger.debug(">> Invoking sync Dispatch with JAX-B Parameter");
+       TestLogger.logger.debug(">> Invoking sync Dispatch with JAX-B Parameter");
        EchoString response = (EchoString) dispatch.invoke(request);
        
        assertNotNull(response);
 
-        TestLogger.logger.debug(">> Response content: " + response.getInput());
+       TestLogger.logger.debug(">> Response content: " + response.getInput());
+       
+       assertTrue("[ERROR] - Response object was null", response != null);
+       assertTrue("[ERROR] - No content in response object", response.getInput() != null);
+       assertTrue("[ERROR] - Zero length content in response", response.getInput().length() > 0);
+       assertTrue(response.getInput().equals(request.getInput()));
+       
+       // Test a second time to verify
+       // Invoke the Dispatch<Object>
+       TestLogger.logger.debug(">> Invoking sync Dispatch with JAX-B Parameter");
+       response = (EchoString) dispatch.invoke(request);
+       
+       assertNotNull(response);
+
+       TestLogger.logger.debug(">> Response content: " + response.getInput());
        
        assertTrue("[ERROR] - Response object was null", response != null);
        assertTrue("[ERROR] - No content in response object", response.getInput() != null);

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXMessageSourceTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXMessageSourceTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXMessageSourceTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXMessageSourceTests.java Fri May  2 19:23:18 2008
@@ -78,6 +78,20 @@
         
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Test a second time to verify
+        stream = new ByteArrayInputStream(request.getBytes());
+        inSource = new StreamSource((InputStream) stream);
+        
+        outSource = dispatch.invoke(inSource);
+        
+        // Prepare the response content for checking
+        reader = inputFactory.createXMLStreamReader(outSource);
+        r2w = new Reader2Writer(reader);
+        response = r2w.getAsString();
+        
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
    

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXPayloadSourceTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXPayloadSourceTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXPayloadSourceTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/source/DispatchXPayloadSourceTests.java Fri May  2 19:23:18 2008
@@ -78,6 +78,20 @@
         
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try a second time to verify
+        stream = new ByteArrayInputStream(request.getBytes());
+        inSource = new StreamSource((InputStream) stream);
+        
+        outSource = dispatch.invoke(inSource);
+        
+        // Prepare the response content for checking
+        reader = inputFactory.createXMLStreamReader(outSource);
+        r2w = new Reader2Writer(reader);
+        response = r2w.getAsString();
+        
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
    

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXMessageStringTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXMessageStringTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXMessageStringTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXMessageStringTests.java Fri May  2 19:23:18 2008
@@ -63,6 +63,12 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try a second time
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
     /**
@@ -77,6 +83,13 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
     /**
@@ -91,6 +104,13 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
     /**
@@ -105,6 +125,13 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
 }
 

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXPayloadStringTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXPayloadStringTests.java?rev=652968&r1=652967&r2=652968&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXPayloadStringTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/xmlhttp/clientTests/dispatch/string/DispatchXPayloadStringTests.java Fri May  2 19:23:18 2008
@@ -63,6 +63,13 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
     /**
@@ -77,6 +84,13 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
     /**
@@ -91,6 +105,13 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
     
     /**
@@ -105,5 +126,12 @@
         TestLogger.logger.debug("Response = " + response);
         assertTrue(response != null);
         assertTrue(request.equals(response));
+        
+        // Try again to verify
+        TestLogger.logger.debug("Request  = " + request);
+        response = dispatch.invoke(request);
+        TestLogger.logger.debug("Response = " + response);
+        assertTrue(response != null);
+        assertTrue(request.equals(response));
     }
 }



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