Author: veithen
Date: Mon Oct 13 14:15:41 2008
New Revision: 704251

URL: http://svn.apache.org/viewvc?rev=704251&view=rev
Log:
* Transport test kit: Added some basic validation on metrics collection by the 
transport senders under test (messages sent, bytes sent).
* Mail transport: Fixed metrics collection in MailTransportSender (which didn't 
increase the metric for bytes sent).

Added:
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/MessageExchangeValidator.java
Modified:
    
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
    
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/WSMimeMessage.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisAsyncTestClient.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisRequestResponseTestClient.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClient.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClientContext.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/ContentTypeServiceConfigurator.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/client/ClientOptions.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/MessageTestCase.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/AsyncMessageTestCase.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/echo/RequestResponseMessageTestCase.java
    
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/misc/MinConcurrencyTest.java

Modified: 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
 Mon Oct 13 14:15:41 2008
@@ -439,19 +439,9 @@
 
             // update metrics
             metrics.incrementMessagesSent();
-            if (mimeMultiPart != null) {
-                for (int i=0; i<mimeMultiPart.getCount(); i++) {
-                    MimeBodyPart mbp = (MimeBodyPart) 
mimeMultiPart.getBodyPart(i);
-                    int size = mbp.getSize();
-                    if (size != -1) {
-                        metrics.incrementBytesSent(size);
-                    }
-                }
-            } else {
-                int size = message.getSize();
-                if (size != -1) {
-                    metrics.incrementBytesSent(size);
-                }
+            long bytesSent = message.getBytesSent();
+            if (bytesSent != -1) {
+                metrics.incrementBytesSent(bytesSent);
             }
 
         } catch (MessagingException e) {

Modified: 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/WSMimeMessage.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/WSMimeMessage.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/WSMimeMessage.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/WSMimeMessage.java
 Mon Oct 13 14:15:41 2008
@@ -19,7 +19,11 @@
 
 package org.apache.axis2.transport.mail;
 
+import java.io.IOException;
+import java.io.OutputStream;
+
 import org.apache.axiom.om.util.UUIDGenerator;
+import org.apache.commons.io.output.CountingOutputStream;
 
 import javax.mail.internet.MimeMessage;
 import javax.mail.MessagingException;
@@ -33,15 +37,32 @@
  * find out the relationship of a response to his request
  */
 public class WSMimeMessage extends MimeMessage {
+    private long bytesSent = -1;
 
     WSMimeMessage(Session session) {
         super(session);
     }
 
+    @Override
     protected void updateMessageID() throws MessagingException {
            if (getHeader(MailConstants.MAIL_HEADER_MESSAGE_ID) == null) {
             setHeader(MailConstants.MAIL_HEADER_MESSAGE_ID, 
UUIDGenerator.getUUID());    
         }
     }
-    
+
+    @Override
+    public void writeTo(OutputStream out, String[] ignoreHeaders)
+            throws MessagingException, IOException {
+        if (bytesSent == -1) {
+            CountingOutputStream countingOut = new CountingOutputStream(out);
+            super.writeTo(countingOut, ignoreHeaders);
+            bytesSent = countingOut.getByteCount();
+        } else {
+            super.writeTo(out, ignoreHeaders);
+        }
+    }
+
+    public long getBytesSent() {
+        return bytesSent;
+    }
 }

Added: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/MessageExchangeValidator.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/MessageExchangeValidator.java?rev=704251&view=auto
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/MessageExchangeValidator.java
 (added)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/MessageExchangeValidator.java
 Mon Oct 13 14:15:41 2008
@@ -0,0 +1,25 @@
+/*
+ *  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.transport.testkit;
+
+public interface MessageExchangeValidator {
+    void beforeSend() throws Exception;
+    void afterReceive() throws Exception;
+}

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisAsyncTestClient.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisAsyncTestClient.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisAsyncTestClient.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisAsyncTestClient.java
 Mon Oct 13 14:15:41 2008
@@ -38,6 +38,6 @@
     }
 
     public void sendMessage(ClientOptions options, ContentType contentType, 
AxisMessage message) throws Exception {
-        createClient(options, message, 
ServiceClient.ANON_OUT_ONLY_OP).execute(block);
+        send(options, message, ServiceClient.ANON_OUT_ONLY_OP, block, null);
     }
 }

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisRequestResponseTestClient.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisRequestResponseTestClient.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisRequestResponseTestClient.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisRequestResponseTestClient.java
 Mon Oct 13 14:15:41 2008
@@ -23,7 +23,6 @@
 
 import junit.framework.Assert;
 
-import org.apache.axis2.client.OperationClient;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.transport.testkit.axis2.MessageContextValidator;
@@ -44,9 +43,8 @@
     }
     
     public IncomingMessage<AxisMessage> sendMessage(ClientOptions options, 
ContentType contentType, AxisMessage message) throws Exception {
-        OperationClient mepClient = createClient(options, message, 
ServiceClient.ANON_OUT_IN_OP);
-        mepClient.execute(true);
-        MessageContext responseMsgContext = 
mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+        MessageContext responseMsgContext = send(options, message, 
ServiceClient.ANON_OUT_IN_OP,
+                true, WSDLConstants.MESSAGE_LABEL_IN_VALUE);
         Assert.assertFalse(responseMsgContext.isServerSide());
         for (MessageContextValidator validator : validators) {
             validator.validate(responseMsgContext, true);

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClient.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClient.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClient.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClient.java
 Mon Oct 13 14:15:41 2008
@@ -22,12 +22,17 @@
 import javax.mail.internet.ContentType;
 import javax.xml.namespace.QName;
 
+import junit.framework.Assert;
+
 import org.apache.axiom.attachments.Attachments;
 import org.apache.axis2.Constants;
 import org.apache.axis2.client.OperationClient;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.transport.TransportSender;
+import org.apache.axis2.transport.base.ManagementSupport;
+import org.apache.axis2.transport.testkit.MessageExchangeValidator;
 import org.apache.axis2.transport.testkit.channel.Channel;
 import org.apache.axis2.transport.testkit.client.ClientOptions;
 import org.apache.axis2.transport.testkit.client.TestClient;
@@ -39,14 +44,18 @@
 import org.apache.axis2.transport.testkit.util.ContentTypeUtil;
 
 @Name("axis")
-public class AxisTestClient implements TestClient {
+public class AxisTestClient implements TestClient, MessageExchangeValidator {
     private @Transient AxisTestClientConfigurator[] configurators;
+    private @Transient TransportSender sender;
     protected @Transient ServiceClient serviceClient;
     protected @Transient Options axisOptions;
+    private long messagesSent;
+    private long bytesSent;
     
     @Setup @SuppressWarnings("unused")
     private void setUp(AxisTestClientContext context, Channel channel, 
AxisTestClientConfigurator[] configurators) throws Exception {
         this.configurators = configurators;
+        sender = context.getSender();
         serviceClient = new ServiceClient(context.getConfigurationContext(), 
null);
         axisOptions = new Options();
         axisOptions.setTo(channel.getEndpointReference());
@@ -68,7 +77,17 @@
         }
     }
 
-    protected OperationClient createClient(ClientOptions options, AxisMessage 
message, QName operationQName) throws Exception {
+    public void beforeSend() throws Exception {
+        if (sender instanceof ManagementSupport) {
+            ManagementSupport sender = (ManagementSupport)this.sender;
+            messagesSent = sender.getMessagesSent();
+            bytesSent = sender.getBytesSent();
+        }
+    }
+
+    protected MessageContext send(ClientOptions options, AxisMessage message, 
QName operationQName,
+            boolean block, String resultMessageLabel) throws Exception {
+        
         OperationClient mepClient = serviceClient.createClient(operationQName);
         MessageContext mc = new MessageContext();
         mc.setProperty(Constants.Configuration.MESSAGE_TYPE, 
message.getMessageType());
@@ -85,7 +104,15 @@
         mc.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, 
options.getCharset());
         mc.setServiceContext(serviceClient.getServiceContext());
         mepClient.addMessageContext(mc);
-        
-        return mepClient;
+        mepClient.execute(block);
+        return resultMessageLabel == null ? null : 
mepClient.getMessageContext(resultMessageLabel);
+    }
+
+    public void afterReceive() throws Exception {
+        if (sender instanceof ManagementSupport) {
+            ManagementSupport sender = (ManagementSupport)this.sender;
+            Assert.assertEquals(messagesSent+1, sender.getMessagesSent());
+            Assert.assertTrue("No increase in bytes sent", 
sender.getBytesSent() > bytesSent);
+        }
     }
 }

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClientContext.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClientContext.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClientContext.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/client/AxisTestClientContext.java
 Mon Oct 13 14:15:41 2008
@@ -26,6 +26,7 @@
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.ListenerManager;
 import org.apache.axis2.transport.CustomAxisConfigurator;
+import org.apache.axis2.transport.TransportSender;
 import org.apache.axis2.transport.testkit.axis2.TransportDescriptionFactory;
 import org.apache.axis2.transport.testkit.tests.Setup;
 import org.apache.axis2.transport.testkit.tests.TearDown;
@@ -47,7 +48,7 @@
 public class AxisTestClientContext {
     public static final AxisTestClientContext INSTANCE = new 
AxisTestClientContext();
     
-    private @Transient TransportOutDescription trpOutDesc;
+    private @Transient TransportSender sender;
     private @Transient ConfigurationContext cfgCtx;
     private @Transient ListenerManager listenerManager;
     
@@ -58,9 +59,10 @@
         cfgCtx = ConfigurationContextFactory.createConfigurationContext(new 
CustomAxisConfigurator());
         AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
 
-        trpOutDesc = tdf.createTransportOutDescription();
+        TransportOutDescription trpOutDesc = 
tdf.createTransportOutDescription();
         axisCfg.addTransportOut(trpOutDesc);
-        trpOutDesc.getSender().init(cfgCtx, trpOutDesc);
+        sender = trpOutDesc.getSender();
+        sender.init(cfgCtx, trpOutDesc);
         
         boolean useListener = false;
         for (AxisTestClientContextConfigurator configurator : configurators) {
@@ -90,9 +92,13 @@
         }
     }
     
+    public TransportSender getSender() {
+        return sender;
+    }
+
     @TearDown @SuppressWarnings("unused")
     private void tearDown() throws Exception {
-        trpOutDesc.getSender().stop();
+        sender.stop();
         if (listenerManager != null) {
             listenerManager.stop();
             listenerManager.destroy();

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/ContentTypeServiceConfigurator.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/ContentTypeServiceConfigurator.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/ContentTypeServiceConfigurator.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/axis2/endpoint/ContentTypeServiceConfigurator.java
 Mon Oct 13 14:15:41 2008
@@ -24,7 +24,6 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.transport.testkit.axis2.AxisServiceConfigurator;
 import org.apache.axis2.transport.testkit.client.ClientOptions;
-import org.apache.axis2.transport.testkit.client.TestClient;
 import org.apache.axis2.transport.testkit.tests.Setup;
 import org.apache.axis2.transport.testkit.tests.Transient;
 
@@ -37,8 +36,8 @@
     }
 
     @Setup @SuppressWarnings("unused")
-    private void setUp(TestClient client, ClientOptions options) throws 
Exception {
-        contentType = client.getContentType(options, 
options.getBaseContentType());
+    private void setUp(ClientOptions options) throws Exception {
+        contentType = options.getTransportContentType();
     }
 
     public void setupService(AxisService service, boolean isClientSide) throws 
Exception {

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/client/ClientOptions.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/client/ClientOptions.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/client/ClientOptions.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/client/ClientOptions.java
 Mon Oct 13 14:15:41 2008
@@ -24,18 +24,19 @@
 import org.apache.axiom.om.util.UUIDGenerator;
 
 public class ClientOptions {
-    private final ContentType baseContentType;
+    private final ContentType transportContentType;
     private final String charset;
     private String mimeBoundary;
     private String rootContentId;
 
-    public ClientOptions(ContentType baseContentType, String charset) {
-        this.baseContentType = baseContentType;
+    // TODO: this is ugly; find a better solution
+    public ClientOptions(TestClient client, ContentType baseContentType, 
String charset) throws Exception {
         this.charset = charset;
+        transportContentType = client.getContentType(this, baseContentType);
     }
 
-    public ContentType getBaseContentType() {
-        return baseContentType;
+    public ContentType getTransportContentType() {
+        return transportContentType;
     }
 
     public String getCharset() {

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/MessageTestCase.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/MessageTestCase.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/MessageTestCase.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/MessageTestCase.java
 Mon Oct 13 14:15:41 2008
@@ -21,14 +21,49 @@
 
 import javax.mail.internet.ContentType;
 
+import org.apache.axis2.transport.testkit.Adapter;
+import org.apache.axis2.transport.testkit.MessageExchangeValidator;
 import org.apache.axis2.transport.testkit.client.ClientOptions;
+import org.apache.axis2.transport.testkit.client.TestClient;
 
-public class MessageTestCase extends ManagedTestCase {
+public abstract class MessageTestCase extends ManagedTestCase {
+    protected final ContentType contentType;
     protected final ClientOptions options;
+    private @Transient MessageExchangeValidator[] validators;
 
-    public MessageTestCase(ContentType contentType, String charset, Object... 
resources) {
+    public MessageTestCase(TestClient client, ContentType contentType, String 
charset, Object... resources) {
         super(resources);
-        options = new ClientOptions(contentType, charset);
+        if (client instanceof Adapter) {
+            addResource(((Adapter)client).getTarget());
+        } else {
+            addResource(client);
+        }
+        this.contentType = contentType;
+        try {
+            options = new ClientOptions(client, contentType, charset);
+        } catch (Exception ex) {
+            // TODO: handle this in a better way
+            throw new Error(ex);
+        }
         addResource(options);
+        addResource(this);
     }
+    
+    @Setup @SuppressWarnings("unused")
+    private void setUp(MessageExchangeValidator[] validators) {
+        this.validators = validators;
+    }
+    
+    @Override
+    protected void runTest() throws Throwable {
+        for (MessageExchangeValidator validator : validators) {
+            validator.beforeSend();
+        }
+        doRunTest();
+        for (MessageExchangeValidator validator : validators) {
+            validator.afterReceive();
+        }
+    }
+
+    protected abstract void doRunTest() throws Throwable;
 }

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/AsyncMessageTestCase.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/AsyncMessageTestCase.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/AsyncMessageTestCase.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/AsyncMessageTestCase.java
 Mon Oct 13 14:15:41 2008
@@ -33,22 +33,21 @@
     
     // TODO: maybe we don't need an explicit AsyncChannel
     public AsyncMessageTestCase(AsyncChannel channel, AsyncTestClient<M> 
client, AsyncEndpoint<M> endpoint, ContentType contentType, String charset, 
Object... resources) {
-        super(contentType, charset, resources);
+        super(client, contentType, charset, resources);
         this.client = client;
         this.endpoint = endpoint;
         addResource(channel);
-        addResource(client);
         addResource(endpoint);
     }
 
     @Override
-    protected void runTest() throws Throwable {
+    protected void doRunTest() throws Throwable {
         endpoint.clear();
         M expected = prepareMessage();
         
         // Run the test.
 //                    contentTypeMode == ContentTypeMode.TRANSPORT ? 
contentType : null);
-        client.sendMessage(options, options.getBaseContentType(), expected);
+        client.sendMessage(options, contentType, expected);
         IncomingMessage<M> actual = endpoint.waitForMessage(8000);
         if (actual == null) {
             fail("Failed to get message");

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/echo/RequestResponseMessageTestCase.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/echo/RequestResponseMessageTestCase.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/echo/RequestResponseMessageTestCase.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/echo/RequestResponseMessageTestCase.java
 Mon Oct 13 14:15:41 2008
@@ -32,22 +32,21 @@
 
     // TODO: maybe we don't need an explicit RequestResponseChannel
     public RequestResponseMessageTestCase(RequestResponseChannel channel, 
RequestResponseTestClient<M,N> client, InOutEndpoint endpoint, ContentType 
contentType, String charset, Object... resources) {
-        super(contentType, charset, resources);
+        super(client, contentType, charset, resources);
         this.client = client;
         this.endpoint = endpoint;
         addResource(channel);
-        addResource(client);
         addResource(endpoint);
     }
     
     @Override
-    protected void runTest() throws Throwable {
+    protected void doRunTest() throws Throwable {
         M request = prepareRequest();
         InterruptingEndpointErrorListener listener = new 
InterruptingEndpointErrorListener(Thread.currentThread());
         N response;
         endpoint.addEndpointErrorListener(listener);
         try {
-            response = client.sendMessage(options, 
options.getBaseContentType(), request).getData();
+            response = client.sendMessage(options, contentType, 
request).getData();
         } catch (Throwable ex) {
             if (listener.getException() != null) {
                 throw listener.getException();

Modified: 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/misc/MinConcurrencyTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/misc/MinConcurrencyTest.java?rev=704251&r1=704250&r2=704251&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/misc/MinConcurrencyTest.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/misc/MinConcurrencyTest.java
 Mon Oct 13 14:15:41 2008
@@ -122,7 +122,7 @@
                     endpointResourceSets[i] = endpointResourceSet;
                 }
                 for (int j=0; j<messages; j++) {
-                    ClientOptions options = new ClientOptions(new 
ContentType(SOAP11Constants.SOAP_11_CONTENT_TYPE), "UTF-8");
+                    ClientOptions options = new ClientOptions(client, new 
ContentType(SOAP11Constants.SOAP_11_CONTENT_TYPE), "UTF-8");
                     AxisMessage message = new AxisMessage();
                     
message.setMessageType(SOAP11Constants.SOAP_11_CONTENT_TYPE);
                     SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();


Reply via email to