You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2013/09/30 16:39:18 UTC
git commit: Polished the comments a bit.
Updated Branches:
refs/heads/master a2fcaa54b -> c55c104c3
Polished the comments a bit.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c55c104c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c55c104c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c55c104c
Branch: refs/heads/master
Commit: c55c104c3be3e5b40d50063e9b2aefd231ff149d
Parents: a2fcaa5
Author: Babak Vahdat <bv...@apache.org>
Authored: Mon Sep 30 16:39:07 2013 +0200
Committer: Babak Vahdat <bv...@apache.org>
Committed: Mon Sep 30 16:39:07 2013 +0200
----------------------------------------------------------------------
...pringQuartzConsumerTwoAppsClusteredFailoverTest.java | 12 +++++++-----
.../SpringQuartzTwoAppsClusteredFailoverTest.java | 12 +++++++-----
2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/c55c104c/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
index 9a5efdb..13773c7 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzConsumerTwoAppsClusteredFailoverTest.java
@@ -38,11 +38,13 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
AbstractXmlApplicationContext db = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzConsumerClusteredAppDatabase.xml");
db.start();
- // now launch the first clustered app
+ // now launch the first clustered app which will acquire the quartz
+ // database lock and become the master
AbstractXmlApplicationContext app = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzConsumerClusteredAppOne.xml");
app.start();
- // as well as the second one
+ // as well as the second one which will run in slave modus as it will
+ // not be able to acquire the same lock
AbstractXmlApplicationContext app2 = new ClassPathXmlApplicationContext("org/apache/camel/component/quartz/SpringQuartzConsumerClusteredAppTwo.xml");
app2.start();
@@ -57,7 +59,7 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
mock.assertIsSatisfied();
- // now let's simulate a crash of the first app
+ // now let's simulate a crash of the first app (the quartz instance 'app-one')
log.warn("The first app is going to crash NOW!");
app.close();
@@ -67,7 +69,7 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
// wait long enough until the second app takes it over...
Thread.sleep(20000);
- // inside the logs one can then clearly see how the route of the second CamelContext gets started:
+ // inside the logs one can then clearly see how the route of the second app ('app-two') starts consuming:
// 2013-09-28 19:50:43,900 [main ] WARN ntTwoAppsClusteredFailoverTest - Crashed...
// 2013-09-28 19:50:43,900 [main ] WARN ntTwoAppsClusteredFailoverTest - Crashed...
// 2013-09-28 19:50:43,900 [main ] WARN ntTwoAppsClusteredFailoverTest - Crashed...
@@ -83,7 +85,7 @@ public class SpringQuartzConsumerTwoAppsClusteredFailoverTest extends TestSuppor
mock2.assertIsSatisfied();
- // stop the second app as we're already done
+ // close the second app as we're done now
app2.close();
// and as the last step shutdown the database...
http://git-wip-us.apache.org/repos/asf/camel/blob/c55c104c/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
index 8d9fc4f..c6cffad 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzTwoAppsClusteredFailoverTest.java
@@ -37,11 +37,13 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport {
AbstractXmlApplicationContext db = new ClassPathXmlApplicationContext("org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppDatabase.xml");
db.start();
- // now launch the first clustered app
+ // now launch the first clustered app which will acquire the quartz
+ // database lock and become the master
AbstractXmlApplicationContext app = new ClassPathXmlApplicationContext("org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppOne.xml");
app.start();
- // as well as the second one
+ // as well as the second one which will run in slave modus as it will
+ // not be able to acquire the same lock
AbstractXmlApplicationContext app2 = new ClassPathXmlApplicationContext("org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppTwo.xml");
app2.start();
@@ -58,7 +60,7 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport {
mock.assertIsSatisfied();
- // now let's simulate a crash of the first app
+ // now let's simulate a crash of the first app (the quartz instance 'app-one')
log.warn("The first app is going to crash NOW!");
app.close();
@@ -68,7 +70,7 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport {
// wait long enough until the second app takes it over...
Thread.sleep(20000);
- // inside the logs one can then clearly see how the route of the second CamelContext gets started:
+ // inside the logs one can then clearly see how the route of the second app ('app-two') gets started:
// 2013-09-24 22:51:34,215 [main ] WARN ersistentStoreClusteredAppTest - Crashed...
// 2013-09-24 22:51:34,215 [main ] WARN ersistentStoreClusteredAppTest - Crashed...
// 2013-09-24 22:51:34,215 [main ] WARN ersistentStoreClusteredAppTest - Crashed...
@@ -86,7 +88,7 @@ public class SpringQuartzTwoAppsClusteredFailoverTest extends TestSupport {
mock2.assertIsSatisfied();
- // stop the second app as we're already done
+ // close the second app as we're done now
app2.close();
// and as the last step shutdown the database...