You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by cs...@apache.org on 2017/04/28 13:16:57 UTC
cxf git commit: Extract connection closing
Repository: cxf
Updated Branches:
refs/heads/master ab25fa963 -> 02fd70cd6
Extract connection closing
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/02fd70cd
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/02fd70cd
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/02fd70cd
Branch: refs/heads/master
Commit: 02fd70cd617803bb3beba7f7df3e9b121a344735
Parents: ab25fa9
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Fri Apr 28 15:16:43 2017 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Fri Apr 28 15:16:53 2017 +0200
----------------------------------------------------------------------
.../cxf/systest/jaxrs/jms/JAXRSJmsTest.java | 47 +++++++-------------
1 file changed, 15 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/02fd70cd/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jms/JAXRSJmsTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jms/JAXRSJmsTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jms/JAXRSJmsTest.java
index 96d2898..bf6ec2a 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jms/JAXRSJmsTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jms/JAXRSJmsTest.java
@@ -126,14 +126,7 @@ public class JAXRSJmsTest extends AbstractBusClientServerTestBase {
checkBookInResponse(session, replyToDestination, 129L, "OneWay From WebClient");
session.close();
} finally {
- try {
- if (connection != null) {
- connection.stop();
- connection.close();
- }
- } catch (JMSException ex) {
- // ignore
- }
+ close(connection);
}
}
@@ -217,14 +210,7 @@ public class JAXRSJmsTest extends AbstractBusClientServerTestBase {
checkBookInResponse(session, replyToDestination, 123L, "CXF JMS Rocks");
session.close();
} finally {
- try {
- if (connection != null) {
- connection.stop();
- connection.close();
- }
- } catch (JMSException ex) {
- // ignore
- }
+ close(connection);
}
}
@@ -247,14 +233,7 @@ public class JAXRSJmsTest extends AbstractBusClientServerTestBase {
checkBookInResponse(session, replyToDestination, 124L, "JMS");
session.close();
} finally {
- try {
- if (connection != null) {
- connection.stop();
- connection.close();
- }
- } catch (JMSException ex) {
- // ignore
- }
+ close(connection);
}
}
@@ -276,14 +255,7 @@ public class JAXRSJmsTest extends AbstractBusClientServerTestBase {
checkBookInResponse(session, replyToDestination, 125L, "JMS OneWay");
session.close();
} finally {
- try {
- if (connection != null) {
- connection.stop();
- connection.close();
- }
- } catch (JMSException ex) {
- // ignore
- }
+ close(connection);
}
}
@@ -385,4 +357,15 @@ public class JAXRSJmsTest extends AbstractBusClientServerTestBase {
return bos.toByteArray();
}
+ private void close(Connection connection) {
+ try {
+ if (connection != null) {
+ connection.stop();
+ connection.close();
+ }
+ } catch (JMSException ex) {
+ // ignore
+ }
+ }
+
}