2 # ============LICENSE_START=======================================================
4 # ================================================================================
5 # Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 # ================================================================================
7 # Copyright (C) 2017 Amdocs
8 # =============================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 # ============LICENSE_END=========================================================
28 echo "Usage: $0 <jar file>"
31 function exitOnError() {
34 echo "Failed running task $2"
48 if [ ${BASEDIR:0:1} = "/" ]
52 FULL_PATH=$CURRENT_DIR/$BASEDIR
55 LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j.properties
56 #############################################
57 TARGET_DIR=${FULL_PATH}/target
58 CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
60 #MainClass=org.openecomp.tlv.sdc.ci.tests.run.StartTest
61 MainClass=org.openecomp.test.ClientTest
65 #TARGET_DIR=`echo ${TARGET_DIR} | sed 's/\//\//g'`
68 TESTS_DIR=/opt/app/sdc/ci/resources/tests
69 COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
71 #sed -i 's#\(outputFolder:\).*#\1 '${TARGET_DIR}'#g' $CONF_FILE
72 #sed -i 's#\(resourceConfigDir:\).*#\1 '${TESTS_DIR}'#g' $CONF_FILE
73 #sed -i 's#\(componentsConfigDir:\).*#\1 '${COMPONENTS_DIR}'#g' $CONF_FILE
74 TARGET_LOG_DIR="${TARGET_DIR}/"
76 mkdir -p ${TARGET_DIR}
77 if [ -d ${TARGET_DIR} ]
79 rm -rf ${TARGET_DIR}/*
80 exitOnError $? "Failed_to_delete_target_dir"
84 #JAVA_OPTION="-javaagent:/var/tmp/jacoco/lib/jacocoagent.jar=destfile=jacoco-it.exec"
87 -debug) echo "Debug mode, Listen on port $debug_port"; JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;;
88 "") echo "Standard mode";;
89 *) echo "USAGE: startTest.sh [-debug]";;
92 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}"
97 if [ $DEBUG == "true" ]
107 echo "##################################################"
108 echo "################# status is ${status} #################"
109 echo "##################################################"