Path: blob/master/test/jdk/sun/tools/jstat/jstatHelp.sh
41152 views
#1# Copyright (c) 2004, 2018, 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# @bug 4990825 636432925# @run shell jstatHelp.sh26# @summary Test that output of 'jstat -?', 'jstat -h', 'jstat --help' and 'jstat' matches the usage.out file2728. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh2930setup3132JSTAT="${TESTJAVA}/bin/jstat"3334rm -f jstat.out 2>/dev/null35${JSTAT} -J-XX:+UsePerfData -? > jstat.out 2>&13637diff -w jstat.out ${TESTSRC}/usage.out38if [ $? != 0 ]39then40echo "Output of jstat -? differs from expected output. Failed."41exit 142fi4344rm -f jstat.out 2>/dev/null45${JSTAT} -J-XX:+UsePerfData --help > jstat.out 2>&14647diff -w jstat.out ${TESTSRC}/usage.out48if [ $? != 0 ]49then50echo "Output of jstat -h differs from expected output. Failed."51exit 152fi5354rm -f jstat.out 2>/dev/null55${JSTAT} -J-XX:+UsePerfData --help > jstat.out 2>&15657diff -w jstat.out ${TESTSRC}/usage.out58if [ $? != 0 ]59then60echo "Output of jstat --help differs from expected output. Failed."61exit 162fi6364rm -f jstat.out 2>/dev/null65${JSTAT} -J-XX:+UsePerfData > jstat.out 2>&16667diff -w jstat.out ${TESTSRC}/usage.out68if [ $? != 0 ]69then70echo "Output of jstat differs from expected output. Failed."71exit 172fi7374exit 0757677