blob: e5c82f9873c2510bb70e4d6d7ba9f9098636f29a [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 persistence_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/persistence/tests/packaging
26 ant ${TARGET} | tee ${TEST_RUN_LOG}
27 ${S1AS_HOME}/bin/asadmin stop-database
28 ${S1AS_HOME}/bin/asadmin stop-domain
Vinay Vishal57171472018-09-18 20:22:00 +053029}
30
31run_test_id(){
Romain Grecourtf7e3a482018-11-20 00:47:09 -080032 unzip_test_resources ${WORKSPACE}/bundles/glassfish.zip
33 cd `dirname ${0}`
Vinay Vishal57171472018-09-18 20:22:00 +053034 test_init
Romain Grecourtf7e3a482018-11-20 00:47:09 -080035 get_test_target ${1}
Vinay Vishal57171472018-09-18 20:22:00 +053036 test_run
37 check_successful_run
Romain Grecourtf7e3a482018-11-20 00:47:09 -080038 generate_junit_report ${1}
Vinay Vishal57171472018-09-18 20:22:00 +053039 change_junit_report_class_names
40}
41
Vinay Vishal57171472018-09-18 20:22:00 +053042get_test_target(){
Romain Grecourtf7e3a482018-11-20 00:47:09 -080043 case ${1} in
Vinay Vishal57171472018-09-18 20:22:00 +053044 persistence_all )
45 TARGET=all
46 export TARGET;;
47 esac
48}
49
Romain Grecourtf7e3a482018-11-20 00:47:09 -080050OPT=${1}
51TEST_ID=${2}
52source `dirname ${0}`/../../../common_test.sh
53case ${OPT} in
Vinay Vishal57171472018-09-18 20:22:00 +053054 list_test_ids )
55 list_test_ids;;
56 run_test_id )
Romain Grecourtf7e3a482018-11-20 00:47:09 -080057 trap "copy_test_artifacts ${TEST_ID}" EXIT
58 run_test_id ${TEST_ID} ;;
Vinay Vishal57171472018-09-18 20:22:00 +053059esac