Basic.sh 2.5 KB
Newer Older
D
duke 已提交
1 2 3
#!/bin/sh

#
4
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
21 22 23
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37
#


# @test
# @bug 6402766
# @summary Unit test for jinfo utility
#
# @library ../common
# @build SimpleApplication ShutdownSimpleApplication
# @run shell Basic.sh

. ${TESTSRC}/../common/CommonSetup.sh
. ${TESTSRC}/../common/ApplicationSetup.sh

38
# Start application and use PORTFILE for coordination
D
duke 已提交
39
PORTFILE="${TESTCLASSES}"/shutdown.port
40 41 42 43
startApplication SimpleApplication "${PORTFILE}"

# all return statuses are checked in this test
set +e
D
duke 已提交
44 45 46

failed=0

47
if [ $isWindows = false ]; then
D
duke 已提交
48
    # -sysprops option
49
    ${JINFO} -J-XX:+UsePerfData -sysprops $appJavaPid
D
duke 已提交
50 51 52
    if [ $? != 0 ]; then failed=1; fi

    # -flags option
53
    ${JINFO} -J-XX:+UsePerfData -flags $appJavaPid
D
duke 已提交
54 55 56
    if [ $? != 0 ]; then failed=1; fi

    # no option
57
    ${JINFO} -J-XX:+UsePerfData $appJavaPid
D
duke 已提交
58 59 60 61 62 63
    if [ $? != 0 ]; then failed=1; fi

fi


# -flag option
64
${JINFO} -J-XX:+UsePerfData -flag +PrintGC $appJavaPid
D
duke 已提交
65 66
if [ $? != 0 ]; then failed=1; fi 

67
${JINFO} -J-XX:+UsePerfData -flag -PrintGC $appJavaPid
D
duke 已提交
68 69
if [ $? != 0 ]; then failed=1; fi

70
${JINFO} -J-XX:+UsePerfData -flag PrintGC $appJavaPid
D
duke 已提交
71 72
if [ $? != 0 ]; then failed=1; fi

73
if $isSolaris; then
D
duke 已提交
74

75
    ${JINFO} -J-XX:+UsePerfData -flag +ExtendedDTraceProbes $appJavaPid
D
duke 已提交
76 77
    if [ $? != 0 ]; then failed=1; fi

78
    ${JINFO} -J-XX:+UsePerfData -flag -ExtendedDTraceProbes $appJavaPid
D
duke 已提交
79 80
    if [ $? != 0 ]; then failed=1; fi

81
    ${JINFO} -J-XX:+UsePerfData -flag ExtendedDTraceProbes $appJavaPid
D
duke 已提交
82 83 84 85
    if [ $? != 0 ]; then failed=1; fi

fi

86
set -e
D
duke 已提交
87

88 89
stopApplication "${PORTFILE}"
waitForApplication
D
duke 已提交
90

91
exit $failed