Skip to content

Commit 23a1d07

Browse files
committed
JMS SingleConnectionFactory uses minimized number of start calls (for Oracle AQ; SPR-5987)
1 parent 83bd56c commit 23a1d07

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

org.springframework.jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2009 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public void testWithConnection() throws JMSException {
4242
Connection con = (Connection) conControl.getMock();
4343

4444
con.start();
45-
conControl.setVoidCallable(2);
45+
conControl.setVoidCallable(1);
4646
con.stop();
4747
conControl.setVoidCallable(1);
4848
con.close();
@@ -56,7 +56,7 @@ public void testWithConnection() throws JMSException {
5656
con1.stop(); // should be ignored
5757
con1.close(); // should be ignored
5858
Connection con2 = scf.createConnection();
59-
con2.start();
59+
con2.start(); // should be ignored
6060
con2.stop(); // should be ignored
6161
con2.close(); // should be ignored
6262
scf.destroy(); // should trigger actual close
@@ -69,7 +69,7 @@ public void testWithQueueConnection() throws JMSException {
6969
Connection con = (QueueConnection) conControl.getMock();
7070

7171
con.start();
72-
conControl.setVoidCallable(2);
72+
conControl.setVoidCallable(1);
7373
con.stop();
7474
conControl.setVoidCallable(1);
7575
con.close();
@@ -96,7 +96,7 @@ public void testWithTopicConnection() throws JMSException {
9696
Connection con = (TopicConnection) conControl.getMock();
9797

9898
con.start();
99-
conControl.setVoidCallable(2);
99+
conControl.setVoidCallable(1);
100100
con.stop();
101101
conControl.setVoidCallable(1);
102102
con.close();
@@ -127,7 +127,7 @@ public void testWithConnectionFactory() throws JMSException {
127127
cf.createConnection();
128128
cfControl.setReturnValue(con, 1);
129129
con.start();
130-
conControl.setVoidCallable(2);
130+
conControl.setVoidCallable(1);
131131
con.stop();
132132
conControl.setVoidCallable(1);
133133
con.close();
@@ -158,7 +158,7 @@ public void testWithQueueConnectionFactoryAndJms11Usage() throws JMSException {
158158
cf.createConnection();
159159
cfControl.setReturnValue(con, 1);
160160
con.start();
161-
conControl.setVoidCallable(2);
161+
conControl.setVoidCallable(1);
162162
con.stop();
163163
conControl.setVoidCallable(1);
164164
con.close();
@@ -189,7 +189,7 @@ public void testWithQueueConnectionFactoryAndJms102Usage() throws JMSException {
189189
cf.createQueueConnection();
190190
cfControl.setReturnValue(con, 1);
191191
con.start();
192-
conControl.setVoidCallable(2);
192+
conControl.setVoidCallable(1);
193193
con.stop();
194194
conControl.setVoidCallable(1);
195195
con.close();
@@ -220,7 +220,7 @@ public void testWithTopicConnectionFactoryAndJms11Usage() throws JMSException {
220220
cf.createConnection();
221221
cfControl.setReturnValue(con, 1);
222222
con.start();
223-
conControl.setVoidCallable(2);
223+
conControl.setVoidCallable(1);
224224
con.stop();
225225
conControl.setVoidCallable(1);
226226
con.close();
@@ -251,7 +251,7 @@ public void testWithTopicConnectionFactoryAndJms102Usage() throws JMSException {
251251
cf.createTopicConnection();
252252
cfControl.setReturnValue(con, 1);
253253
con.start();
254-
conControl.setVoidCallable(2);
254+
conControl.setVoidCallable(1);
255255
con.stop();
256256
conControl.setVoidCallable(1);
257257
con.close();
@@ -284,7 +284,7 @@ public void testWithConnectionFactoryAndClientId() throws JMSException {
284284
con.setClientID("myId");
285285
conControl.setVoidCallable(1);
286286
con.start();
287-
conControl.setVoidCallable(2);
287+
conControl.setVoidCallable(1);
288288
con.stop();
289289
conControl.setVoidCallable(1);
290290
con.close();
@@ -321,7 +321,7 @@ public void testWithConnectionFactoryAndExceptionListener() throws JMSException
321321
con.getExceptionListener();
322322
conControl.setReturnValue(listener, 1);
323323
con.start();
324-
conControl.setVoidCallable(2);
324+
conControl.setVoidCallable(1);
325325
con.stop();
326326
conControl.setVoidCallable(1);
327327
con.close();
@@ -407,7 +407,7 @@ public void testConnectionFactory102WithQueue() throws JMSException {
407407
cf.createQueueConnection();
408408
cfControl.setReturnValue(con, 1);
409409
con.start();
410-
conControl.setVoidCallable(2);
410+
conControl.setVoidCallable(1);
411411
con.stop();
412412
conControl.setVoidCallable(1);
413413
con.close();
@@ -438,7 +438,7 @@ public void testConnectionFactory102WithTopic() throws JMSException {
438438
cf.createTopicConnection();
439439
cfControl.setReturnValue(con, 1);
440440
con.start();
441-
conControl.setVoidCallable(2);
441+
conControl.setVoidCallable(1);
442442
con.stop();
443443
conControl.setVoidCallable(1);
444444
con.close();
@@ -487,7 +487,7 @@ public void testCachingConnectionFactory() throws JMSException {
487487
nonTxSession.close();
488488
nonTxSessionControl.setVoidCallable(1);
489489
con.start();
490-
conControl.setVoidCallable(2);
490+
conControl.setVoidCallable(1);
491491
con.stop();
492492
conControl.setVoidCallable(1);
493493
con.close();
@@ -549,7 +549,7 @@ public void testCachingConnectionFactoryWithQueueConnectionFactoryAndJms102Usage
549549
nonTxSession.close();
550550
nonTxSessionControl.setVoidCallable(1);
551551
con.start();
552-
conControl.setVoidCallable(2);
552+
conControl.setVoidCallable(1);
553553
con.stop();
554554
conControl.setVoidCallable(1);
555555
con.close();
@@ -611,7 +611,7 @@ public void testCachingConnectionFactoryWithTopicConnectionFactoryAndJms102Usage
611611
nonTxSession.close();
612612
nonTxSessionControl.setVoidCallable(1);
613613
con.start();
614-
conControl.setVoidCallable(2);
614+
conControl.setVoidCallable(1);
615615
con.stop();
616616
conControl.setVoidCallable(1);
617617
con.close();

0 commit comments

Comments
 (0)