Details
-
Bug
-
Resolution: Done
-
Major
-
JBoss A-MQ 6.0
-
None
Description
According to specification, javax.jms.IllegalStateException should be thrown. ActiveMQXASession.getTransacted() calls method on transactionContext, which is null after the connection is closed.Testing code from TCK test looks like this:| public void closedQueueConnectionGetTransactedTest() throws Fault {|
boolean passed = false; |
try { |
createAndCloseConnection(JmsTool.QUEUE); |
logTrace("Try to call getTransacted() with closed connection."); |
try { |
boolean b = tool.getDefaultQueueSession().getTransacted(); |
logTrace("Fail: Exception was not thrown!"); |
{color:black}} catch (javax.jms.IllegalStateException ise) {{color} |
logTrace("Caught expected exception"); |
passed = true; |
{color:black}} catch (Exception e) {{color} |
TestUtil.printStackTrace(e); |
logTrace("Fail: wrong exception: " + e.getClass().getName() + " was returned"); |
{color:black}}| | if (!passed) { |
throw new Fault("Error: failures occurred during tests"); |
{color:black}}| | {color:black}} catch (Exception e) { |
throw new Fault("closedQueueConnectionGetTransactedTest", e); |
{color:black}}| | } |
createAndCloseConnection() method creates connection from factory, then creates nontransacted auto-acknowledged session, producer, consumer, then close the connection.