axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r532615 [8/13] - in /webservices/axis2/branches/java/1_2/modules: jaxws-api/src/javax/xml/ws/handler/soap/ jaxws-api/src/javax/xml/ws/soap/ jaxws/ jaxws/src/org/apache/axis2/jaxws/ jaxws/src/org/apache/axis2/jaxws/binding/ jaxws/src/org/apa...
Date Thu, 26 Apr 2007 05:19:33 GMT
Added: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/handler/context/LogicalMessageContextTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/handler/context/LogicalMessageContextTests.java?view=auto&rev=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/handler/context/LogicalMessageContextTests.java (added)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/handler/context/LogicalMessageContextTests.java Wed Apr 25 22:19:23 2007
@@ -0,0 +1,267 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.handler.context;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.LogicalMessage;
+import javax.xml.ws.handler.LogicalMessageContext;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.jaxws.context.factory.MessageContextFactory;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.message.Block;
+import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.message.Protocol;
+import org.apache.axis2.jaxws.message.XMLFault;
+import org.apache.axis2.jaxws.message.XMLFaultCode;
+import org.apache.axis2.jaxws.message.XMLFaultReason;
+import org.apache.axis2.jaxws.message.databinding.JAXBBlockContext;
+import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
+import org.apache.axis2.jaxws.message.factory.MessageFactory;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
+
+import test.EchoString;
+import test.ObjectFactory;
+
+/**
+ * Unit tests for the creation and usage of the LogicalMessageContext that is
+ * used for handler processing.
+ */
+public class LogicalMessageContextTests extends TestCase {
+    
+    private final String INPUT = "sample input";
+    private final String FAULT_INPUT = "sample fault input";
+    
+    public LogicalMessageContextTests(String name) {
+        super(name);
+    }
+    
+    /**
+     * Test the javax.xml.transform.Source based APIs on the LogicalMessage interface.
+     * @throws Exception
+     */
+    public void testGetPayloadAsSource() throws Exception {
+        LogicalMessageContext lmc = createSampleContext();
+        
+        LogicalMessage msg = lmc.getMessage();
+        assertTrue("The returned LogicalMessage was null", msg != null);
+        
+        Source payload = msg.getPayload();
+        assertTrue("The returned payload (Source) was null", payload != null);
+        
+        String resultContent = _getStringFromSource(payload);
+        assertTrue("The content returned was null", resultContent != null);
+        assertTrue("The content returned was incomplete, unexpected element", resultContent.indexOf("echoString") > -1);
+        assertTrue("The content returned was incomplete, unexpected content", resultContent.indexOf(INPUT) > -1);
+    }
+    
+    /**
+     * Tests the setting of the payload and make sure we don't cache improperly.
+     * @throws Exception
+     */
+    public void testGetAndSetPayloadAsSource() throws Exception {
+        LogicalMessageContext lmc = createSampleContext();
+        
+        LogicalMessage msg = lmc.getMessage();
+        assertTrue("The returned LogicalMessage was null", msg != null);
+        
+        Source payload = msg.getPayload();
+        assertTrue("The returned payload (Source) was null", payload != null);
+        
+        String resultContent = _getStringFromSource(payload);
+        assertTrue("The content returned was null", resultContent != null);
+        assertTrue("The content returned was incorrect", resultContent.indexOf(INPUT) > 0);
+
+        // Now manipluate the content and set it back on the message.
+        int start = resultContent.indexOf(INPUT);
+        int end = start + INPUT.length();
+        
+        String newInput = "new content goes here";
+        String newContent = resultContent.substring(0, start) + newInput + resultContent.substring(end);
+        
+        ByteArrayInputStream bais = new ByteArrayInputStream(newContent.getBytes());
+        StreamSource newPayload = new StreamSource(bais); 
+        
+        msg.setPayload(newPayload);
+        
+        // Check the payload to make sure the new content that we added 
+        // was insterted correctly.
+        Source payload2 = msg.getPayload();
+        assertTrue("The returned payload (Source) was null", payload2 != null);
+        
+        String resultContent2 = _getStringFromSource(payload2);
+        assertTrue("The updated content returned was null", resultContent2 != null);
+        assertTrue("The updated content returned was incorrect, old content found", resultContent2.indexOf(INPUT) < 0);
+        assertTrue("The updated content returned was incorrect, new content not found", resultContent2.indexOf(newInput) > -1);
+    }
+    
+    /**
+     * Test to make sure we can get the payload multiple times from the same LogicalMessage.
+     * @throws Exception
+     */
+    public void testGetMultiplePayloadsAsSource() throws Exception {
+        LogicalMessageContext lmc = createSampleContext();
+
+        LogicalMessage msg = lmc.getMessage();
+        assertTrue("The returned LogicalMessage was null", msg != null);
+
+        int loopCount = 3;
+        for (int i = 0; i < loopCount; ++i) {
+            Source payload = msg.getPayload();
+            assertTrue("Attempt number "  + i + " to get the payload (Source) was null", payload != null);
+
+
+            String resultContent = _getStringFromSource(payload);
+            assertTrue("The content returned in loop " + i + " was null", resultContent != null);
+            assertTrue("The content returned in loop " + i + " was incomplete, unexpected element", resultContent.indexOf("echoString") > -1);
+            assertTrue("The content returned in loop " + i + " was incomplete, unexpected content", resultContent.indexOf(INPUT) > -1);            
+        }
+    }
+    
+    /**
+     * Tests the setting of the payload when the original content is a fault.
+     * @throws Exception
+     */
+    public void testGetAndSetFaultPayloadAsSource() throws Exception {
+        LogicalMessageContext lmc = createSampleFaultContext();
+        
+        LogicalMessage msg = lmc.getMessage();
+        assertTrue("The returned LogicalMessage was null", msg != null);
+        
+        Source payload = msg.getPayload();
+        assertTrue("The returned payload (Source) was null", payload != null);
+        
+        String resultContent = _getStringFromSource(payload);
+        assertTrue("The content returned was null", resultContent != null);
+        assertTrue("The content returned was incorrect", resultContent.indexOf(FAULT_INPUT) > 0);
+        assertTrue("The content returned was incorrect, no fault found", resultContent.indexOf("Fault") > 0);
+        
+        // Now manipluate the content and set it back on the message.
+        int start = resultContent.indexOf(FAULT_INPUT);
+        int end = start + FAULT_INPUT.length();
+        
+        String newFaultInput = "new fault content goes here";
+        String newContent = resultContent.substring(0, start) + newFaultInput + resultContent.substring(end);
+        
+        ByteArrayInputStream bais = new ByteArrayInputStream(newContent.getBytes());
+        StreamSource newPayload = new StreamSource(bais); 
+        
+        msg.setPayload(newPayload);
+        
+        // Check the payload to make sure the new content that we added 
+        // was insterted correctly.
+        Source payload2 = msg.getPayload();
+        assertTrue("The returned payload (Source) was null", payload2 != null);
+        
+        String resultContent2 = _getStringFromSource(payload2);
+        assertTrue("The updated content returned was null", resultContent2 != null);
+        assertTrue("The updated content returned was incorrect, old content found", resultContent2.indexOf(FAULT_INPUT) < 0);
+        assertTrue("The updated content returned was incorrect, no fault found", resultContent.indexOf("Fault") > 0);
+        assertTrue("The updated content returned was incorrect, new content not found", resultContent2.indexOf(newFaultInput) > -1);
+    }
+    
+    /**
+     * Test the JAXB based APIs on the LogicalMessage interface.
+     * @throws Exception
+     */
+    public void testGetPayloadAsJAXB() throws Exception {
+        LogicalMessageContext lmc = createSampleContext();
+                
+        LogicalMessage msg = lmc.getMessage();
+        assertTrue("The returned LogicalMessage was null", msg != null);
+        
+        JAXBContext jbc = JAXBContext.newInstance("test");
+        
+        Object obj = msg.getPayload(jbc);
+        assertTrue("The returned payload (Object) was null", obj != null);
+        assertTrue("The returned payload (Object) was of the wrong type: " + obj.getClass().getName(), obj.getClass().equals(EchoString.class));
+        
+        EchoString echo = (EchoString) obj;
+        assertTrue("The EchoString object had null input", echo.getInput() != null);
+        assertTrue("The EchoString object had bad input: " + echo.getInput(), echo.getInput().equals(INPUT));
+    }
+    
+    private LogicalMessageContext createSampleContext() throws Exception {
+        MessageFactory factory = (MessageFactory) FactoryRegistry.getFactory(MessageFactory.class);
+        Message msg = factory.create(Protocol.soap11);
+        
+        // Create a jaxb object
+        ObjectFactory objFactory = new ObjectFactory();
+        EchoString echo = objFactory.createEchoString();
+        echo.setInput(INPUT);
+        
+        // Create the necessary JAXBContext
+        JAXBContext jbc = JAXBContext.newInstance("test");
+        JAXBBlockContext blockCtx = new JAXBBlockContext(jbc);
+        
+        // Create the Block 
+        JAXBBlockFactory blockFactory = (JAXBBlockFactory) FactoryRegistry.getFactory(JAXBBlockFactory.class);
+        Block block = blockFactory.createFrom(echo, blockCtx, null);
+        
+        msg.setBodyBlock(block);
+        
+        MessageContext mc = new MessageContext();
+        mc.setMessage(msg);
+        
+        LogicalMessageContext lmc = MessageContextFactory.createLogicalMessageContext(mc);
+        
+        return lmc;
+    }
+    
+    private LogicalMessageContext createSampleFaultContext() throws Exception {
+        MessageFactory factory = (MessageFactory) FactoryRegistry.getFactory(MessageFactory.class);
+        Message msg = factory.create(Protocol.soap11);
+        
+        XMLFaultReason reason = new XMLFaultReason(FAULT_INPUT);        
+        XMLFault fault = new XMLFault(XMLFaultCode.SENDER, reason);
+        msg.setXMLFault(fault);
+        
+        MessageContext mc = new MessageContext();
+        mc.setMessage(msg);
+        
+        LogicalMessageContext lmc = MessageContextFactory.createLogicalMessageContext(mc);
+        
+        return lmc;
+    }
+    
+    private String _getStringFromSource(Source source) throws Exception {
+        TransformerFactory factory = TransformerFactory.newInstance();
+        Transformer trans = factory.newTransformer();
+        
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        StreamResult result = new StreamResult(baos);
+        
+        trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+        trans.transform(source, result);
+        
+        String content = new String(baos.toByteArray());
+        
+        return content;
+    }
+}
\ No newline at end of file

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java Wed Apr 25 22:19:23 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.injection;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
@@ -36,14 +38,14 @@
 	@PostConstruct
 	public void initialize(){
 		//Called after resource injection and before a method is called.
-		System.out.println("Calling PostConstruct to Initialize");
+        TestLogger.logger.debug("Calling PostConstruct to Initialize");
 	}
 	
 	@PreDestroy
 	public void distructor(){
 		//Called before the scope of request or session or application ends.
-		
-		System.out.println("Calling PreDestroy ");
+
+        TestLogger.logger.debug("Calling PreDestroy ");
 		
 	}
 

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java Wed Apr 25 22:19:23 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.injection;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
@@ -37,14 +39,14 @@
 	@PostConstruct
 	public void initialize(){
 		//Called after resource injection and before a method is called.
-		System.out.println("Calling PostConstruct to Initialize");
+        TestLogger.logger.debug("Calling PostConstruct to Initialize");
 	}
 	
 	@PreDestroy
 	public void distructor(){
 		//Called before the scope of request or session or application ends.
-		
-		System.out.println("Calling PreDestroy ");
+
+        TestLogger.logger.debug("Calling PreDestroy ");
 		
 	}
 	@Resource

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java Wed Apr 25 22:19:23 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.injection;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
@@ -36,14 +38,14 @@
 	@PostConstruct
 	public void initialize(){
 		//Called after resource injection and before a method is called.
-		System.out.println("Calling PostConstruct to Initialize");
+        TestLogger.logger.debug("Calling PostConstruct to Initialize");
 	}
 	
 	@PreDestroy
 	public void distructor(){
 		//Called before the scope of request or session or application ends.
-		
-		System.out.println("Calling PreDestroy ");
+
+        TestLogger.logger.debug("Calling PreDestroy ");
 		
 	}
 	public WebServiceContext getCtx(){

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java Wed Apr 25 22:19:23 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.injection;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
@@ -36,14 +38,14 @@
 	@PostConstruct
 	public void initialize(){
 		//Called after resource injection and before a method is called.
-		System.out.println("Calling PostConstruct to Initialize");
+        TestLogger.logger.debug("Calling PostConstruct to Initialize");
 	}
 	
 	@PreDestroy
 	public void distructor(){
 		//Called before the scope of request or session or application ends.
-		
-		System.out.println("Calling PreDestroy ");
+
+        TestLogger.logger.debug("Calling PreDestroy ");
 		
 	}
 	@Resource

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java Wed Apr 25 22:19:23 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.axis2.jaxws.injection;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
@@ -37,14 +39,14 @@
 	@PostConstruct
 	public void initialize(){
 		//Called after resource injection and before a method is called.
-		System.out.println("Calling PostConstruct to Initialize");
+        TestLogger.logger.debug("Calling PostConstruct to Initialize");
 	}
 	
 	@PreDestroy
 	public void distructor(){
 		//Called before the scope of request or session or application ends.
-		
-		System.out.println("Calling PreDestroy ");
+
+        TestLogger.logger.debug("Calling PreDestroy ");
 		
 	}
 

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java Wed Apr 25 22:19:23 2007
@@ -26,6 +26,7 @@
 import org.apache.axis2.jaxws.resourceinjection.sei.ResourceInjectionService;
 import org.apache.axis2.jaxws.server.endpoint.injection.ResourceInjector;
 import org.apache.axis2.jaxws.server.endpoint.injection.factory.ResourceInjectionFactory;
+import org.apache.axis2.jaxws.TestLogger;
 
 public class ResourceInjectionTests extends TestCase {
 
@@ -38,15 +39,15 @@
 
 	public void testInjectionOnField(){
 		Object serviceInstance = new ResourceInjectionTestImpl1();
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
 			injector.inject(resource, serviceInstance);
 			ResourceInjectionTestImpl1 serviceImpl =(ResourceInjectionTestImpl1)serviceInstance;
 			assertNotNull(serviceImpl.ctx);
-			System.out.println("Resource Injected on Field");
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("Resource Injected on Field");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
 			fail();
@@ -55,15 +56,15 @@
 	
 	public void testInjectionOnMethod(){
 		Object serviceInstance = new ResourceInjectionTestImpl2();
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
 			injector.inject(resource, serviceInstance);
 			ResourceInjectionTestImpl2 serviceImpl =(ResourceInjectionTestImpl2)serviceInstance;
 			assertNotNull(serviceImpl.ctx);
-			System.out.println("Resource Injected on Method");
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("Resource Injected on Method");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
 			fail();
@@ -72,15 +73,15 @@
 	
 	public void testInjectionOnPrivateField(){
 		Object serviceInstance = new ResourceInjectionTestImpl3();
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
 			injector.inject(resource, serviceInstance);
 			ResourceInjectionTestImpl3 serviceImpl =(ResourceInjectionTestImpl3)serviceInstance;
 			assertNotNull(serviceImpl.getCtx());
-			System.out.println("Resource Injected on Private Field");
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("Resource Injected on Private Field");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
 			fail();
@@ -89,15 +90,15 @@
 	
 	public void testInjectionOnProvateMethod(){
 		Object serviceInstance = new ResourceInjectionTestImpl4();
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
 			injector.inject(resource, serviceInstance);
 			ResourceInjectionTestImpl4 serviceImpl =(ResourceInjectionTestImpl4)serviceInstance;
 			assertNotNull(serviceImpl.getCtx());
-			System.out.println("Resource Injected using private Method");
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("Resource Injected using private Method");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
 			fail();
@@ -106,15 +107,15 @@
 	
 	public void testTypedResourceInjectionOnField(){
 		Object serviceInstance = new ResourceInjectionTestImpl5();
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
 			injector.inject(resource, serviceInstance);
 			ResourceInjectionTestImpl5 serviceImpl =(ResourceInjectionTestImpl5)serviceInstance;
 			assertNotNull(serviceImpl.ctx);
-			System.out.println("Resource Injected on Field");
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("Resource Injected on Field");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
 			fail();
@@ -123,14 +124,14 @@
 
 	
     public void testEchoWithResourceInjectionAndLifecycleMethods(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			ResourceInjectionService service = new ResourceInjectionService();
 			ResourceInjectionPortType proxy = service.getResourceInjectionPort();
 			String response = proxy.echo("echo Request");
-			System.out.println("Response String = " +response);
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("Response String = " + response);
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
 			fail();

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java Wed Apr 25 22:19:23 2007
@@ -25,6 +25,7 @@
 import org.apache.axis2.jaxws.wrapper.JAXBWrapperTool;
 import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException;
 import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl;
+import org.apache.axis2.jaxws.TestLogger;
 
 public class WrapperToolTest extends TestCase {
 	public void testWrapStockQuote(){
@@ -127,7 +128,6 @@
 			childNames.add(nav);
 			
 			Object[] jaxbObjects = wrapper.unWrap(price, childNames);
-			System.out.println();
 		}catch(JAXBWrapperException e){
 			e.printStackTrace();
 		}

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java Wed Apr 25 22:19:23 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.jaxws.resourceinjection.ResourceInjectionPortTypeImpl;
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.EndpointLifecycleManager;
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.factory.EndpointLifecycleManagerFactory;
+import org.apache.axis2.jaxws.TestLogger;
 
 public class EndpointLifecycleTests extends TestCase {
 	Object endpointInstance = new ResourceInjectionPortTypeImpl();
@@ -41,60 +42,60 @@
 	}
 	
 	public void testPostConstruct(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
 			assertNotNull(elmf);
 			EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(endpointInstance);
 			assertNotNull(elmf);
 			elm.invokePostConstruct();
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			fail(e.getMessage());
 		}
 	}
 
 	public void testPreDestroy(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
 			assertNotNull(elmf);
 			EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(endpointInstance);
 			assertNotNull(elm);
 			elm.invokePreDestroy();
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			fail(e.getMessage());
 		}
 	}
 	
 	public void testBadPostConstruct(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
 			assertNotNull(elmf);
 			EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(badObject);
 			assertNotNull(elmf);
 			elm.invokePostConstruct();
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			fail(e.getMessage());
 		}
 	}
 
 	public void testBadPreDestroy(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try{
 			EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
 			assertNotNull(elmf);
 			EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(badObject);
 			assertNotNull(elm);
 			elm.invokePreDestroy();
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("------------------------------");
 		}catch(Exception e){
 			fail(e.getMessage());
 		}

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/BlockTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/BlockTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/BlockTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/BlockTests.java Wed Apr 25 22:19:23 2007
@@ -52,6 +52,7 @@
 import org.apache.axis2.jaxws.message.factory.XMLStringBlockFactory;
 import org.apache.axis2.jaxws.message.util.Reader2Writer;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.TestLogger;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
@@ -918,7 +919,7 @@
 	        // To check that the output is correct, get the String contents of the 
 	        // reader
 	        String newText = baos.toString();
-	        System.out.println(newText);
+            TestLogger.logger.debug(newText);
 	        assertTrue(block.isConsumed());
 		}catch(Exception e){
 			e.printStackTrace();
@@ -982,7 +983,7 @@
         DocumentBuilder domBuilder = domFactory.newDocumentBuilder();
         Document domTree = domBuilder.parse(bais);
         Node node = domTree.getDocumentElement();
-        System.out.println(node.toString());
+        TestLogger.logger.debug(node.toString());
         
         // Create a DOMSource object from the DOM tree
         DOMSource ds = new DOMSource(node);

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageRPCTests.java Wed Apr 25 22:19:23 2007
@@ -34,6 +34,7 @@
 import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
 import org.apache.axis2.jaxws.message.factory.MessageFactory;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.TestLogger;
 import org.test.stock1.ObjectFactory;
 import org.test.stock1.StockPrice;
 
@@ -156,7 +157,7 @@
         // To check that the output is correct, get the String contents of the 
         // reader
         String newText = baos.toString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains("m:op"));
         assertTrue(newText.contains("m:param"));
         assertTrue(newText.contains("100"));
@@ -237,7 +238,7 @@
         // To check that the output is correct, get the String contents of the 
         // reader
         String newText = baos.toString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains("m:op"));
         assertTrue(newText.contains("m:param"));
         assertTrue(newText.contains("100"));

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/MessageTests.java Wed Apr 25 22:19:23 2007
@@ -37,6 +37,7 @@
 import org.apache.axis2.jaxws.message.factory.XMLStringBlockFactory;
 import org.apache.axis2.jaxws.message.util.SAAJConverter;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.TestLogger;
 import test.EchoStringResponse;
 import test.ObjectFactory;
 
@@ -186,7 +187,7 @@
         env.serializeAndConsume(baos, new OMOutputFormat());
         
 		String newText = baos.toString();
-		System.out.println(newText);
+        TestLogger.logger.debug(newText);
 		assertTrue(newText.contains(sampleText));
 		assertTrue(newText.contains("soap"));
 		assertTrue(newText.contains("Envelope"));
@@ -247,7 +248,7 @@
 		// To check that the output is correct, get the String contents of the 
 		// reader
         String newText = baos.toString();
-		System.out.println(newText);
+        TestLogger.logger.debug(newText);
 		assertTrue(newText.contains(sampleText));
 		assertTrue(newText.contains("soap"));
 		assertTrue(newText.contains("Envelope"));
@@ -312,7 +313,7 @@
         // To check that the output is correct, get the String contents of the 
         // reader
         String newText = baos.toString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains("soap"));
         assertTrue(newText.contains("Envelope"));
         assertTrue(newText.contains("Body"));
@@ -376,7 +377,7 @@
         // To check that the output is correct, get the String contents of the 
         // reader
         String newText = baos.toString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains(sampleText));
         assertTrue(newText.contains("soap"));
         assertTrue(newText.contains("Envelope"));
@@ -679,7 +680,7 @@
         // To check that the output is correct, get the String contents of the 
         // reader
         String newText = baos.toString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains(sampleJAXBText));
         assertTrue(newText.contains("soap"));
         assertTrue(newText.contains("Envelope"));
@@ -751,7 +752,7 @@
         // To check that the output is correct, get the String contents of the 
         // reader
         String newText = baos.toString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains(sampleJAXBText));
         assertTrue(newText.contains("soap"));
         assertTrue(newText.contains("Envelope"));

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/SOAP12Tests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/SOAP12Tests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/SOAP12Tests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/message/SOAP12Tests.java Wed Apr 25 22:19:23 2007
@@ -30,6 +30,7 @@
 import org.apache.axis2.jaxws.message.factory.XMLStringBlockFactory;
 import org.apache.axis2.jaxws.message.util.Reader2Writer;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.TestLogger;
 
 /**
  * This suite is used to test the creation of messages based on SOAP 1.2
@@ -95,7 +96,7 @@
         // reader
         Reader2Writer r2w = new Reader2Writer(om.getXMLStreamReader());
         String newText = r2w.getAsString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains(sampleText));
         assertTrue(newText.contains("soap"));
         assertTrue(newText.contains("Envelope"));
@@ -140,7 +141,7 @@
         // reader
         Reader2Writer r2w = new Reader2Writer(om.getXMLStreamReaderWithoutCaching());
         String newText = r2w.getAsString();
-        System.out.println(newText);
+        TestLogger.logger.debug(newText);
         assertTrue(newText.contains(sampleText));
         assertTrue(newText.contains("soap"));
         assertTrue(newText.contains("Envelope"));

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java Wed Apr 25 22:19:23 2007
@@ -57,7 +57,7 @@
         context3.add("org.test.addnumbers");
         context3.add("org.test.anytype");
         context3.add("my.grandma.loves.jaxws");
-
+        
         JAXBContext jaxbContext3 = JAXBUtils.getJAXBContext(context3);
         
         // The following assertion is probably true,but GC may have wiped out the weak reference
@@ -65,7 +65,7 @@
         assertTrue(jaxbContext3 != null);
         assertTrue(jaxbContext1.toString().equals(jaxbContext1.toString()));
         assertTrue(context3.contains("org.test.addnumbers"));
-        assertTrue(context3.contains("org.test.anytype"));
+        assertTrue(context3.contains("org.test.anytype")); 
         // TODO FIXME - does not work under m2/surefire
 //        assertTrue(!context3.contains("my.grandma.loves.jaxws"));  // invalid package should be silently removed
         

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/EchoMessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/EchoMessageImpl.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/EchoMessageImpl.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/EchoMessageImpl.java Wed Apr 25 22:19:23 2007
@@ -6,6 +6,7 @@
 import javax.jws.WebService;
 
 import org.apache.axis2.jaxws.nonanonymous.complextype.sei.EchoMessagePortType;
+import org.apache.axis2.jaxws.TestLogger;
 
 @WebService(targetNamespace="http://testApp.jaxws",
             endpointInterface="org.apache.axis2.jaxws.nonanonymous.complextype.sei.EchoMessagePortType")
@@ -25,7 +26,7 @@
 	 */
 	public String echoMessage(String request) {
 		String response = null;
-		System.out.println("echoMessage received: " + request);
+        TestLogger.logger.debug("echoMessage received: " + request);
         response = request.replaceAll("Server", "Client");
         return response;
 

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/NonAnonymousComplexTypeTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/NonAnonymousComplexTypeTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/NonAnonymousComplexTypeTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/nonanonymous/complextype/NonAnonymousComplexTypeTests.java Wed Apr 25 22:19:23 2007
@@ -8,6 +8,7 @@
 import junit.framework.TestCase;
 import org.apache.axis2.jaxws.nonanonymous.complextype.sei.EchoMessagePortType;
 import org.apache.axis2.jaxws.nonanonymous.complextype.sei.EchoMessageService;
+import org.apache.axis2.jaxws.TestLogger;
 
 public class NonAnonymousComplexTypeTests extends TestCase {
 
@@ -27,14 +28,14 @@
 		// TODO Auto-generated constructor stub
 	}
 	public void testSimpleProxy() {
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		try {
 			String msg = "Hello Server";
 		    EchoMessagePortType myPort = (new EchoMessageService()).getEchoMessagePort();
 		    String response = myPort.echoMessage(msg);
-		    System.out.println(response);
-		    System.out.println("------------------------------");
+            TestLogger.logger.debug(response);
+            TestLogger.logger.debug("------------------------------");
 		} catch (WebServiceException webEx) {
 			webEx.printStackTrace();
 			fail();

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/PolymorphicShapePortTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/PolymorphicShapePortTypeImpl.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/PolymorphicShapePortTypeImpl.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/PolymorphicShapePortTypeImpl.java Wed Apr 25 22:19:23 2007
@@ -3,6 +3,7 @@
 import javax.jws.WebService;
 
 import org.apache.axis2.jaxws.polymorphic.shape.sei.PolymorphicShapePortType;
+import org.apache.axis2.jaxws.TestLogger;
 import org.test.shape.Circle;
 import org.test.shape.Shape;
 import org.test.shape.Square;
@@ -14,12 +15,14 @@
 	public Shape draw(Shape request) {
 		if(request instanceof Circle){
 			Circle circle =(Circle) request;
-			System.out.println("Drawing Circle on x ="+request.getXAxis()+" y=" +request.getYAxis()+ " With Radius ="+circle.getRadius());
+            TestLogger.logger.debug("Drawing Circle on x =" + request.getXAxis() + " y=" +
+                    request.getYAxis() + " With Radius =" + circle.getRadius());
 			return request;
 		}
 		if(request instanceof Square){
 			Square square =(Square) request;
-			System.out.println("Drawing Square on x ="+request.getXAxis()+" y=" +request.getYAxis()+ " With Sides ="+square.getLength());
+            TestLogger.logger.debug("Drawing Square on x =" + request.getXAxis() + " y=" +
+                    request.getYAxis() + " With Sides =" + square.getLength());
 			return request;
 		}
 		return null;
@@ -28,7 +31,8 @@
 	public Shape draw3D(Shape request) {
 		if(request instanceof ThreeDSquare){
 			ThreeDSquare threeDsquare =(ThreeDSquare) request;
-			System.out.println("Drawing 3DSquare on x ="+request.getXAxis()+" y=" +request.getYAxis()+ " With Bredth ="+threeDsquare.getBredth());
+            TestLogger.logger.debug("Drawing 3DSquare on x =" + request.getXAxis() + " y=" +
+                    request.getYAxis() + " With Bredth =" + threeDsquare.getBredth());
 			return request;
 		}
 		return null;

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/tests/PolymorphicTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/tests/PolymorphicTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/tests/PolymorphicTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/polymorphic/shape/tests/PolymorphicTests.java Wed Apr 25 22:19:23 2007
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.ConnectException;
 import java.net.UnknownHostException;
@@ -18,6 +19,7 @@
 import org.apache.axis2.jaxws.util.WSDLWrapper;
 import org.apache.axis2.jaxws.wsdl.SchemaReaderException;
 import org.apache.axis2.jaxws.wsdl.impl.SchemaReaderImpl;
+import org.apache.axis2.jaxws.TestLogger;
 import org.test.shape.Shape;
 import org.test.shape.Square;
 import org.test.shape.threed.ThreeDSquare;
@@ -25,22 +27,22 @@
 public class PolymorphicTests extends TestCase {
 
 	public void testFormalAndActualTypeInDifferentPackages(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		PolymorphicShapeService service = new PolymorphicShapeService();
 		PolymorphicShapePortType port = service.getPolymorphicShapePort();
 		Shape shapeType;
-		
-		System.out.println("Sending Request to draw Square");
+
+        TestLogger.logger.debug("Sending Request to draw Square");
 		Square shape = new Square();
 		shape.setXAxis(1);
 		shape.setYAxis(1);
 		shape.setLength(10);
 		shapeType = port.draw(shape);
 		assertTrue(shapeType instanceof Square);
-		System.out.println("Square was drawn");
-		
-		System.out.println("Sending Request to draw 3D Square");
+        TestLogger.logger.debug("Square was drawn");
+
+        TestLogger.logger.debug("Sending Request to draw 3D Square");
 		ThreeDSquare threeDshape = new ThreeDSquare();
 		threeDshape.setXAxis(1);
 		threeDshape.setYAxis(1);
@@ -49,13 +51,13 @@
 		threeDshape.setBredth(10);
 		shapeType = port.draw3D(threeDshape);
 		assertTrue(shapeType instanceof ThreeDSquare);
-		System.out.println("3D Square was drawn");
-		System.out.println("-------------------------------");
+        TestLogger.logger.debug("3D Square was drawn");
+        TestLogger.logger.debug("-------------------------------");
 	}
 	
 	public void testInlineUseOfJAXBBinding(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		String schemaBindingPkgName = "org.test.echomessage";
 		String standardPkgName= "org.test.complextype.nonanonymous";
 		String wsdlLocation="test-resources/wsdl/JAXB_Customization_Sample.wsdl";
@@ -77,9 +79,9 @@
 			Iterator<String> iter = set.iterator();
 			while(iter.hasNext()){
 				String pkg = iter.next();
-				System.out.println("Package = " +pkg);
+                TestLogger.logger.debug("Package = " + pkg);
 			}
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("------------------------------");
 		} catch (MalformedURLException e) {
 			e.printStackTrace();
 			fail();
@@ -92,7 +94,10 @@
 		}catch(ConnectException e) {
 			e.printStackTrace();
 			fail();
-		}catch(WSDLException e){
+		}catch(IOException e) {
+		    e.printStackTrace();
+            fail();
+        }catch(WSDLException e){
 			e.printStackTrace();
 			fail();
 		}catch(SchemaReaderException e){
@@ -102,8 +107,8 @@
 	}
 	
 	public void testSchemaReader(){
-		System.out.println("------------------------------");
-		System.out.println("Test : "+getName());
+        TestLogger.logger.debug("------------------------------");
+        TestLogger.logger.debug("Test : " + getName());
 		String wsdlLocation="test-resources/wsdl/shapes.wsdl";
 		URL url = null;
 		try{
@@ -122,9 +127,9 @@
 			assertNotNull(set);
 			Iterator<String> iter = set.iterator();
 			while(iter.hasNext()){
-				System.out.println("Package ="+iter.next());
+                TestLogger.logger.debug("Package =" + iter.next());
 			}
-			System.out.println("------------------------------");
+            TestLogger.logger.debug("------------------------------");
 		} catch (MalformedURLException e) {
 			e.printStackTrace();
 			fail();
@@ -137,6 +142,9 @@
 		}catch(ConnectException e) {
 			e.printStackTrace();
 			fail();
+        }catch(IOException e) {
+            e.printStackTrace();
+            fail();
 		}catch(WSDLException e){
 			e.printStackTrace();
 			fail();

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/JAXBProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/JAXBProviderTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/JAXBProviderTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/JAXBProviderTests.java Wed Apr 25 22:19:23 2007
@@ -30,6 +30,7 @@
 import javax.xml.ws.Service;
 
 import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axis2.jaxws.TestLogger;
 import org.test.mtom.ImageDepot;
 import org.test.mtom.ObjectFactory;
 import org.test.mtom.SendImage;
@@ -90,8 +91,8 @@
      * @throws Exception
      */
     public void testMTOMAttachmentString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         //Create a DataHandler with the String DataSource object
         DataHandler dataHandler = new DataHandler(stringDS);
@@ -112,12 +113,12 @@
         ObjectFactory factory = new ObjectFactory();
         SendImage request = factory.createSendImage();
         request.setInput(imageDepot);
-        
-        System.out.println(">> Invoking Dispatch<Object> JAXBProviderService");
+
+        TestLogger.logger.debug(">> Invoking Dispatch<Object> JAXBProviderService");
         
         SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
-        
-        System.out.println(">> Response [" + response.toString() + "]");
+
+        TestLogger.logger.debug(">> Response [" + response.toString() + "]");
     }
     
     /**
@@ -125,8 +126,8 @@
      * @throws Exception
      */
     public void testMTOMAttachmentImage() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         //Create a DataHandler with the String DataSource object
         DataHandler dataHandler = new DataHandler(imageDS);
@@ -147,11 +148,11 @@
         ObjectFactory factory = new ObjectFactory();
         SendImage request = factory.createSendImage();
         request.setInput(imageDepot);
-        
-        System.out.println(">> Invoking Dispatch<Object> JAXBProviderService");
+
+        TestLogger.logger.debug(">> Invoking Dispatch<Object> JAXBProviderService");
         
         SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
-        
-        System.out.println(">> Response [" + response.toString() + "]");
+
+        TestLogger.logger.debug(">> Response [" + response.toString() + "]");
     }
 }

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageProviderTests.java Wed Apr 25 22:19:23 2007
@@ -38,6 +38,7 @@
 import javax.xml.ws.soap.SOAPFaultException;
 
 import org.apache.axis2.jaxws.provider.soapmsg.SoapMessageProvider;
+import org.apache.axis2.jaxws.TestLogger;
 
 /**
  * Tests Dispatch<SOAPMessage> client and a Provider<SOAPMessage> service.
@@ -113,13 +114,12 @@
             request.setContentDescription(SoapMessageProvider.XML_REQUEST);
             
             // Dispatch
-        	System.out.println(">> Invoking SourceMessageProviderDispatch");
+            TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
         	SOAPMessage response = dispatch.invoke(request);
 
             // Check for valid content description
-            // TODO: FIXME: Does not work!
-//            assert(response.getContentDescription() != null);
-//            assert(response.getContentDescription().equals(SoapMessageProvider.XML_RESPONSE));
+            assertNotNull(response.getContentDescription());
+            assertEquals(SoapMessageProvider.XML_RESPONSE, response.getContentDescription());
             
             // Check assertions and get the data element
             SOAPElement dataElement = assertResponseXML(response, SoapMessageProvider.XML_RESPONSE);
@@ -127,7 +127,7 @@
             assertTrue(countAttachments(response) == 0);
             
             // Print out the response
-        	System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
             response.writeTo(System.out);
         	
         }catch(Exception e){
@@ -156,7 +156,7 @@
             request.setContentDescription(SoapMessageProvider.XML_EMPTYBODY_REQUEST);
             
             // Dispatch
-            System.out.println(">> Invoking SourceMessageProviderDispatch");
+            TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
             SOAPMessage response = dispatch.invoke(request);
             
             // Check assertions
@@ -167,7 +167,7 @@
             assertTrue(countAttachments(response) == 0);
             
             // Print out the response
-            System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
             response.writeTo(System.out);
             
         }catch(Exception e){
@@ -197,7 +197,7 @@
             
             try {
                 // Dispatch
-                System.out.println(">> Invoking SourceMessageProviderDispatch");
+                TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
                 SOAPMessage response = dispatch.invoke(request);
                 assertTrue("Expected failure", false);
             } catch (SOAPFaultException e) {
@@ -236,7 +236,7 @@
             
             try {
                 // Dispatch
-                System.out.println(">> Invoking SourceMessageProviderDispatch");
+                TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
                 SOAPMessage response = dispatch.invoke(request);
                 assertTrue("Expected failure", false);
             } catch (SOAPFaultException e) {
@@ -271,12 +271,12 @@
             AttachmentPart ap = request.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
             ap.setContentId(SoapMessageProvider.ID);
             request.addAttachmentPart(ap);
-            
-            System.out.println("Request Message:");
+
+            TestLogger.logger.debug("Request Message:");
             request.writeTo(System.out);
             
             // Dispatch
-            System.out.println(">> Invoking SourceMessageProviderDispatch");
+            TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
             SOAPMessage response = dispatch.invoke(request);
 
             // Check assertions and get the data element
@@ -293,7 +293,7 @@
             assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
             
             // Print out the response
-            System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
             response.writeTo(System.out);
             
         }catch(Exception e){
@@ -312,11 +312,10 @@
             // Create the dispatch
             Dispatch<SOAPMessage> dispatch = createDispatch();
             
-            // Must indicated that this is a JAX-WS MTOM Dispatch
-            Binding binding = dispatch.getBinding();
-            SOAPBinding soapBinding = (SOAPBinding) binding;
-            soapBinding.setMTOMEnabled(true);
-            
+            // MTOM should be automatically detected.  There is no need to set it
+            //Binding binding = dispatch.getBinding();
+            //SOAPBinding soapBinding = (SOAPBinding) binding;
+            //soapBinding.setMTOMEnabled(true);
             
             // Create the SOAPMessage
             String msg = reqMsgStart + MTOM_INVOKE + reqMsgEnd;
@@ -328,12 +327,12 @@
             AttachmentPart ap = request.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
             ap.setContentId(SoapMessageProvider.ID);
             request.addAttachmentPart(ap);
-            
-            System.out.println("Request Message:");
+
+            TestLogger.logger.debug("Request Message:");
             request.writeTo(System.out);
             
             // Dispatch
-            System.out.println(">> Invoking SourceMessageProviderDispatch");
+            TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
             SOAPMessage response = dispatch.invoke(request);
 
             // Check assertions and get the data element
@@ -350,7 +349,7 @@
             assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
             
             // Print out the response
-            System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
             response.writeTo(System.out);
             
         }catch(Exception e){
@@ -379,12 +378,12 @@
             AttachmentPart ap = request.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
             ap.setContentId(SoapMessageProvider.ID);
             request.addAttachmentPart(ap);
-            
-            System.out.println("Request Message:");
+
+            TestLogger.logger.debug("Request Message:");
             request.writeTo(System.out);
             
             // Dispatch
-            System.out.println(">> Invoking SourceMessageProviderDispatch");
+            TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
             SOAPMessage response = dispatch.invoke(request);
 
             // Check assertions and get the data element
@@ -399,10 +398,10 @@
             String content = SoapMessageProvider.getAsString(contentSS);
             assertTrue(content != null);
             assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
-            assert(attachmentPart.getContentId().equals(SoapMessageProvider.ID));
+            assertEquals(SoapMessageProvider.ID, attachmentPart.getContentId());
             
             // Print out the response
-            System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
             response.writeTo(System.out);
             
         }catch(Exception e){
@@ -434,12 +433,12 @@
         assertTrue(body != null);
         
         Node invokeElement = (Node) body.getFirstChild();
-        assert(invokeElement instanceof SOAPElement);
-        assert(SoapMessageProvider.RESPONSE_NAME.equals(invokeElement.getLocalName()));
+        assertTrue(invokeElement instanceof SOAPElement);
+        assertEquals(SoapMessageProvider.RESPONSE_NAME, invokeElement.getLocalName());
         
         Node dataElement = (Node) invokeElement.getFirstChild();
-        assert(dataElement instanceof SOAPElement);
-        assert(SoapMessageProvider.RESPONSE_DATA_NAME.equals(dataElement.getLocalName()));
+        assertTrue(dataElement instanceof SOAPElement);
+        assertEquals(SoapMessageProvider.RESPONSE_DATA_NAME, dataElement.getLocalName());
         
         // TODO AXIS2 SAAJ should (but does not) support the getTextContent();
         // String text = dataElement.getTextContent();
@@ -457,7 +456,7 @@
     private int countAttachments(SOAPMessage msg) {
         Iterator it = msg.getAttachments();
         int count = 0;
-        assert(it != null);
+        assertTrue(it != null);
         while (it.hasNext()) {
             it.next();
             count++;

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceMessageProviderTests.java Wed Apr 25 22:19:23 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.axis2.jaxws.provider;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
@@ -59,10 +61,10 @@
         	Service svc = Service.create(serviceName);
         	svc.addPort(portName,null, endpointUrl);
         	Dispatch<Source> dispatch = svc.createDispatch(portName, Source.class, null);
-        	System.out.println(">> Invoking SourceMessageProviderDispatch");
+            TestLogger.logger.debug(">> Invoking SourceMessageProviderDispatch");
         	Source response = dispatch.invoke(xmlStreamSource);
 
-        	System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
         	
         }catch(Exception e){
         	e.printStackTrace();

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/SourceProviderTests.java Wed Apr 25 22:19:23 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.axis2.jaxws.provider;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -92,8 +94,8 @@
     }
     
     public void testNormal() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -106,8 +108,8 @@
     }
     
     public void testEmptyString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -124,8 +126,8 @@
     }
     
     public void testNullSource() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -138,8 +140,8 @@
     }
     
     public void testEmptySource() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -152,8 +154,8 @@
     }
     
     public void testNonNullString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -168,8 +170,8 @@
     }
     
     public void testCommentString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -183,8 +185,8 @@
     }
     
     public void testTwoElementsString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -199,8 +201,8 @@
     }
     
     public void testTwoElementsAndMixedContentString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -214,8 +216,8 @@
     }
     
     public void testException() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<Source> dispatch = getDispatch();
         
@@ -243,10 +245,10 @@
         	Service svc = Service.create(serviceName);
         	svc.addPort(portName,null, endpointUrl);
         	Dispatch<Source> dispatch = svc.createDispatch(portName, Source.class, null);
-        	System.out.println(">> Invoking Source Provider Dispatch");
+            TestLogger.logger.debug(">> Invoking Source Provider Dispatch");
         	Source response = dispatch.invoke(xmlStreamSource);
 
-        	System.out.println(">> Response [" + response.toString() + "]");
+            TestLogger.logger.debug(">> Response [" + response.toString() + "]");
         	
         }catch(Exception e){
         	e.printStackTrace();

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringMessageProviderTests.java Wed Apr 25 22:19:23 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.axis2.jaxws.provider;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.xml.namespace.QName;
 import javax.xml.ws.Dispatch;
 import javax.xml.ws.Service;
@@ -39,17 +41,17 @@
     }
     
     public void testProviderString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Service svc = Service.create(serviceName);
         svc.addPort(portName, null, endpointUrl);
         
         Dispatch<String> dispatch = svc
                 .createDispatch(portName, String.class, Service.Mode.PAYLOAD);
-        
-        System.out.println(">> Invoking Dispatch<String> StringMessageProviderService");
+
+        TestLogger.logger.debug(">> Invoking Dispatch<String> StringMessageProviderService");
         String retVal = dispatch.invoke(xmlString);
-        System.out.println(">> Response [" + retVal + "]");
+        TestLogger.logger.debug(">> Response [" + retVal + "]");
     }
 }

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringProviderTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringProviderTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/StringProviderTests.java Wed Apr 25 22:19:23 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.axis2.jaxws.provider;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPFault;
 import javax.xml.ws.BindingProvider;
@@ -57,8 +59,8 @@
         
     }
     public void testNormal() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -68,8 +70,8 @@
     }
     
     public void testEmptyString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -84,8 +86,8 @@
     }
     
     public void testNullString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -98,8 +100,8 @@
     }
     
     public void testNonNullString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -112,8 +114,8 @@
     }
     
     public void testCommentString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -125,8 +127,8 @@
     }
     
     public void testTwoElementsString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -139,8 +141,8 @@
     }
     
     public void testTwoElementsAndMixedContentString() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         
@@ -152,8 +154,8 @@
     }
     
     public void testException() throws Exception {
-        System.out.println("---------------------------------------");
-        System.out.println("test: " + getName());
+        TestLogger.logger.debug("---------------------------------------");
+        TestLogger.logger.debug("test: " + getName());
         
         Dispatch<String> dispatch = getDispatch();
         

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/jaxb/JAXBProvider.java Wed Apr 25 22:19:23 2007
@@ -30,6 +30,7 @@
 import org.test.mtom.ObjectFactory;
 import org.test.mtom.SendImage;
 import org.test.mtom.SendImageResponse;
+import org.apache.axis2.jaxws.TestLogger;
 
 /**
  * A JAXWS Source Provider implementation
@@ -44,7 +45,7 @@
      * @return
      */
     public Source invoke(Source obj) {
-        System.out.println(">> JAXB Provider Service: Request received.\n");
+        TestLogger.logger.debug(">> JAXB Provider Service: Request received.\n");
         SendImage siRequest = null;
         SendImageResponse siResponse = null;
         StreamSource streamSource = null;

Modified: webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsg/SoapMessageProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsg/SoapMessageProvider.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsg/SoapMessageProvider.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsg/SoapMessageProvider.java Wed Apr 25 22:19:23 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.axis2.jaxws.provider.soapmsg;
 
+import org.apache.axis2.jaxws.TestLogger;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
@@ -50,7 +52,6 @@
 
 @WebServiceProvider()
 @ServiceMode(value=Service.Mode.MESSAGE)
-@BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
 public class SoapMessageProvider implements Provider<SOAPMessage> {
       
     String responseMsgStart = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header/><soapenv:Body>";
@@ -105,7 +106,7 @@
     
     
     public SOAPMessage invoke(SOAPMessage soapMessage) throws SOAPFaultException {
-    	System.out.println(">> SoapMessageProvider: Request received.");
+        TestLogger.logger.debug(">> SoapMessageProvider: Request received.");
     	
     	try{
     	    // Look at the incoming request message
@@ -137,19 +138,20 @@
                 throwWebServiceException();
             } else {
                 // We should not get here
-                System.out.println("Unknown Type of Message");
-                assert(false);
+                TestLogger.logger.debug("Unknown Type of Message");
+                assertTrue(false);
             }
             
             // Write out the Message
-            System.out.println(">> Response being sent by Server:");
+            TestLogger.logger.debug(">> Response being sent by Server:");
             //response.writeTo(System.out);
             //System.out.println("\n");
             return response;
     	} catch (WebServiceException wse) {
     	    throw wse;
         } catch(Exception e){
-            System.out.println("***ERROR: In SoapMessageProvider.invoke: Caught exception " + e);
+            TestLogger.logger
+                    .debug("***ERROR: In SoapMessageProvider.invoke: Caught exception " + e);
     		e.printStackTrace();
     	}
     	return null;
@@ -161,22 +163,22 @@
      * @return SOAPElement representing the data element
      */
     private SOAPElement assertRequestXML(SOAPMessage msg) throws Exception {
-        assert(msg != null);
+        assertTrue(msg != null);
         SOAPBody body = msg.getSOAPBody();
-        assert(body != null);
+        assertTrue(body != null);
         
         Node invokeElement = (Node) body.getFirstChild();
-        assert(invokeElement instanceof SOAPElement);
-        assert(SoapMessageProvider.REQUEST_NAME.equals(invokeElement.getLocalName()));
+        assertTrue(invokeElement instanceof SOAPElement);
+        assertTrue(SoapMessageProvider.REQUEST_NAME.equals(invokeElement.getLocalName()));
         
         Node discElement = (Node) invokeElement.getFirstChild();
-        assert(discElement instanceof SOAPElement);
-        assert(SoapMessageProvider.REQUEST_DATA_NAME.equals(discElement.getLocalName()));
+        assertTrue(discElement instanceof SOAPElement);
+        assertTrue(SoapMessageProvider.REQUEST_DATA_NAME.equals(discElement.getLocalName()));
         
         String text = discElement.getValue();
-        assert(text != null);
-        assert(text.length() > 0);
-        System.out.println("Request Message Type is:" + text);
+        assertTrue(text != null);
+        assertTrue(text.length() > 0);
+        TestLogger.logger.debug("Request Message Type is:" + text);
         
         return (SOAPElement) discElement;
     }
@@ -191,12 +193,11 @@
         SOAPMessage response;
         
         // Transport header check
-        //TODO: FIXME - does not work!!!
-//        assert(request.getContentDescription() != null);
-//        assert(request.getContentDescription().equals(SoapMessageProvider.XML_REQUEST));
+        assertTrue(request.getContentDescription() != null);
+        assertTrue(request.getContentDescription().equals(SoapMessageProvider.XML_REQUEST));
 
         // Additional assertion checks
-        assert(countAttachments(request) == 0);
+        assertTrue(countAttachments(request) == 0);
         
         // Build the Response
         MessageFactory factory = MessageFactory.newInstance();
@@ -219,7 +220,7 @@
        
 
         // Additional assertion checks
-        assert(countAttachments(request) == 0);
+        assertTrue(countAttachments(request) == 0);
         
         // Build the Response
         MessageFactory factory = MessageFactory.newInstance();
@@ -238,11 +239,11 @@
         SOAPMessage response;
         
         // Additional assertion checks
-        assert(countAttachments(request) == 1);
+        assertTrue(countAttachments(request) == 1);
         AttachmentPart requestAP = (AttachmentPart) request.getAttachments().next();
         StreamSource contentSS = (StreamSource) requestAP.getContent();
         String content = getAsString(contentSS);
-        assert(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
+        assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
         
         // Build the Response
         MessageFactory factory = MessageFactory.newInstance();
@@ -265,16 +266,16 @@
      */
     private SOAPMessage getXMLMTOMResponse(SOAPMessage request, SOAPElement dataElement) throws Exception {
         SOAPMessage response;
-        
-        System.out.println("Received MTOM Message");
+
+        TestLogger.logger.debug("Received MTOM Message");
         // Additional assertion checks
-        assert(countAttachments(request) == 1);
+        assertTrue(countAttachments(request) == 1);
         AttachmentPart requestAP = (AttachmentPart) request.getAttachments().next();
         StreamSource contentSS = (StreamSource) requestAP.getContent();
         String content = getAsString(contentSS);
-        assert(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
-        
-        System.out.println("The MTOM Request Message appears correct.");
+        assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
+
+        TestLogger.logger.debug("The MTOM Request Message appears correct.");
         
         // Build the Response
         MessageFactory factory = MessageFactory.newInstance();
@@ -285,8 +286,8 @@
         AttachmentPart ap = response.createAttachmentPart(SoapMessageProvider.TEXT_XML_ATTACHMENT, "text/xml");
         ap.setContentId(ID);
         response.addAttachmentPart(ap);
-        
-        System.out.println("Returning the Response Message");
+
+        TestLogger.logger.debug("Returning the Response Message");
         return response;
     }
     
@@ -300,12 +301,12 @@
         SOAPMessage response;
         
         // Additional assertion checks
-        assert(countAttachments(request) == 1);
+        assertTrue(countAttachments(request) == 1);
         AttachmentPart requestAP = (AttachmentPart) request.getAttachments().next();
-        assert(requestAP.getContentId().equals(ID));
+        assertTrue(requestAP.getContentId().equals(ID));
         StreamSource contentSS = (StreamSource) requestAP.getContent();
         String content = getAsString(contentSS);
-        assert(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
+        assertTrue(content.contains(SoapMessageProvider.TEXT_XML_ATTACHMENT));
         
         // Build the Response
         MessageFactory factory = MessageFactory.newInstance();
@@ -357,7 +358,7 @@
     private int countAttachments(SOAPMessage msg) {
         Iterator it = msg.getAttachments();
         int count = 0;
-        assert(it != null);
+        assertTrue(it != null);
         while (it.hasNext()) {
             it.next();
             count++;
@@ -373,5 +374,11 @@
         transformer.transform(ss, result); 
         String text = new String(out.toByteArray());
         return text;
+    }
+    
+    private void assertTrue(boolean testAssertion) {
+        if (!testAssertion) {
+            throw new RuntimeException("Assertion false");
+        }
     }
 }



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


Mime
View raw message