jdk/test/java/net/URLClassLoader/closetest/build.sh
author serb
Tue, 12 Nov 2013 20:24:25 +0400
changeset 21596 0e3a39f29dbc
parent 15254 3997a6f357cb
permissions -rw-r--r--
8027696: Incorrect copyright header in the tests Reviewed-by: alanb, malenkov, mullan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
     1
#!/bin/sh
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
     2
# 
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1940
diff changeset
     3
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
21596
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
     5
# 
21596
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
     8
# published by the Free Software Foundation.
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
     9
# 
21596
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    14
# accompanied this code).
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    15
# 
21596
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    16
# You should have received a copy of the GNU General Public License version
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    19
# 
21596
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
0e3a39f29dbc 8027696: Incorrect copyright header in the tests
serb
parents: 15254
diff changeset
    22
# questions.
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    23
# 
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    24
#
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    25
#
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    26
# This script builds the test files for the test
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    27
# but not the actual test sources themselves.
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    28
#
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    29
if [ "${TESTSRC}" = "" ]
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    30
then
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    31
  echo "TESTSRC not set.  Test cannot execute.  Failed."
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    32
  exit 1
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    33
fi
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    34
echo "TESTSRC=${TESTSRC}"
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    35
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    36
if [ "${TESTJAVA}" = "" ]
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    37
then
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    38
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    39
  exit 1
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    40
fi
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    41
echo "TESTJAVA=${TESTJAVA}"
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    42
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    43
if [ "${COMPILEJAVA}" = "" ]; then
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    44
  COMPILEJAVA="${TESTJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    45
fi
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    46
echo "COMPILEJAVA=${COMPILEJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    47
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    48
if [ "${TESTCLASSES}" = "" ]
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    49
then
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    50
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    51
  exit 1
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    52
fi
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    53
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    54
JAVAC="${COMPILEJAVA}/bin/javac"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    55
JAR="${COMPILEJAVA}/bin/jar"
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    56
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    57
rm -rf ${TESTCLASSES}/test1
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    58
rm -rf ${TESTCLASSES}/test2
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    59
rm -rf ${TESTCLASSES}/serverRoot
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    60
mkdir -p ${TESTCLASSES}/test1/com/foo
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    61
mkdir -p ${TESTCLASSES}/test2/com/foo
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    62
mkdir -p ${TESTCLASSES}/serverRoot
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    63
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    64
cd ${TESTSRC}/test1/com/foo
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    65
cp * ${TESTCLASSES}/test1/com/foo
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    66
cd ${TESTCLASSES}/test1
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    67
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} com/foo/*.java
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    68
${JAR} ${TESTTOOLVMOPTS} cvf ../test1.jar com/foo/*.class com/foo/Resource*
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    69
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    70
cd ${TESTSRC}/test2/com/foo
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    71
cp * ${TESTCLASSES}/test2/com/foo
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    72
cd ${TESTCLASSES}/test2
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    73
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} com/foo/*.java
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    74
${JAR} ${TESTTOOLVMOPTS} cvf ../test2.jar com/foo/*.class com/foo/Resource*
1940
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    75
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    76
cp ${TESTSRC}/serverRoot/Test.java ${TESTCLASSES}/serverRoot
e81514210873 4167874: URL-downloaded jar files can consume all available file descriptors
michaelm
parents:
diff changeset
    77
cd ${TESTCLASSES}/serverRoot
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 5506
diff changeset
    78
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} Test.java