You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2008/11/02 20:52:17 UTC

svn commit: r709916 - /webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/AxisTestEndpoint.java

Author: veithen
Date: Sun Nov  2 11:52:16 2008
New Revision: 709916

URL: http://svn.apache.org/viewvc?rev=709916&view=rev
Log:
Testkit: Log service parameter of Axis endpoints.

Modified:
    webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/AxisTestEndpoint.java

Modified: webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/AxisTestEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/AxisTestEndpoint.java?rev=709916&r1=709915&r2=709916&view=diff
==============================================================================
--- webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/AxisTestEndpoint.java (original)
+++ webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/AxisTestEndpoint.java Sun Nov  2 11:52:16 2008
@@ -19,11 +19,16 @@
 
 package org.apache.axis2.transport.testkit.axis2.endpoint;
 
+import java.io.OutputStream;
+import java.io.PrintWriter;
 import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
 import java.util.UUID;
 
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.transport.TransportListener;
 import org.apache.axis2.transport.base.event.TransportError;
 import org.apache.axis2.transport.base.event.TransportErrorListener;
@@ -34,6 +39,7 @@
 import org.apache.axis2.transport.testkit.tests.Setup;
 import org.apache.axis2.transport.testkit.tests.TearDown;
 import org.apache.axis2.transport.testkit.tests.Transient;
+import org.apache.axis2.transport.testkit.util.LogManager;
 
 @Name("axis")
 public abstract class AxisTestEndpoint implements TransportErrorListener {
@@ -42,7 +48,9 @@
     private @Transient AxisService service;
     
     @Setup @SuppressWarnings("unused")
-    private void setUp(AxisTestEndpointContext context, Channel channel, AxisServiceConfigurator[] configurators) throws Exception {
+    private void setUp(LogManager logManager, AxisTestEndpointContext context, Channel channel,
+            AxisServiceConfigurator[] configurators) throws Exception {
+        
         this.context = context;
         
         TransportListener listener = context.getTransportListener();
@@ -62,13 +70,30 @@
         }
         service = new AxisService(serviceName);
         service.addOperation(createOperation());
-        // We want to receive all messages through the same operation:
-        service.addParameter(AxisService.SUPPORT_SINGLE_OP, true);
         if (configurators != null) {
             for (AxisServiceConfigurator configurator : configurators) {
                 configurator.setupService(service, false);
             }
         }
+        
+        // Output service parameters to log file
+        List<Parameter> params = (List<Parameter>)service.getParameters();
+        if (!params.isEmpty()) {
+            PrintWriter log = new PrintWriter(logManager.createLog("service-parameters"), false);
+            try {
+                for (Parameter param : params) {
+                    log.print(param.getName());
+                    log.print("=");
+                    log.println(param.getValue());
+                }
+            } finally {
+                log.close();
+            }
+        }
+        
+        // We want to receive all messages through the same operation:
+        service.addParameter(AxisService.SUPPORT_SINGLE_OP, true);
+        
         context.getAxisConfiguration().addService(service);
     }