view j2se/test/tools/javap/PublicInterfaceTest.sh @ 7:807dfe9c366c trunk

[svn] Load openjdk/jdk7/b19 into jdk/trunk.
author xiomara
date Fri, 31 Aug 2007 00:44:13 +0000
parents
children 37f131a4a8e7
line wrap: on
line source

# @test
# @bug 4866831
# @build NotPackagePrivateInterface
# @run shell PublicInterfaceTest.sh
# @summary Verify that javap marks public interfaces as public
# @author Joseph D. Darcy

# Verify directory context variables are set
if [ "${TESTJAVA}" = "" ]
then
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
  exit 1
fi

if [ "${TESTCLASSES}" = "" ]
then
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  exit 1
fi

JAVAP="${TESTJAVA}/bin/javap -classpath ${TESTCLASSES} "

$JAVAP NotPackagePrivateInterface | grep public

# If the exit status of grep is 0, then "public" was correctly found
# in the output of javap.

RESULT=$?
case "$RESULT" in
        0  )
	exit 0;
        ;;

        * )
        echo "The javap tool did not output \"public\" for a public interface."
        exit 1
esac