Skip to content
Permalink
Browse files
Added some more logging to investigate Synapse build problem.
  • Loading branch information
veithen committed May 15, 2010
1 parent 446a106 commit 9f61364a9a6a7b840c0f372d6837202316fab9ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
@@ -152,6 +152,7 @@ public void afterReceive() throws Exception {
}
}
}
log.debug("Message level metrics check OK");
}
}
}
@@ -25,8 +25,12 @@
import org.apache.axis2.transport.testkit.MessageExchangeValidator;
import org.apache.axis2.transport.testkit.client.ClientOptions;
import org.apache.axis2.transport.testkit.client.TestClient;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public abstract class MessageTestCase extends ManagedTestCase {
private static final Log log = LogFactory.getLog(MessageTestCase.class);

protected final ContentType contentType;
protected final ClientOptions options;
private @Transient MessageExchangeValidator[] validators;
@@ -61,6 +65,7 @@ protected void runTest() throws Throwable {
}
doRunTest();
for (MessageExchangeValidator validator : validators) {
log.debug("Invoking message exchange validator " + validator.getClass().getName());
validator.afterReceive();
}
}
@@ -26,8 +26,12 @@
import org.apache.axis2.transport.testkit.endpoint.AsyncEndpoint;
import org.apache.axis2.transport.testkit.message.IncomingMessage;
import org.apache.axis2.transport.testkit.tests.MessageTestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public abstract class AsyncMessageTestCase<M> extends MessageTestCase {
private static final Log log = LogFactory.getLog(AsyncMessageTestCase.class);

private final AsyncTestClient<M> client;
private final AsyncEndpoint<M> endpoint;

@@ -43,17 +47,23 @@ public AsyncMessageTestCase(AsyncChannel channel, AsyncTestClient<M> client, Asy
@Override
protected void doRunTest() throws Throwable {
endpoint.clear();
log.debug("Preparing message");
M expected = prepareMessage();

// Run the test.
// contentTypeMode == ContentTypeMode.TRANSPORT ? contentType : null);
log.debug("Sending message");
client.sendMessage(options, contentType, expected);
log.debug("Message sent; waiting for response");
IncomingMessage<M> actual = endpoint.waitForMessage(8000);
if (actual == null) {
log.debug("No response received");
fail("Failed to get message");
}

log.debug("Response received; checking message data");
checkMessageData(expected, actual.getData());
log.debug("Response has expected content");
}

protected abstract M prepareMessage() throws Exception;

0 comments on commit 9f61364

Please sign in to comment.