jstatFileURITest1.sh revision 5175:2dc35f14bf17
1155557Smarcel# 2155557Smarcel# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. 3155557Smarcel# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4155557Smarcel# 5155557Smarcel# This code is free software; you can redistribute it and/or modify it 6155557Smarcel# under the terms of the GNU General Public License version 2 only, as 7155557Smarcel# published by the Free Software Foundation. 8155557Smarcel# 9155557Smarcel# This code is distributed in the hope that it will be useful, but WITHOUT 10155557Smarcel# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11155557Smarcel# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12155557Smarcel# version 2 for more details (a copy is included in the LICENSE file that 13155557Smarcel# accompanied this code). 14155557Smarcel# 15155557Smarcel# You should have received a copy of the GNU General Public License version 16155557Smarcel# 2 along with this work; if not, write to the Free Software Foundation, 17155557Smarcel# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18155557Smarcel# 19155557Smarcel# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20155557Smarcel# or visit www.oracle.com if you need additional information or have any 21155557Smarcel# questions. 22155557Smarcel# 23155557Smarcel 24155557Smarcel# @test 25155557Smarcel# @bug 4990825 26155557Smarcel# @run shell jstatFileURITest1.sh 27155565Sjoel# @summary Test that output of 'jstat -gcutil file:path' has expected line counts 28155557Smarcel 29155557Smarcel. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh 30155557Smarcel 31155557Smarcelsetup 32155557Smarcel 33155557SmarcelJSTAT="${TESTJAVA}/bin/jstat" 34155557SmarcelRC=0 35155557Smarcel 36155557SmarcelOS=`uname -s` 37155557Smarcelcase ${OS} in 38155557SmarcelWindows*) 39155557Smarcel # work-around for strange problems trying to translate back slash 40155557Smarcel # characters into forward slash characters in an effort to convert 41155557Smarcel # TESTSRC into a canonical form useable as URI path. 42155557Smarcel cp ${TESTSRC}/hsperfdata_3433 . 43155557Smarcel ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil file:/`pwd`/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk 44155557Smarcel RC=$? 45155557Smarcel rm -f hsperfdata_3433 2>&1 > /dev/null 46155557Smarcel ;; 47155557Smarcel*) 48155557Smarcel ${JSTAT} -J-XX:+UsePerfData -J-Duser.language=en -gcutil file:${TESTSRC}/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk 49155557Smarcel RC=$? 50155557Smarcel ;; 51155557Smarcelesac 52155557Smarcel 53155557Smarcelecho ${RC} 54155557Smarcel