2 # ============LICENSE_START=======================================================
4 # ================================================================================
5 # Copyright (C) 2017 AT&T Intellectual Property. All rights
7 # ================================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END=========================================================
25 echo "Usage: $0 <jar file>"
28 function exitOnError() {
31 echo "Failed running task $2"
45 if [ ${BASEDIR:0:1} = "/" ]
49 FULL_PATH=$CURRENT_DIR/$BASEDIR
52 LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
53 #############################################
54 TARGET_DIR=${FULL_PATH}/target
55 CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
57 #MainClass=org.openecomp.tlv.sdc.ci.tests.run.StartTest
58 MainClass=org.openecomp.test.ClientTest
62 #TARGET_DIR=`echo ${TARGET_DIR} | sed 's/\//\//g'`
65 TESTS_DIR=/opt/app/sdc/ci/resources/tests
66 COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
68 #sed -i 's#\(outputFolder:\).*#\1 '${TARGET_DIR}'#g' $CONF_FILE
69 #sed -i 's#\(resourceConfigDir:\).*#\1 '${TESTS_DIR}'#g' $CONF_FILE
70 #sed -i 's#\(componentsConfigDir:\).*#\1 '${COMPONENTS_DIR}'#g' $CONF_FILE
71 TARGET_LOG_DIR="${TARGET_DIR}/"
73 mkdir -p ${TARGET_DIR}
74 if [ -d ${TARGET_DIR} ]
76 rm -rf ${TARGET_DIR}/*
77 exitOnError $? "Failed_to_delete_target_dir"
81 #JAVA_OPTION="-javaagent:/var/tmp/jacoco/lib/jacocoagent.jar=destfile=jacoco-it.exec"
84 -debug) echo "Debug mode, Listen on port $debug_port"; JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;;
85 "") echo "Standard mode";;
86 *) echo "USAGE: startTest.sh [-debug]";;
89 cmd="java $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass}"
94 if [ $DEBUG == "true" ]
104 echo "##################################################"
105 echo "################# status is ${status} #################"
106 echo "##################################################"