Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh
38890 views
#1# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#2223# @test24# @summary Unit test for java.nio.channels.spi.AsynchronousChannelProvider25# @build Provider1 Provider2 CheckProvider26# @run shell custom_provider.sh2728# if TESTJAVA isn't set then we assume an interactive run.2930if [ -z "$TESTJAVA" ]; then31TESTSRC=.32TESTCLASSES=.33JAVA=java34else35JAVA="${TESTJAVA}/bin/java"36fi3738OS=`uname -s`39case "$OS" in40Windows_* | CYGWIN* )41CLASSPATH="${TESTCLASSES};${TESTSRC}"42;;43* )44CLASSPATH=${TESTCLASSES}:${TESTSRC}45;;46esac47export CLASSPATH4849failures=05051go() {52echo ''53$JAVA ${TESTVMOPTS} $1 $2 $3 2>&154if [ $? != 0 ]; then failures=`expr $failures + 1`; fi55}5657# Run the tests5859go CheckProvider Provider160go -Djava.nio.channels.spi.AsynchronousChannelProvider=Provider2 CheckProvider \61Provider26263#64# Results65#66echo ''67if [ $failures -gt 0 ];68then echo "$failures test(s) failed";69else echo "All test(s) passed"; fi70exit $failures717273