Author: veithen
Date: Tue Oct 14 14:55:13 2008
New Revision: 704706
URL: http://svn.apache.org/viewvc?rev=704706&view=rev
Log:
JMS transport tests: Added ExceptionListeners to the connections used by
MockEchoEndpoint.
Modified:
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/MockEchoEndpoint.java
Modified:
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/MockEchoEndpoint.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/MockEchoEndpoint.java?rev=704706&r1=704705&r2=704706&view=diff
==============================================================================
---
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/MockEchoEndpoint.java
(original)
+++
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/MockEchoEndpoint.java
Tue Oct 14 14:55:13 2008
@@ -22,6 +22,8 @@
import javax.jms.BytesMessage;
import javax.jms.Connection;
import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
@@ -40,7 +42,7 @@
import org.apache.commons.logging.LogFactory;
@Name("mock")
-public class MockEchoEndpoint extends InOutEndpointSupport implements
InOutEndpoint {
+public class MockEchoEndpoint extends InOutEndpointSupport implements
InOutEndpoint, ExceptionListener {
static Log log = LogFactory.getLog(MockEchoEndpoint.class);
private @Transient Connection connection;
@@ -51,8 +53,10 @@
Destination destination = channel.getDestination();
Destination replyDestination = channel.getReplyDestination();
connection = env.getConnectionFactory().createConnection();
+ connection.setExceptionListener(this);
connection.start();
replyConnection = env.getConnectionFactory().createConnection();
+ replyConnection.setExceptionListener(this);
final Session replySession = replyConnection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
final MessageProducer producer =
replySession.createProducer(replyDestination);
MessageConsumer consumer = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE).createConsumer(destination);
@@ -87,4 +91,9 @@
connection.close();
replyConnection.close();
}
+
+ public void onException(JMSException ex) {
+ log.error("Exception received by JMS exception listener", ex);
+ fireEndpointError(ex);
+ }
}