Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 1 | #!/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 | |
| 18 | list_test_ids(){ |
| 19 | echo persistence_all |
| 20 | } |
| 21 | |
| 22 | test_run(){ |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 23 | ${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 Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | run_test_id(){ |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 32 | unzip_test_resources ${WORKSPACE}/bundles/glassfish.zip |
| 33 | cd `dirname ${0}` |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 34 | test_init |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 35 | get_test_target ${1} |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 36 | test_run |
| 37 | check_successful_run |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 38 | generate_junit_report ${1} |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 39 | change_junit_report_class_names |
| 40 | } |
| 41 | |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 42 | get_test_target(){ |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 43 | case ${1} in |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 44 | persistence_all ) |
| 45 | TARGET=all |
| 46 | export TARGET;; |
| 47 | esac |
| 48 | } |
| 49 | |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 50 | OPT=${1} |
| 51 | TEST_ID=${2} |
| 52 | source `dirname ${0}`/../../../common_test.sh |
| 53 | case ${OPT} in |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 54 | list_test_ids ) |
| 55 | list_test_ids;; |
| 56 | run_test_id ) |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 57 | trap "copy_test_artifacts ${TEST_ID}" EXIT |
| 58 | run_test_id ${TEST_ID} ;; |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 59 | esac |