messaginghub / pooled-jms

A JMS Connection pool for messaging applications supporting JMS 1.1 and 2.0 and Jakarta JMS clients
Apache License 2.0
50 stars 24 forks source link

JmsPoolReconnectOnFailureTest#testConnectionCanBeCreatedAfterFailure is broken #7

Closed jirkadanek closed 6 years ago

jirkadanek commented 6 years ago

https://github.com/messaginghub/pooled-jms/blob/5e2d8b2a5b403b7d3c27bd1a0fe644e7c0326417/pooled-jms/src/test/java/org/messaginghub/pooled/jms/JmsPoolReconnectOnFailureTest.java#L59-L61

2018-05-10 15:16:16,440 [main ] INFO JmsPoolConnectionFactory - Provided ConnectionFactory is JMS 2.0+ capable. 2018-05-10 15:16:16,629 [me-limited test] INFO JmsPoolReconnectOnFailureTest - Fetched new connection from the pool: JmsPoolConnection { ConnectionPool[org.messaginghub.pooled.jms.mock.MockJMSConnection@720d4b3] } 2018-05-10 15:16:16,716 [5e-f06f291b95df] INFO JmsPoolReconnectOnFailureTest - Pooled Connection failed 2018-05-10 15:16:16,721 [main ] DEBUG JmsPoolConnectionFactory - Stopping the PooledConnectionFactory, number of connections in cache: 0 2018-05-10 15:16:16,721 [main ] INFO JmsPoolTestSupport - ========== finished test testConnectionCanBeCreatedAfterFailure ========== java.lang.AssertionError: Should be disconnected at org.junit.Assert.fail(Assert.java:88) at org.messaginghub.pooled.jms.JmsPoolReconnectOnFailureTest.testConnectionCanBeCreatedAfterFailure(JmsPoolReconnectOnFailureTest.java:87) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.lang.Thread.run(Thread.java:844)
jirkadanek commented 6 years ago

Looks like the MockJMSSession#send is supposed to throw a JMSException when I attempt to send on a session belonging to failed connection but it doesn't. So I'd say the bug is in the incompleteness of the Mock objects, not in pooled-jms itself.

tabish121 commented 6 years ago

Fixed in commit 8ca2ffcfcc604c40cded0f95429f63c85d3d50f0