Repository: camel Updated Branches: refs/heads/master 2b15c6782 -> a8d78f5d5
CAMEL-10407: camel-example-loan-broker : target directory is cleaned while testing so test are failing Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a8d78f5d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a8d78f5d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a8d78f5d Branch: refs/heads/master Commit: a8d78f5d5963e33f9f5f39f6b4df1788b93d8fc7 Parents: 2b15c67 Author: lburgazzoli <lburgazz...@gmail.com> Authored: Fri Oct 21 12:17:26 2016 +0200 Committer: lburgazzoli <lburgazz...@gmail.com> Committed: Fri Oct 21 12:19:00 2016 +0200 ---------------------------------------------------------------------- examples/camel-example-loan-broker/pom.xml | 1 + .../loanbroker/queue/version/JmsBroker.java | 6 ++-- .../queue/version/LoanBrokerQueueTest.java | 2 -- .../src/test/resources/log4j2.properties | 29 ++++++++++++++++++++ 4 files changed, 33 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a8d78f5d/examples/camel-example-loan-broker/pom.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-loan-broker/pom.xml b/examples/camel-example-loan-broker/pom.xml index c746bda..b1cd270 100644 --- a/examples/camel-example-loan-broker/pom.xml +++ b/examples/camel-example-loan-broker/pom.xml @@ -168,6 +168,7 @@ <configuration> <mainClass>${target.main.class}</mainClass> <includePluginDependencies>false</includePluginDependencies> + <classpathScope>runtime</classpathScope> <systemProperties> <property> <key>java.util.logging.config.file</key> http://git-wip-us.apache.org/repos/asf/camel/blob/a8d78f5d/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/JmsBroker.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/JmsBroker.java b/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/JmsBroker.java index c5f64a7..5bf4e20 100644 --- a/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/JmsBroker.java +++ b/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/JmsBroker.java @@ -75,8 +75,8 @@ public final class JmsBroker { try { BrokerService broker = new BrokerService(); synchronized (this) { - broker.setPersistenceAdapter(new MemoryPersistenceAdapter()); - broker.setTmpDataDirectory(new File("./target")); + broker.setPersistenceAdapter(new MemoryPersistenceAdapter()); + broker.setTmpDataDirectory(new File(System.getProperty("broker.tmp.datadir", "./target/broker-tmp"))); broker.addConnector(brokerUrl); broker.start(); Thread.sleep(200); @@ -86,7 +86,7 @@ public final class JmsBroker { while (!shutdownBroker) { wait(1000); } - } + } broker.stop(); } catch (Exception e) { exception = e; http://git-wip-us.apache.org/repos/asf/camel/blob/a8d78f5d/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerQueueTest.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerQueueTest.java b/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerQueueTest.java index 022e3e2..7409a5a 100644 --- a/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerQueueTest.java +++ b/examples/camel-example-loan-broker/src/test/java/org/apache/camel/loanbroker/queue/version/LoanBrokerQueueTest.java @@ -26,10 +26,8 @@ import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.test.junit4.TestSupport; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; -@Ignore("TODO: fails for some odd reason with java.lang.ClassNotFoundException: org.apache.camel.loanbroker.queue.version.LoanBrokerRoute") public class LoanBrokerQueueTest extends TestSupport { protected CamelContext camelContext; protected JmsBroker broker; http://git-wip-us.apache.org/repos/asf/camel/blob/a8d78f5d/examples/camel-example-loan-broker/src/test/resources/log4j2.properties ---------------------------------------------------------------------- diff --git a/examples/camel-example-loan-broker/src/test/resources/log4j2.properties b/examples/camel-example-loan-broker/src/test/resources/log4j2.properties new file mode 100644 index 0000000..c6d2618 --- /dev/null +++ b/examples/camel-example-loan-broker/src/test/resources/log4j2.properties @@ -0,0 +1,29 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-example-loan-broker-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file +