Repository: camel Updated Branches: refs/heads/master 1a8a22256 -> 1483499e0
Skip tests on windows as it does not test well there with live ports. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1483499e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1483499e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1483499e Branch: refs/heads/master Commit: 1483499e021acdc991447634989c210a102c1fab Parents: 1a8a222 Author: Claus Ibsen <[email protected]> Authored: Thu Mar 5 12:00:10 2015 +0100 Committer: Claus Ibsen <[email protected]> Committed: Thu Mar 5 12:00:10 2015 +0100 ---------------------------------------------------------------------- components/camel-restlet/pom.xml | 16 +++++++++++++ .../component/restlet/RestletConsumer.java | 24 +++++++++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1483499e/components/camel-restlet/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-restlet/pom.xml b/components/camel-restlet/pom.xml index 14014ec..0d403ec 100644 --- a/components/camel-restlet/pom.xml +++ b/components/camel-restlet/pom.xml @@ -112,6 +112,7 @@ </dependency> </dependencies> + <build> <plugins> <plugin> @@ -124,4 +125,19 @@ </plugins> </build> + <!-- skip tests on windows --> + <profiles> + <profile> + <id>windows</id> + <activation> + <os> + <family>Windows</family> + </os> + </activation> + <properties> + <skipTests>true</skipTests> + </properties> + </profile> + </profiles> + </project> http://git-wip-us.apache.org/repos/asf/camel/blob/1483499e/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletConsumer.java b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletConsumer.java index 2183e3c..fd39ac8 100644 --- a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletConsumer.java +++ b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletConsumer.java @@ -39,12 +39,19 @@ public class RestletConsumer extends DefaultConsumer { public RestletConsumer(Endpoint endpoint, Processor processor) throws Exception { super(endpoint, processor); - - restlet = new Restlet() { + } + + @Override + public RestletEndpoint getEndpoint() { + return (RestletEndpoint) super.getEndpoint(); + } + + protected Restlet createRestlet() { + return new Restlet() { @Override public void handle(Request request, Response response) { LOG.debug("Consumer restlet handle request method: {}", request.getMethod()); - + try { Exchange exchange = getEndpoint().createExchange(); @@ -66,19 +73,20 @@ public class RestletConsumer extends DefaultConsumer { } @Override - public RestletEndpoint getEndpoint() { - return (RestletEndpoint) super.getEndpoint(); - } - - @Override protected void doStart() throws Exception { super.doStart(); + + restlet = createRestlet(); getEndpoint().connect(this); + restlet.start(); } @Override public void doStop() throws Exception { getEndpoint().disconnect(this); + if (restlet != null) { + restlet.stop(); + } super.doStop(); }
