CAMEL-9766: camel-itest-karaf to get working on karaf 4. Use a script to run the tests reliable.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/015cc1a3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/015cc1a3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/015cc1a3 Branch: refs/heads/jdk8-lambdas Commit: 015cc1a304948b018e2816dae4298385eced8d03 Parents: ff1fb0e Author: Claus Ibsen <davscl...@apache.org> Authored: Sun Mar 27 13:51:42 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Mar 27 13:51:42 2016 +0200 ---------------------------------------------------------------------- tests/camel-itest-karaf/run-tests.sh | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/015cc1a3/tests/camel-itest-karaf/run-tests.sh ---------------------------------------------------------------------- diff --git a/tests/camel-itest-karaf/run-tests.sh b/tests/camel-itest-karaf/run-tests.sh new file mode 100755 index 0000000..6b85e6d --- /dev/null +++ b/tests/camel-itest-karaf/run-tests.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +## This script runs the camel-itest-karaf in a more reliable way +## than Maven surefire will do as it can hang after a while +## The script also kills each karaf container after a test to ensure there is no Java JVMs +## danging around. + +echo "Running tests and kill karaf after each test" + +FILES=src/test/java/org/apache/camel/itest/karaf/* + +for filename in $FILES +do + testname=$(basename ${filename%.*}) + if [ $testname != "AbstractFeatureTest" ] + then + echo "Running test $testname" + mvn test -Dtest=$testname + ## TODO: wonder if we can get exit code from mvn, and fail if its not 0 ? + echo "Killing Karaf to ensure no dangling karaf running" + jps -l | grep karaf | cut -d ' ' -f 1 | xargs -n1 kill -kill + fi +done