Polishing

This commit is contained in:
Juergen Hoeller
2014-10-29 22:44:59 +01:00
parent 4927c9054f
commit 1146d5ba1d
31 changed files with 447 additions and 455 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,7 +76,7 @@ public class DelegatingConnectionFactory
/**
* Indicate whether Connections obtained from the target factory are supposed
* to be stopped before closed ("true") or simply closed ("false").
* The latter may be necessary for some connection pools that simply return
* An extra stop call may be necessary for some connection pools that simply return
* released connections to the pool, not stopping them while they sit in the pool.
* <p>Default is "false", simply closing Connections.
* @see ConnectionFactoryUtils#releaseConnection

View File

@@ -72,13 +72,19 @@ import static org.mockito.BDDMockito.*;
public class JmsTemplateTests {
private Context jndiContext;
private ConnectionFactory connectionFactory;
protected Connection connection;
private Session session;
private Destination queue;
private int deliveryMode = DeliveryMode.PERSISTENT;
private int priority = 9;
private int timeToLive = 10000;
@@ -94,8 +100,7 @@ public class JmsTemplateTests {
queue = mock(Queue.class);
given(connectionFactory.createConnection()).willReturn(connection);
given(connection.createSession(useTransactedTemplate(),
Session.AUTO_ACKNOWLEDGE)).willReturn(session);
given(connection.createSession(useTransactedTemplate(), Session.AUTO_ACKNOWLEDGE)).willReturn(session);
given(session.getTransacted()).willReturn(useTransactedSession());
given(jndiContext.lookup("testDestination")).willReturn(queue);
}
@@ -126,6 +131,7 @@ public class JmsTemplateTests {
return session;
}
@Test
public void testExceptionStackTrace() {
JMSException jmsEx = new JMSException("could not connect");

View File

@@ -30,12 +30,12 @@ public class JmsTemplateTransactedTests extends JmsTemplateTests {
private Session localSession;
@Override
public void setupMocks() throws Exception {
super.setupMocks();
this.localSession = mock(Session.class);
given(this.connection.createSession(false,
Session.AUTO_ACKNOWLEDGE)).willReturn(this.localSession);
given(this.connection.createSession(false, Session.AUTO_ACKNOWLEDGE)).willReturn(this.localSession);
}
@Override