You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/04/09 16:10:11 UTC
[1/2] git commit: Polish the camel-cxf test code to shutdown the
spring application context when tearing down the test
Repository: camel
Updated Branches:
refs/heads/camel-2.12.x ad9a87acf -> 3e6fcc0ac
refs/heads/camel-2.13.x 685e60dc8 -> dea8545d4
Polish the camel-cxf test code to shutdown the spring application context when tearing down the test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3e6fcc0a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3e6fcc0a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3e6fcc0a
Branch: refs/heads/camel-2.12.x
Commit: 3e6fcc0ac545e88b8b2b7837d624d65b2df6981f
Parents: ad9a87a
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Apr 9 21:58:52 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Apr 9 22:09:15 2014 +0800
----------------------------------------------------------------------
.../cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java | 10 ++++++++--
.../cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java | 9 +++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/3e6fcc0a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
index f6c7d23..a71946a 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
@@ -31,6 +31,7 @@ import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -42,11 +43,12 @@ public class CxfRsProducerClientFactoryCache2Test extends Assert {
private CamelContext context2;
private ProducerTemplate template2;
+ private AbstractApplicationContext applicationContext;
@Before
public void setUp() throws Exception {
- AbstractApplicationContext ac = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml");
- context2 = SpringCamelContext.springCamelContext(ac, false);
+ applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml");
+ context2 = SpringCamelContext.springCamelContext(applicationContext, false);
context2.start();
template2 = context2.createProducerTemplate();
@@ -59,6 +61,10 @@ public class CxfRsProducerClientFactoryCache2Test extends Assert {
context2.stop();
template2.stop();
}
+ // need to shutdown the application context to shutdown the bus
+ if (applicationContext != null) {
+ applicationContext.close();
+ }
}
@Test
http://git-wip-us.apache.org/repos/asf/camel/blob/3e6fcc0a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
index ce2a54a..c0ebe14 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
@@ -41,11 +41,12 @@ public class CxfRsProducerClientFactoryCacheTest extends Assert {
private CamelContext context1;
private ProducerTemplate template1;
+ private AbstractApplicationContext applicationContext;
@Before
public void setUp() throws Exception {
- AbstractApplicationContext ac = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml");
- context1 = SpringCamelContext.springCamelContext(ac, false);
+ applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml");
+ context1 = SpringCamelContext.springCamelContext(applicationContext, false);
context1.start();
template1 = context1.createProducerTemplate();
template1.start();
@@ -57,6 +58,10 @@ public class CxfRsProducerClientFactoryCacheTest extends Assert {
context1.stop();
template1.stop();
}
+ // need to shutdown the application context to shutdown the bus
+ if (applicationContext != null) {
+ applicationContext.close();
+ }
}
@Test
[2/2] git commit: Polish the camel-cxf test code to shutdown the
spring application context when tearing down the test
Posted by ni...@apache.org.
Polish the camel-cxf test code to shutdown the spring application context when tearing down the test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dea8545d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dea8545d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dea8545d
Branch: refs/heads/camel-2.13.x
Commit: dea8545d48f7400dc5c584b33eba7df6b4970a37
Parents: 685e60d
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Apr 9 21:58:52 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Apr 9 22:09:24 2014 +0800
----------------------------------------------------------------------
.../cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java | 10 ++++++++--
.../cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java | 9 +++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/dea8545d/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
index f6c7d23..a71946a 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCache2Test.java
@@ -31,6 +31,7 @@ import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -42,11 +43,12 @@ public class CxfRsProducerClientFactoryCache2Test extends Assert {
private CamelContext context2;
private ProducerTemplate template2;
+ private AbstractApplicationContext applicationContext;
@Before
public void setUp() throws Exception {
- AbstractApplicationContext ac = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml");
- context2 = SpringCamelContext.springCamelContext(ac, false);
+ applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml");
+ context2 = SpringCamelContext.springCamelContext(applicationContext, false);
context2.start();
template2 = context2.createProducerTemplate();
@@ -59,6 +61,10 @@ public class CxfRsProducerClientFactoryCache2Test extends Assert {
context2.stop();
template2.stop();
}
+ // need to shutdown the application context to shutdown the bus
+ if (applicationContext != null) {
+ applicationContext.close();
+ }
}
@Test
http://git-wip-us.apache.org/repos/asf/camel/blob/dea8545d/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
index ce2a54a..c0ebe14 100644
--- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
+++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
@@ -41,11 +41,12 @@ public class CxfRsProducerClientFactoryCacheTest extends Assert {
private CamelContext context1;
private ProducerTemplate template1;
+ private AbstractApplicationContext applicationContext;
@Before
public void setUp() throws Exception {
- AbstractApplicationContext ac = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml");
- context1 = SpringCamelContext.springCamelContext(ac, false);
+ applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml");
+ context1 = SpringCamelContext.springCamelContext(applicationContext, false);
context1.start();
template1 = context1.createProducerTemplate();
template1.start();
@@ -57,6 +58,10 @@ public class CxfRsProducerClientFactoryCacheTest extends Assert {
context1.stop();
template1.stop();
}
+ // need to shutdown the application context to shutdown the bus
+ if (applicationContext != null) {
+ applicationContext.close();
+ }
}
@Test