reta commented on code in PR #940:
URL: https://github.com/apache/cxf/pull/940#discussion_r855677308
##########
rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/util/MessageListenerTest.java:
##########
@@ -174,33 +183,21 @@ private void testTransactionalBehaviour(Connection
connection, Queue dest) throw
}
private static Connection createConnection(String name) throws
JMSException {
- ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://" +
name
- +
"?broker.persistent=false");
- cf.setRedeliveryPolicy(redeliveryPolicy());
+ ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://" +
name);
Connection connection = cf.createConnection();
connection.start();
return connection;
}
private static Connection createXAConnection(String name,
TransactionManager tm) throws JMSException {
- ActiveMQXAConnectionFactory cf = new
ActiveMQXAConnectionFactory("vm://" + name
- +
"?broker.persistent=false&jms.xaAckMode=1");
- cf.setRedeliveryPolicy(redeliveryPolicy());
- XaPooledConnectionFactory cfp = new XaPooledConnectionFactory(cf);
- cfp.setTransactionManager(tm);
- cfp.setConnectionFactory(cf);
- Connection connection = cfp.createConnection();
+ ActiveMQXAConnectionFactory cf = new
ActiveMQXAConnectionFactory("vm://" + name);
+ ConnectionFactory cf1 = new ConnectionFactoryProxy(cf, new
TransactionHelperImpl(tm));
Review Comment:
@ehsavoie I found a simpler way to integrate with JTA using
`ConnectionFactoryProxy` and `TransactionHelperImpl`, the tests are passing
right now (except `testConnectionProblemXA`, it has different cause).
```
[ERROR] Failures:
[ERROR]
JMSDestinationTest.testDoNotCreateSecurityContext:545->testSecurityContext:558->AbstractJMSTester.waitForReceiveDestMessage:278
Can't receive the Destination message in 10 seconds
[ERROR]
JMSDestinationTest.testProperty:424->verifyRequestResponseHeaders:303 The
message encoding should be equal expected:<U[TF-8]> but was:<U[S-ASCII]>
[ERROR] JMSDestinationTest.testRoundTripDestination:316 SecurityContext
should be set in message received by JMSDestination
[ERROR] JMSDestinationTest.testSecurityContext:538 SecurityContext should
be set in message received by JMSDestination
[ERROR] JMSDestinationTest.testTemporaryQueueDeletionUponReset:511
Expected: <1>
but: was <0>
[ERROR] MessageListenerTest.testConnectionProblemXA:104
Expected: a string containing "Wrapped exception."
but: was "Connection is closed"
[INFO]
[ERROR] Tests run: 65, Failures: 6, Errors: 0, Skipped: 1
[INFO]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]