summaryrefslogtreecommitdiff
path: root/qpid/cc/scripts/javajmstck.sh
blob: 9d279ed38e9c3372585a8c7749eb6618dc9bf3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
#
# 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.
#

cleanup(){
  echo "kill any existing broker instance"
  stopBroker
  rm -rf $CC_HOME/jmstck-data/*
}

runBroker(){
  echo "******************************************************"
  echo "Starting C++ broker"
  ulimit -c unlimited
  $CC_HOME/cpp/src/qpidd -t -d --data-dir $CC_HOME/jmstck-data --load-module=$CPPSTORE_HOME/lib/.libs/libbdbstore.so --port 0 --auth no --log-output $CC_HOME/jmstck-broker.log --no-module-dir
  export QPID_PORT=`grep "Listening on TCP port" $CC_HOME/jmstck-broker.log | tail -n 1 | awk '{print $8}'`
  echo " broker running on port: " $QPID_PORT
  echo "******************************************************"
  sed "s/qpid_port/$QPID_PORT/g"  $CC_HOME/cc/config/java/jndi.properties > "$TS_HOME/classes"/jndi.properties
}

runTck(){
  echo "******************************************************"
  echo "Starting the TCK for the $1 iteration"
  echo "******************************************************"
  cd $TS_HOME/bin
  $TS_HOME/bin/tsant runclient -Dwork.dir=work -Dreport.dir=report 2&>1 > $TS_HOME/tck$1.log
  echo "******************************************************"
  echo "TCK finished the $1 iteration"
  echo "******************************************************"
}

printResults(){
  TESTS_STR=`grep -a "\[java\] Completed running [0-9]* tests" $TS_HOME/tck$1.log`
  PASSED_STR=`grep -a "\[java\] Number of Tests Passed =" $TS_HOME/tck$1.log`
  FAILED_STR=`grep -a "Some tests did not pass" $TS_HOME/tck$1.log`
  echo "-----------------------------------------"
  echo "TCK run #$1 results:"
  echo $TESTS_STR
  echo $PASSED_STR
  echo $FAILED_STR
  if [ "$FAILED_STR" != "" ]; then
    echo "SOME TCK FAILURES DETECTED: "
  fi
  echo "------------------------------------------"
}

stopBroker(){
  echo "************************"
  echo "Stopping the C++ broker"
  echo "************************"
  $CC_HOME/cpp/src/qpidd -q -p $QPID_PORT
}

cleanup
counter=0
runBroker
for j in 1 2
do
   counter=`expr $counter + 1`
   runTck $counter
   printResults $counter
done
cleanup