summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2006-12-13 12:03:14 +0000
committerMartin Ritchie <ritchiem@apache.org>2006-12-13 12:03:14 +0000
commit52c4df998ad3cbc05d1a87250ebf6715b0e346f3 (patch)
tree8b7cf94775965222186b7b27f422e54a5b5b6d45 /java
parentceb9cce91c42e69644bca614647099a5d5f4a3c7 (diff)
downloadqpid-python-52c4df998ad3cbc05d1a87250ebf6715b0e346f3.tar.gz
QPID-172
The PoolingFilterTest.java would throw an ugly NullPointerException. This was due to there being no next filter. So Created a NoOpFilter that prevents this. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@486610 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java45
1 files changed, 44 insertions, 1 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java b/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
index af1a28e787..972a935257 100644
--- a/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
+++ b/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
@@ -23,6 +23,9 @@ package org.apache.qpid.pool;
import junit.framework.TestCase;
import junit.framework.Assert;
import org.apache.qpid.session.TestSession;
+import org.apache.mina.common.IoFilter;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.common.IdleStatus;
import java.util.concurrent.RejectedExecutionException;
@@ -43,7 +46,7 @@ public class PoolingFilterTest extends TestCase
public void testRejectedExecution() throws Exception
{
- _pool.filterWrite(null, new TestSession(), null);
+ _pool.filterWrite(new NoOpFilter(), new TestSession(), new IoFilter.WriteRequest("Message"));
//Shutdown the pool
_executorService.getPool().shutdownNow();
@@ -58,4 +61,44 @@ public class PoolingFilterTest extends TestCase
Assert.fail("RejectedExecutionException should not occur after pool has shutdown:" + rje);
}
}
+
+ private static class NoOpFilter implements IoFilter.NextFilter
+ {
+
+ public void sessionOpened(IoSession session)
+ {
+ }
+
+ public void sessionClosed(IoSession session)
+ {
+ }
+
+ public void sessionIdle(IoSession session, IdleStatus status)
+ {
+ }
+
+ public void exceptionCaught(IoSession session, Throwable cause)
+ {
+ }
+
+ public void messageReceived(IoSession session, Object message)
+ {
+ }
+
+ public void messageSent(IoSession session, Object message)
+ {
+ }
+
+ public void filterWrite(IoSession session, IoFilter.WriteRequest writeRequest)
+ {
+ }
+
+ public void filterClose(IoSession session)
+ {
+ }
+
+ public void sessionCreated(IoSession session)
+ {
+ }
+ }
}