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/c3f865ad Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c3f865ad Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c3f865ad Branch: refs/heads/master Commit: c3f865ada4af0f0adbe2d064e39377f0f1916890 Parents: 015cc1a Author: Claus Ibsen <[email protected]> Authored: Sun Mar 27 14:16:34 2016 +0200 Committer: Claus Ibsen <[email protected]> Committed: Sun Mar 27 14:16:34 2016 +0200 ---------------------------------------------------------------------- tests/camel-itest-karaf/run-tests.sh | 38 ++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/c3f865ad/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 index 6b85e6d..88ed7cb 100755 --- a/tests/camel-itest-karaf/run-tests.sh +++ b/tests/camel-itest-karaf/run-tests.sh @@ -26,14 +26,46 @@ echo "Running tests and kill karaf after each test" FILES=src/test/java/org/apache/camel/itest/karaf/* +## you can pass in the test name to start from eg run-tests.sh CamelFtpTest +## to start testing from this test and onwards. +if [ "$#" -eq "0" ] +then + found=1 +else + found=0 +fi + for filename in $FILES do testname=$(basename ${filename%.*}) - if [ $testname != "AbstractFeatureTest" ] + + if [ $found -eq 0 ] + then + if [ $testname == "$1" ] + then + found=1 + fi + fi + + if [ $found -eq 1 ] && [ $testname != "AbstractFeatureTest" ] then + echo "*******************************************************************" 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 "*******************************************************************" + if mvn test -Dtest=$testname ; then + echo "\n" + echo "*******************************************************************" + echo "Test success: $testname" + echo "*******************************************************************" + echo "\n" + else + echo "\n" + echo "*******************************************************************" + echo "Test failure: $testname" + echo "*******************************************************************" + echo "\n" + exit 1; + fi echo "Killing Karaf to ensure no dangling karaf running" jps -l | grep karaf | cut -d ' ' -f 1 | xargs -n1 kill -kill fi
