|
| 1 | +#!/bin/bash -ex |
| 2 | +# |
| 3 | +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
| 4 | +# |
| 5 | +# Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. |
| 6 | +# |
| 7 | +# The contents of this file are subject to the terms of either the GNU |
| 8 | +# General Public License Version 2 only ("GPL") or the Common Development |
| 9 | +# and Distribution License("CDDL") (collectively, the "License"). You |
| 10 | +# may not use this file except in compliance with the License. You can |
| 11 | +# obtain a copy of the License at |
| 12 | +# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html |
| 13 | +# or packager/legal/LICENSE.txt. See the License for the specific |
| 14 | +# language governing permissions and limitations under the License. |
| 15 | +# |
| 16 | +# When distributing the software, include this License Header Notice in each |
| 17 | +# file and include the License file at packager/legal/LICENSE.txt. |
| 18 | +# |
| 19 | +# GPL Classpath Exception: |
| 20 | +# Oracle designates this particular file as subject to the "Classpath" |
| 21 | +# exception as provided by Oracle in the GPL Version 2 section of the License |
| 22 | +# file that accompanied this code. |
| 23 | +# |
| 24 | +# Modifications: |
| 25 | +# If applicable, add the following below the License Header, with the fields |
| 26 | +# enclosed by brackets [] replaced by your own identifying information: |
| 27 | +# "Portions Copyright [year] [name of copyright owner]" |
| 28 | +# |
| 29 | +# Contributor(s): |
| 30 | +# If you wish your version of this file to be governed by only the CDDL or |
| 31 | +# only the GPL Version 2, indicate your decision by adding "[Contributor] |
| 32 | +# elects to include this software in this distribution under the [CDDL or GPL |
| 33 | +# Version 2] license." If you don't indicate a single choice of license, a |
| 34 | +# recipient has the option to distribute your version of this file under |
| 35 | +# either the CDDL, the GPL Version 2 or to extend the choice of license to |
| 36 | +# its licensees as provided above. However, if you add GPL Version 2 code |
| 37 | +# and therefore, elected the GPL Version 2 license, then the option applies |
| 38 | +# only if the new code is made subject to such option by the copyright |
| 39 | +# holder. |
| 40 | +test_run_embedded_publisher(){ |
| 41 | + M2_HOME=/net/gf-hudson/scratch/gf-hudson/export2/hudson/tools/apache-maven-3.0.3 |
| 42 | + MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=384m"; export MAVEN_OPTS |
| 43 | + MAVEN_REPO=$WORKSPACE/repository |
| 44 | + MAVEN_SETTINGS=$M2_HOME/settings-nexus.xml |
| 45 | + PATH=$M2_HOME/bin:$JAVA_HOME/bin:$PATH; export PATH |
| 46 | + mvn -version |
| 47 | + echo $WORKSPACE |
| 48 | + cd $WORKSPACE/main |
| 49 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean install |
| 50 | + EMBEDDED_WORKSPACE=$WORKSPACE/main/appserver/extras/embedded |
| 51 | + cd $EMBEDDED_WORKSPACE/all |
| 52 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean install |
| 53 | + cd $EMBEDDED_WORKSPACE/nucleus |
| 54 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean install |
| 55 | + cd $EMBEDDED_WORKSPACE/web |
| 56 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean install |
| 57 | + cd $WORKSPACE/main/appserver/tests/embedded/maven-plugin/remoteejbs |
| 58 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean verify |
| 59 | + cd $WORKSPACE/main/appserver/tests/embedded/maven-plugin/mdb |
| 60 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean verify |
| 61 | + cd $WORKSPACE/main/appserver/tests/embedded |
| 62 | + mvn -Dmaven.repo.local=$WORKSPACE/repository -DskipTests=true clean verify |
| 63 | + merge_junits |
| 64 | +} |
| 65 | + |
| 66 | +merge_junits(){ |
| 67 | + TEST_ID="embedded_publisher_all" |
| 68 | + rm -rf ${WORKSPACE}/results || true |
| 69 | + mkdir -p ${WORKSPACE}/results/junitreports |
| 70 | + JUD="${WORKSPACE}/results/junitreports/test_results_junit.xml" |
| 71 | + echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > ${JUD} |
| 72 | + echo "<testsuites>" >> ${JUD} |
| 73 | + for i in `find . -type d -name "surefire-reports"` |
| 74 | + do |
| 75 | + ls -d -1 ${i}/*.xml | xargs cat | ${SED} 's/<?xml version=\"1.0\" encoding=\"UTF-8\" *?>//g' >> ${JUD} |
| 76 | + done |
| 77 | + echo "</testsuites>" >> ${JUD} |
| 78 | + ${SED} -i 's/\([a-zA-Z-]\w*\)\./\1-/g' ${JUD} |
| 79 | + ${SED} -i "s/\bclassname=\"/classname=\"${TEST_ID}./g" ${JUD} |
| 80 | +} |
| 81 | + |
| 82 | +run_test_id(){ |
| 83 | + source `dirname $0`/../common_test.sh |
| 84 | + kill_process |
| 85 | + rm main.zip rm version-info.txt || true |
| 86 | + download_test_resources main.zip version-info.txt |
| 87 | + rm -rf main || true |
| 88 | + unzip_test_resources $WORKSPACE/bundles/main.zip |
| 89 | + case ${TEST_ID} in |
| 90 | + embedded_publisher_all) |
| 91 | + test_run_embedded_publisher;; |
| 92 | + esac |
| 93 | + upload_test_results |
| 94 | + delete_bundle |
| 95 | + |
| 96 | +} |
| 97 | + |
| 98 | + |
| 99 | +list_test_ids(){ |
| 100 | + echo embedded_publisher_all |
| 101 | +} |
| 102 | + |
| 103 | +OPT=$1 |
| 104 | +TEST_ID=$2 |
| 105 | + |
| 106 | +case $OPT in |
| 107 | + list_test_ids ) |
| 108 | + list_test_ids;; |
| 109 | + run_test_id ) |
| 110 | + run_test_id $TEST_ID ;; |
| 111 | +esac |
0 commit comments