blob: 825f4171b3eab40d3f1b67d4698c3bdb74cff63f [file] [log] [blame]
Vinay Vishal57171472018-09-18 20:22:00 +05301#!/bin/bash -ex
2#
3# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
4#
5# This program and the accompanying materials are made available under the
6# terms of the Eclipse Public License v. 2.0, which is available at
7# http://www.eclipse.org/legal/epl-2.0.
8#
9# This Source Code may also be made available under the following Secondary
10# Licenses when the conditions for such availability set forth in the
11# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12# version 2 with the GNU Classpath Exception, which is available at
13# https://www.gnu.org/software/classpath/license.html.
14#
15# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16#
17
18list_test_ids(){
19 echo batch_all
20}
21
22test_run(){
Romain Grecourtf7e3a482018-11-20 00:47:09 -080023 ${S1AS_HOME}/bin/asadmin start-domain
24 ${S1AS_HOME}/bin/asadmin start-database
25 cd ${APS_HOME}/devtests/batch
Vinay Vishal57171472018-09-18 20:22:00 +053026 PROXY_HOST=`echo ${http_proxy} | cut -d':' -f2 | ${SED} 's/\/\///g'`
27 PROXY_PORT=`echo ${http_proxy} | cut -d':' -f3 | ${SED} 's/\///g'`
28 ANT_OPTS="${ANT_OPTS} \
29 -Dhttp.proxyHost=${PROXY_HOST} \
30 -Dhttp.proxyPort=${PROXY_PORT} \
31 -Dhttp.noProxyHosts='127.0.0.1|localhost|*.oracle.com' \
32 -Dhttps.proxyHost=${PROXY_HOST} \
33 -Dhttps.proxyPort=${PROXY_PORT} \
34 -Dhttps.noProxyHosts='127.0.0.1|localhost|*.oracle.com'"
35 export ANT_OPTS
36 echo "ANT_OPTS=${ANT_OPTS}"
Romain Grecourtf7e3a482018-11-20 00:47:09 -080037 ant ${TARGET} | tee ${TEST_RUN_LOG}
38 ${S1AS_HOME}/bin/asadmin stop-database
39 ${S1AS_HOME}/bin/asadmin stop-domain
Vinay Vishal57171472018-09-18 20:22:00 +053040}
41
42run_test_id(){
Romain Grecourtf7e3a482018-11-20 00:47:09 -080043 unzip_test_resources ${WORKSPACE}/bundles/glassfish.zip
44 cd `dirname ${0}`
Vinay Vishal57171472018-09-18 20:22:00 +053045 test_init
Romain Grecourtf7e3a482018-11-20 00:47:09 -080046 get_test_target ${1}
Vinay Vishal57171472018-09-18 20:22:00 +053047 test_run
Romain Grecourtf7e3a482018-11-20 00:47:09 -080048 generate_junit_report ${1}
Vinay Vishal57171472018-09-18 20:22:00 +053049 change_junit_report_class_names
50}
51
Vinay Vishal57171472018-09-18 20:22:00 +053052get_test_target(){
Romain Grecourtf7e3a482018-11-20 00:47:09 -080053 case ${1} in
Vinay Vishal57171472018-09-18 20:22:00 +053054 batch_all )
55 TARGET=all
56 export TARGET;;
57 esac
Vinay Vishal57171472018-09-18 20:22:00 +053058}
59
Romain Grecourtf7e3a482018-11-20 00:47:09 -080060OPT=${1}
61TEST_ID=${2}
62source `dirname $0`/../../../common_test.sh
63case ${OPT} in
Vinay Vishal57171472018-09-18 20:22:00 +053064 list_test_ids )
65 list_test_ids;;
66 run_test_id )
Romain Grecourtf7e3a482018-11-20 00:47:09 -080067 trap "copy_test_artifacts ${TEST_ID}" EXIT
68 run_test_id ${TEST_ID} ;;
Vinay Vishal57171472018-09-18 20:22:00 +053069esac