This commit is contained in:
Igor Veresov 2016-08-05 13:37:53 -07:00
commit 3c025b715c
1360 changed files with 15024 additions and 5915 deletions

View file

@ -372,3 +372,4 @@ d53037a90c441cb528dc41c30827985de0e67c62 jdk-9+123
8e45018bde9de4ad15b972ae62874bba52dba2d5 jdk-9+127 8e45018bde9de4ad15b972ae62874bba52dba2d5 jdk-9+127
5bf88dce615f6804f9e101a96ffa7c9dfb4fbbbe jdk-9+128 5bf88dce615f6804f9e101a96ffa7c9dfb4fbbbe jdk-9+128
e8373543a3f0f60589b7d72b1f9b172721124caf jdk-9+129 e8373543a3f0f60589b7d72b1f9b172721124caf jdk-9+129
e613affb88d178dc7c589f1679db113d589bddb4 jdk-9+130

View file

@ -372,3 +372,4 @@ f80c841ae2545eaf9acd2724bccc305d98cefbe2 jdk-9+124
8fa686245bd2a072ece3392743460030f0854520 jdk-9+127 8fa686245bd2a072ece3392743460030f0854520 jdk-9+127
b30ae794d974d7dd3eb4e84203f70021823fa6c6 jdk-9+128 b30ae794d974d7dd3eb4e84203f70021823fa6c6 jdk-9+128
f5902d3841b82cac6e7716a20c24e8e916fb14a8 jdk-9+129 f5902d3841b82cac6e7716a20c24e8e916fb14a8 jdk-9+129
d94d54a3192fea79234c3ac55cd0b4052d45e954 jdk-9+130

View file

@ -684,7 +684,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
AC_SUBST(CXXFLAGS_TESTEXE) AC_SUBST(CXXFLAGS_TESTEXE)
LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE" LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
AC_SUBST(LDFLAGS_TESTLIB) AC_SUBST(LDFLAGS_TESTLIB)
AC_SUBST(LDFLAGS_TESTEXE) AC_SUBST(LDFLAGS_TESTEXE)
@ -713,20 +713,17 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror], FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror],
IF_FALSE: [$2CXXSTD_CXXFLAG=""]) IF_FALSE: [$2CXXSTD_CXXFLAG=""])
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}" $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}"
$2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}"
AC_SUBST([$2CXXSTD_CXXFLAG]) AC_SUBST([$2CXXSTD_CXXFLAG])
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
$2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__" $2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__" $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__"
$2CFLAGS_JDKLIB_EXTRA='-xstrconst'
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
$2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__" $2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__" $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__"
$2CFLAGS_JDKLIB_EXTRA='-xstrconst'
fi fi
$2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}" $2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}"
@ -768,7 +765,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
$2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing" $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
;; ;;
esac esac
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS) TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2))
elif test "x$TOOLCHAIN_TYPE" = xclang; then elif test "x$TOOLCHAIN_TYPE" = xclang; then
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE" $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
@ -1112,7 +1109,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
fi fi
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
LDFLAGS_SOLSTUDIO="-Wl,-z,defs" LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext" $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
LDFLAGS_CXX_SOLSTUDIO="-norunpath" LDFLAGS_CXX_SOLSTUDIO="-norunpath"
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" $2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
$2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion" $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
@ -1147,11 +1144,11 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}" $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \ $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-libpath:${OUTPUT_ROOT}/support/modules_libs/java.base" -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
$2JDKLIB_LIBS="" $2JDKLIB_LIBS=""
else else
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \ $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)" -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)"
if test "x$1" = "xTARGET"; then if test "x$1" = "xTARGET"; then
@ -1160,17 +1157,17 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
# Only add client/minimal dir if client/minimal is being built. # Only add client/minimal dir if client/minimal is being built.
# Default to server for other variants. # Default to server for other variants.
if HOTSPOT_CHECK_JVM_VARIANT(server); then if HOTSPOT_CHECK_JVM_VARIANT(server); then
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server" $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
elif HOTSPOT_CHECK_JVM_VARIANT(client); then elif HOTSPOT_CHECK_JVM_VARIANT(client); then
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/client" $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/client"
elif HOTSPOT_CHECK_JVM_VARIANT(minimal); then elif HOTSPOT_CHECK_JVM_VARIANT(minimal); then
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/minimal" $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/minimal"
else else
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server" $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
fi fi
elif test "x$1" = "xBUILD"; then elif test "x$1" = "xBUILD"; then
# When building a buildjdk, it's always only the server variant # When building a buildjdk, it's always only the server variant
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \ $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server" -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
fi fi
@ -1181,6 +1178,8 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
fi fi
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2JAVA_BASE_LDFLAGS}"
# Set $2JVM_LIBS (per os) # Set $2JVM_LIBS (per os)
if test "x$OPENJDK_$1_OS" = xlinux; then if test "x$OPENJDK_$1_OS" = xlinux; then
$2JVM_LIBS="[$]$2JVM_LIBS -lm -ldl -lpthread" $2JVM_LIBS="[$]$2JVM_LIBS -lm -ldl -lpthread"
@ -1447,19 +1446,24 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS) AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
]) ])
AC_DEFUN_ONCE([FLAGS_SETUP_GCC6_COMPILER_FLAGS], # FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
# Arguments:
# $1 - Optional prefix for each variable defined.
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
[ [
# These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
# runs afoul of the more aggressive versions of these optimisations. # runs afoul of the more aggressive versions of these optimisations.
# Notably, value range propagation now assumes that the this pointer of C++ # Notably, value range propagation now assumes that the this pointer of C++
# member functions is non-null. # member functions is non-null.
NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks" NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_NULL_POINTER_CHECK_CFLAG -Werror], dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
IF_FALSE: [NO_NULL_POINTER_CHECK_CFLAG=""]) dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
AC_SUBST([NO_NULL_POINTER_CHECK_CFLAG]) dnl IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror], dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""]) dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
AC_SUBST([NO_LIFETIME_DSE_CFLAG]) AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}])
$1CFLAGS_JDK="[$]$1CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
$1JVM_CFLAGS="[$]$1JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
]) ])

View file

@ -749,8 +749,6 @@ CXXFLAGS_JDKLIB
CFLAGS_JDKEXE CFLAGS_JDKEXE
CFLAGS_JDKLIB CFLAGS_JDKLIB
MACOSX_VERSION_MIN MACOSX_VERSION_MIN
NO_LIFETIME_DSE_CFLAG
NO_NULL_POINTER_CHECK_CFLAG
CXXSTD_CXXFLAG CXXSTD_CXXFLAG
CXX_O_FLAG_SIZE CXX_O_FLAG_SIZE
CXX_O_FLAG_NONE CXX_O_FLAG_NONE
@ -4092,6 +4090,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
# Arguments:
# $1 - Optional prefix for each variable defined.
# #
@ -4913,7 +4914,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
TOOLCHAIN_MINIMUM_VERSION_clang="3.2" TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
TOOLCHAIN_MINIMUM_VERSION_gcc="4.3" TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
TOOLCHAIN_MINIMUM_VERSION_microsoft="" TOOLCHAIN_MINIMUM_VERSION_microsoft=""
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12" TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
TOOLCHAIN_MINIMUM_VERSION_xlc="" TOOLCHAIN_MINIMUM_VERSION_xlc=""
# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called. # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
@ -5094,7 +5095,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1469202305 DATE_WHEN_GENERATED=1470415803
############################################################################### ###############################################################################
# #
@ -43767,8 +43768,12 @@ $as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;}
fi fi
# Restore old path. # Restore old path, except for the microsoft toolchain, which requires VS_PATH
# to remain in place. Otherwise the compiler will not work in some siutations
# in later configure checks.
if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then
PATH="$OLD_PATH" PATH="$OLD_PATH"
fi
# Restore the flags to the user specified values. # Restore the flags to the user specified values.
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
@ -47232,6 +47237,28 @@ $as_echo "$as_me: WARNING: C compiler version number has a part larger than 9999
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS" BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS" BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
BUILD_AR="$AR" BUILD_AR="$AR"
if test "x$CC_VERSION_NUMBER" != "x$CXX_VERSION_NUMBER"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&5
$as_echo "$as_me: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5
$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;}
fi
# We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal.
if [[ "[$]CC_VERSION_NUMBER" =~ (.*\.){3} ]] ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&5
$as_echo "$as_me: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;}
fi
if [[ "[$]CC_VERSION_NUMBER" =~ [0-9]{6} ]] ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&5
$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;}
fi
OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", $1, $2, $3) }' <<< "$CC_VERSION_NUMBER"`
fi fi
@ -49781,20 +49808,17 @@ $as_echo "$supports" >&6; }
CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}" CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}"
JVM_CFLAGS="${JVM_CFLAGS} ${CXXSTD_CXXFLAG}"
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
CFLAGS_JDKLIB_EXTRA='-xstrconst'
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
CFLAGS_JDKLIB_EXTRA='-xstrconst'
fi fi
CFLAGS_JDK="${CFLAGS_JDK} ${EXTRA_CFLAGS}" CFLAGS_JDK="${CFLAGS_JDK} ${EXTRA_CFLAGS}"
@ -49913,542 +49937,12 @@ $as_echo "$supports" >&6; }
# runs afoul of the more aggressive versions of these optimisations. # runs afoul of the more aggressive versions of these optimisations.
# Notably, value range propagation now assumes that the this pointer of C++ # Notably, value range propagation now assumes that the this pointer of C++
# member functions is non-null. # member functions is non-null.
NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks" NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
# Execute function body
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"" >&5
$as_echo_n "checking if the C compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"... " >&6; }
supports=yes
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $NO_NULL_POINTER_CHECK_CFLAG -Werror"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
supports=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CFLAGS="$saved_cflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
C_COMP_SUPPORTS="yes"
else
:
C_COMP_SUPPORTS="no"
fi
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"" >&5
$as_echo_n "checking if the C++ compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"... " >&6; }
supports=yes
saved_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAG $NO_NULL_POINTER_CHECK_CFLAG -Werror"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
supports=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CXXFLAGS="$saved_cxxflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
CXX_COMP_SUPPORTS="yes"
else
:
CXX_COMP_SUPPORTS="no"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"" >&5
$as_echo_n "checking if both compilers support \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"... " >&6; }
supports=no
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
else
:
NO_NULL_POINTER_CHECK_CFLAG=""
fi
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
{ $as_echo "$as_me:${as_lineno-$LINENO}: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&5
$as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&6;}
CFLAGS_JDK="$CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
JVM_CFLAGS="$JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
# Execute function body
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"" >&5
$as_echo_n "checking if the C compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"... " >&6; }
supports=yes
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $NO_LIFETIME_DSE_CFLAG -Werror"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
supports=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CFLAGS="$saved_cflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
C_COMP_SUPPORTS="yes"
else
:
C_COMP_SUPPORTS="no"
fi
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"" >&5
$as_echo_n "checking if the C++ compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"... " >&6; }
supports=yes
saved_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAG $NO_LIFETIME_DSE_CFLAG -Werror"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
supports=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CXXFLAGS="$saved_cxxflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
CXX_COMP_SUPPORTS="yes"
else
:
CXX_COMP_SUPPORTS="no"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$NO_LIFETIME_DSE_CFLAG -Werror\"" >&5
$as_echo_n "checking if both compilers support \"$NO_LIFETIME_DSE_CFLAG -Werror\"... " >&6; }
supports=no
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
else
:
NO_LIFETIME_DSE_CFLAG=""
fi
CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
else else
: :
@ -50900,7 +50394,7 @@ $as_echo "$supports" >&6; }
fi fi
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
LDFLAGS_SOLSTUDIO="-Wl,-z,defs" LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext" LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
LDFLAGS_CXX_SOLSTUDIO="-norunpath" LDFLAGS_CXX_SOLSTUDIO="-norunpath"
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion" JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
@ -50935,11 +50429,11 @@ $as_echo "$supports" >&6; }
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}" LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \ JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-libpath:${OUTPUT_ROOT}/support/modules_libs/java.base" -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
JDKLIB_LIBS="" JDKLIB_LIBS=""
else else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \ JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)" -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)"
if test "xTARGET" = "xTARGET"; then if test "xTARGET" = "xTARGET"; then
@ -50948,17 +50442,17 @@ $as_echo "$supports" >&6; }
# Only add client/minimal dir if client/minimal is being built. # Only add client/minimal dir if client/minimal is being built.
# Default to server for other variants. # Default to server for other variants.
if [[ " $JVM_VARIANTS " =~ " server " ]] ; then if [[ " $JVM_VARIANTS " =~ " server " ]] ; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server" JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
elif [[ " $JVM_VARIANTS " =~ " client " ]] ; then elif [[ " $JVM_VARIANTS " =~ " client " ]] ; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/client" JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/client"
elif [[ " $JVM_VARIANTS " =~ " minimal " ]] ; then elif [[ " $JVM_VARIANTS " =~ " minimal " ]] ; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/minimal" JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/minimal"
else else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server" JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
fi fi
elif test "xTARGET" = "xBUILD"; then elif test "xTARGET" = "xBUILD"; then
# When building a buildjdk, it's always only the server variant # When building a buildjdk, it's always only the server variant
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \ JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server" -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
fi fi
@ -50969,6 +50463,8 @@ $as_echo "$supports" >&6; }
fi fi
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${JAVA_BASE_LDFLAGS}"
# Set JVM_LIBS (per os) # Set JVM_LIBS (per os)
if test "x$OPENJDK_TARGET_OS" = xlinux; then if test "x$OPENJDK_TARGET_OS" = xlinux; then
JVM_LIBS="$JVM_LIBS -lm -ldl -lpthread" JVM_LIBS="$JVM_LIBS -lm -ldl -lpthread"
@ -51127,20 +50623,17 @@ $as_echo "$supports" >&6; }
OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}" OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}"
OPENJDK_BUILD_JVM_CFLAGS="${OPENJDK_BUILD_JVM_CFLAGS} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}"
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__" OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__"
OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__" OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__"
OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA='-xstrconst'
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
fi fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then if test "x$OPENJDK_TARGET_OS" = xsolaris; then
OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__" OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__"
OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__" OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__"
OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA='-xstrconst'
fi fi
OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} ${OPENJDK_BUILD_EXTRA_CFLAGS}" OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} ${OPENJDK_BUILD_EXTRA_CFLAGS}"
@ -51255,6 +50748,17 @@ $as_echo "$supports" >&6; }
if test $OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then if test $OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then
: :
# These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
# runs afoul of the more aggressive versions of these optimisations.
# Notably, value range propagation now assumes that the this pointer of C++
# member functions is non-null.
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
{ $as_echo "$as_me:${as_lineno-$LINENO}: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&5
$as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&6;}
OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
else else
: :
@ -51705,7 +51209,7 @@ $as_echo "$supports" >&6; }
fi fi
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
LDFLAGS_SOLSTUDIO="-Wl,-z,defs" LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext" OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
LDFLAGS_CXX_SOLSTUDIO="-norunpath" LDFLAGS_CXX_SOLSTUDIO="-norunpath"
OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion" OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
@ -51740,11 +51244,11 @@ $as_echo "$supports" >&6; }
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}" OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \ OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-libpath:${OUTPUT_ROOT}/support/modules_libs/java.base" -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
OPENJDK_BUILD_JDKLIB_LIBS="" OPENJDK_BUILD_JDKLIB_LIBS=""
else else
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \ OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)" -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)"
if test "xBUILD" = "xTARGET"; then if test "xBUILD" = "xTARGET"; then
@ -51753,17 +51257,17 @@ $as_echo "$supports" >&6; }
# Only add client/minimal dir if client/minimal is being built. # Only add client/minimal dir if client/minimal is being built.
# Default to server for other variants. # Default to server for other variants.
if [[ " $JVM_VARIANTS " =~ " server " ]] ; then if [[ " $JVM_VARIANTS " =~ " server " ]] ; then
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server" OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
elif [[ " $JVM_VARIANTS " =~ " client " ]] ; then elif [[ " $JVM_VARIANTS " =~ " client " ]] ; then
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/client" OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/client"
elif [[ " $JVM_VARIANTS " =~ " minimal " ]] ; then elif [[ " $JVM_VARIANTS " =~ " minimal " ]] ; then
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/minimal" OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/minimal"
else else
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server" OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
fi fi
elif test "xBUILD" = "xBUILD"; then elif test "xBUILD" = "xBUILD"; then
# When building a buildjdk, it's always only the server variant # When building a buildjdk, it's always only the server variant
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \ OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server" -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
fi fi
@ -51774,6 +51278,8 @@ $as_echo "$supports" >&6; }
fi fi
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${OPENJDK_BUILD_JAVA_BASE_LDFLAGS}"
# Set OPENJDK_BUILD_JVM_LIBS (per os) # Set OPENJDK_BUILD_JVM_LIBS (per os)
if test "x$OPENJDK_BUILD_OS" = xlinux; then if test "x$OPENJDK_BUILD_OS" = xlinux; then
OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -ldl -lpthread" OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -ldl -lpthread"
@ -51838,7 +51344,7 @@ $as_echo "$supports" >&6; }
LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE" LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
@ -53328,8 +52834,8 @@ $as_echo "$JVM_FEATURES" >&6; }
as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5 as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5
fi fi
if [[ " $JVM_FEATURES " =~ " jvmci " ]] && ! [[ " $JVM_FEATURES " =~ " compiler2 " ]] ; then if [[ " $JVM_FEATURES " =~ " jvmci " ]] && ! ( [[ " $JVM_FEATURES " =~ " compiler1 " ]] || [[ " $JVM_FEATURES " =~ " compiler2 " ]] ); then
as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2'" "$LINENO" 5 as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'" "$LINENO" 5
fi fi
if [[ " $JVM_FEATURES " =~ " compiler2 " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then if [[ " $JVM_FEATURES " =~ " compiler2 " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then
@ -53369,7 +52875,7 @@ $as_echo "$JVM_FEATURES" >&6; }
fi fi
fi fi
# Only enable jvmci on x86_64, sparcv9 and aarch64, and only on server. # Only enable jvmci on x86_64, sparcv9 and aarch64.
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \ if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \ test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
@ -53383,7 +52889,7 @@ $as_echo "$JVM_FEATURES" >&6; }
# Enable features depending on variant. # Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES" JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"
JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"

View file

@ -198,8 +198,8 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt']) AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
fi fi
if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! HOTSPOT_CHECK_JVM_FEATURE(compiler2); then if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2']) AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
fi fi
if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
@ -239,7 +239,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
fi fi
fi fi
# Only enable jvmci on x86_64, sparcv9 and aarch64, and only on server. # Only enable jvmci on x86_64, sparcv9 and aarch64.
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \ if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \ test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
@ -253,7 +253,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
# Enable features depending on variant. # Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES" JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"
JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"

View file

@ -391,8 +391,6 @@ CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@ WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
CFLAGS_CCACHE:=@CFLAGS_CCACHE@ CFLAGS_CCACHE:=@CFLAGS_CCACHE@
NO_NULL_POINTER_CHECK_FLAG=@NO_NULL_POINTER_CHECK_CFLAG@
NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@ CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
# Tools that potentially need to be cross compilation aware. # Tools that potentially need to be cross compilation aware.

View file

@ -54,7 +54,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
TOOLCHAIN_MINIMUM_VERSION_clang="3.2" TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
TOOLCHAIN_MINIMUM_VERSION_gcc="4.3" TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
TOOLCHAIN_MINIMUM_VERSION_microsoft="" TOOLCHAIN_MINIMUM_VERSION_microsoft=""
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12" TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
TOOLCHAIN_MINIMUM_VERSION_xlc="" TOOLCHAIN_MINIMUM_VERSION_xlc=""
# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called. # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
@ -312,8 +312,12 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
# Restore path, etc # Restore path, etc
AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION], AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
[ [
# Restore old path. # Restore old path, except for the microsoft toolchain, which requires VS_PATH
# to remain in place. Otherwise the compiler will not work in some siutations
# in later configure checks.
if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then
PATH="$OLD_PATH" PATH="$OLD_PATH"
fi
# Restore the flags to the user specified values. # Restore the flags to the user specified values.
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
@ -831,6 +835,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS" BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS" BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
BUILD_AR="$AR" BUILD_AR="$AR"
TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS([], [OPENJDK_BUILD_])
fi fi
AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CC)

View file

@ -335,8 +335,11 @@ else
for j in ${repos_extra} ; do for j in ${repos_extra} ; do
if [ "${i}" = "${j}" ] ; then if [ "${i}" = "${j}" ] ; then
# it's an "extra" # it's an "extra"
if [ -n "${pull_extra}" ]; then
# if no pull_extra is defined, assume that pull_default is valid
pull_base="${pull_extra}" pull_base="${pull_extra}"
fi fi
fi
done done
# remove trailing slash # remove trailing slash

View file

@ -357,6 +357,18 @@ var getJibProfilesDependencies = function (input, common) {
var boot_jdk_platform = input.build_os + "-" var boot_jdk_platform = input.build_os + "-"
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu); + (input.build_cpu == "x86" ? "i586" : input.build_cpu);
var boot_jdk_revision = "8";
var boot_jdk_subdirpart = "1.8.0";
// JDK 8 does not work on sparc M7 cpus, need a newer update when building
// on such hardware.
if (input.build_cpu == "sparcv9") {
var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
if (cpu_brand.trim() == 'SPARC-M7') {
boot_jdk_revision = "8u20";
boot_jdk_subdirpart = "1.8.0_20";
}
}
var devkit_platform_revisions = { var devkit_platform_revisions = {
linux_x64: "gcc4.9.2-OEL6.4+1.0", linux_x64: "gcc4.9.2-OEL6.4+1.0",
macosx_x64: "Xcode6.3-MacOSX10.9+1.0", macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
@ -374,12 +386,12 @@ var getJibProfilesDependencies = function (input, common) {
boot_jdk: { boot_jdk: {
server: "javare", server: "javare",
module: "jdk", module: "jdk",
revision: "8", revision: boot_jdk_revision,
checksum_file: boot_jdk_platform + "/MD5_VALUES", checksum_file: boot_jdk_platform + "/MD5_VALUES",
file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz", file: boot_jdk_platform + "/jdk-" + boot_jdk_revision + "-" + boot_jdk_platform + ".tar.gz",
configure_args: (input.build_os == "macosx" configure_args: (input.build_os == "macosx"
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home" ? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart + ".jdk/Contents/Home"
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0") : "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart)
}, },
devkit: { devkit: {

View file

@ -372,3 +372,4 @@ c7f5ba08fcd4b8416e62c21229f9a07c95498919 jdk-9+126
8fab452b6f4710762ba1d8e55fd62db00b1355fe jdk-9+127 8fab452b6f4710762ba1d8e55fd62db00b1355fe jdk-9+127
1f093d3f8cd99cd37c3b0af4cf5c3bffaa9c8b98 jdk-9+128 1f093d3f8cd99cd37c3b0af4cf5c3bffaa9c8b98 jdk-9+128
c3e83ccab3bb1733ae903d681879a33f85ed465c jdk-9+129 c3e83ccab3bb1733ae903d681879a33f85ed465c jdk-9+129
77f9692d5976ae155773dd3e07533616bb95bae1 jdk-9+130

View file

@ -532,3 +532,4 @@ adc8c84b7cf8c540d920182f78a2bc982366432a jdk-9+126
352357128f602dcf0426b1cbe011a4685a4d9f97 jdk-9+127 352357128f602dcf0426b1cbe011a4685a4d9f97 jdk-9+127
22bf6db9767b1b3a1994cbf32eb3331f31ae2093 jdk-9+128 22bf6db9767b1b3a1994cbf32eb3331f31ae2093 jdk-9+128
e96b34b76d863ed1fa04e0eeb3f297ac17b490fd jdk-9+129 e96b34b76d863ed1fa04e0eeb3f297ac17b490fd jdk-9+129
7d54c7056328b6a2bf4877458b8f4d8cd870f93b jdk-9+130

View file

@ -50,7 +50,6 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \
$(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \ $(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \
$(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \ $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \
$(HOTSPOT_TOPDIR)/test/compiler/calls \ $(HOTSPOT_TOPDIR)/test/compiler/calls \
$(HOTSPOT_TOPDIR)/test/compiler/native \
$(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetNamedModule \ $(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetNamedModule \
$(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \ $(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \
$(HOTSPOT_TOPDIR)/test/compiler/jvmci/jdk.vm.ci.code.test \ $(HOTSPOT_TOPDIR)/test/compiler/jvmci/jdk.vm.ci.code.test \

View file

@ -110,17 +110,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// Entry frame checks // Entry frame checks
if (is_entry_frame()) { if (is_entry_frame()) {
// an entry frame must have a valid fp. // an entry frame must have a valid fp.
return fp_safe && is_entry_frame_valid(thread);
if (!fp_safe) return false;
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > fp);
return jcw_safe;
} }
intptr_t* sender_sp = NULL; intptr_t* sender_sp = NULL;
@ -210,15 +200,8 @@ bool frame::safe_for_sender(JavaThread *thread) {
} }
// construct the potential sender // construct the potential sender
frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc); frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
return sender.is_entry_frame_valid(thread);
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > (address)sender.fp());
return jcw_safe;
} }
CompiledMethod* nm = sender_blob->as_compiled_method_or_null(); CompiledMethod* nm = sender_blob->as_compiled_method_or_null();

View file

@ -225,19 +225,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// Entry frame checks // Entry frame checks
if (is_entry_frame()) { if (is_entry_frame()) {
// an entry frame must have a valid fp. // an entry frame must have a valid fp.
return fp_safe && is_entry_frame_valid(thread);
if (!fp_safe) {
return false;
}
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)entry_frame_call_wrapper();
bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > _FP);
return jcw_safe;
} }
intptr_t* younger_sp = sp(); intptr_t* younger_sp = sp();
@ -291,13 +279,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
} }
if (sender.is_entry_frame()) { if (sender.is_entry_frame()) {
// Validate the JavaCallWrapper an entry frame must have return sender.is_entry_frame_valid(thread);
address jcw = (address)sender.entry_frame_call_wrapper();
bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > sender_fp);
return jcw_safe;
} }
// If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size // If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,9 @@
// make sure the defines don't screw up the declarations later on in this file // make sure the defines don't screw up the declarations later on in this file
#define DONT_USE_REGISTER_DEFINES #define DONT_USE_REGISTER_DEFINES
#include "precompiled.hpp" // Note: precompiled headers can not be used in this file because of the above
// definition
#include "asm/assembler.hpp" #include "asm/assembler.hpp"
#include "asm/register.hpp" #include "asm/register.hpp"
#include "interp_masm_sparc.hpp" #include "interp_masm_sparc.hpp"

View file

@ -108,17 +108,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// Entry frame checks // Entry frame checks
if (is_entry_frame()) { if (is_entry_frame()) {
// an entry frame must have a valid fp. // an entry frame must have a valid fp.
return fp_safe && is_entry_frame_valid(thread);
if (!fp_safe) return false;
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > fp);
return jcw_safe;
} }
intptr_t* sender_sp = NULL; intptr_t* sender_sp = NULL;
@ -209,15 +199,8 @@ bool frame::safe_for_sender(JavaThread *thread) {
} }
// construct the potential sender // construct the potential sender
frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc); frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
return sender.is_entry_frame_valid(thread);
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > (address)sender.fp());
return jcw_safe;
} }
CompiledMethod* nm = sender_blob->as_compiled_method_or_null(); CompiledMethod* nm = sender_blob->as_compiled_method_or_null();

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2016 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View file

@ -1173,7 +1173,7 @@ void ClassLoaderData::print_value_on(outputStream* out) const {
if (class_loader() == NULL) { if (class_loader() == NULL) {
out->print("NULL class_loader"); out->print("NULL class_loader");
} else { } else {
out->print("class loader " INTPTR_FORMAT, p2i(this)); out->print("class loader " INTPTR_FORMAT " ", p2i(this));
class_loader()->print_value_on(out); class_loader()->print_value_on(out);
} }
} }

View file

@ -316,10 +316,14 @@ size_t G1Analytics::predict_pending_cards() const {
return get_new_size_prediction(_pending_cards_seq); return get_new_size_prediction(_pending_cards_seq);
} }
double G1Analytics::last_known_gc_end_time_sec() const { double G1Analytics::oldest_known_gc_end_time_sec() const {
return _recent_prev_end_times_for_all_gcs_sec->oldest(); return _recent_prev_end_times_for_all_gcs_sec->oldest();
} }
double G1Analytics::last_known_gc_end_time_sec() const {
return _recent_prev_end_times_for_all_gcs_sec->last();
}
void G1Analytics::update_recent_gc_times(double end_time_sec, void G1Analytics::update_recent_gc_times(double end_time_sec,
double pause_time_ms) { double pause_time_ms) {
_recent_gc_times_ms->add(pause_time_ms); _recent_gc_times_ms->add(pause_time_ms);

View file

@ -155,6 +155,7 @@ public:
void update_recent_gc_times(double end_time_sec, double elapsed_ms); void update_recent_gc_times(double end_time_sec, double elapsed_ms);
void compute_pause_time_ratio(double interval_ms, double pause_time_ms); void compute_pause_time_ratio(double interval_ms, double pause_time_ms);
double oldest_known_gc_end_time_sec() const;
double last_known_gc_end_time_sec() const; double last_known_gc_end_time_sec() const;
}; };

View file

@ -28,6 +28,7 @@
#include "classfile/symbolTable.hpp" #include "classfile/symbolTable.hpp"
#include "code/codeCache.hpp" #include "code/codeCache.hpp"
#include "code/icBuffer.hpp" #include "code/icBuffer.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/bufferingOopClosure.hpp" #include "gc/g1/bufferingOopClosure.hpp"
#include "gc/g1/concurrentG1Refine.hpp" #include "gc/g1/concurrentG1Refine.hpp"
#include "gc/g1/concurrentG1RefineThread.hpp" #include "gc/g1/concurrentG1RefineThread.hpp"
@ -2473,9 +2474,20 @@ size_t G1CollectedHeap::max_capacity() const {
} }
jlong G1CollectedHeap::millis_since_last_gc() { jlong G1CollectedHeap::millis_since_last_gc() {
// assert(false, "NYI"); jlong now = os::elapsed_counter() / NANOSECS_PER_MILLISEC;
const G1Analytics* analytics = _g1_policy->analytics();
double last = analytics->last_known_gc_end_time_sec();
jlong ret_val = now - (last * 1000);
if (ret_val < 0) {
// See the notes in GenCollectedHeap::millis_since_last_gc()
// for more information about the implementation.
log_warning(gc)("Detected clock going backwards. "
"Milliseconds since last GC would be " JLONG_FORMAT
". returning zero instead.", ret_val);
return 0; return 0;
} }
return ret_val;
}
void G1CollectedHeap::prepare_for_verify() { void G1CollectedHeap::prepare_for_verify() {
_verifier->prepare_for_verify(); _verifier->prepare_for_verify();

View file

@ -604,7 +604,7 @@ void G1DefaultPolicy::record_collection_pause_end(double pause_time_ms, size_t c
_analytics->report_alloc_rate_ms(alloc_rate_ms); _analytics->report_alloc_rate_ms(alloc_rate_ms);
double interval_ms = double interval_ms =
(end_time_sec - _analytics->last_known_gc_end_time_sec()) * 1000.0; (end_time_sec - _analytics->oldest_known_gc_end_time_sec()) * 1000.0;
_analytics->update_recent_gc_times(end_time_sec, pause_time_ms); _analytics->update_recent_gc_times(end_time_sec, pause_time_ms);
_analytics->compute_pause_time_ratio(interval_ms, pause_time_ms); _analytics->compute_pause_time_ratio(interval_ms, pause_time_ms);
} }

View file

@ -1256,21 +1256,21 @@ class GenTimeOfLastGCClosure: public GenCollectedHeap::GenClosure {
}; };
jlong GenCollectedHeap::millis_since_last_gc() { jlong GenCollectedHeap::millis_since_last_gc() {
// We need a monotonically non-decreasing time in ms but // javaTimeNanos() is guaranteed to be monotonically non-decreasing
// os::javaTimeMillis() does not guarantee monotonicity. // provided the underlying platform provides such a time source
// (and it is bug free). So we still have to guard against getting
// back a time later than 'now'.
jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
GenTimeOfLastGCClosure tolgc_cl(now); GenTimeOfLastGCClosure tolgc_cl(now);
// iterate over generations getting the oldest // iterate over generations getting the oldest
// time that a generation was collected // time that a generation was collected
generation_iterate(&tolgc_cl, false); generation_iterate(&tolgc_cl, false);
// javaTimeNanos() is guaranteed to be monotonically non-decreasing
// provided the underlying platform provides such a time source
// (and it is bug free). So we still have to guard against getting
// back a time later than 'now'.
jlong retVal = now - tolgc_cl.time(); jlong retVal = now - tolgc_cl.time();
if (retVal < 0) { if (retVal < 0) {
NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, retVal);) log_warning(gc)("Detected clock going backwards. "
"Milliseconds since last GC would be " JLONG_FORMAT
". returning zero instead.", retVal);
return 0; return 0;
} }
return retVal; return retVal;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View file

@ -350,6 +350,11 @@ WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
return (jlong)alignment; return (jlong)alignment;
WB_END WB_END
WB_ENTRY(jlong, WB_GetHeapAlignment(JNIEnv* env, jobject o))
size_t alignment = Universe::heap()->collector_policy()->heap_alignment();
return (jlong)alignment;
WB_END
#if INCLUDE_ALL_GCS #if INCLUDE_ALL_GCS
WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj)) WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj))
G1CollectedHeap* g1 = G1CollectedHeap::heap(); G1CollectedHeap* g1 = G1CollectedHeap::heap();
@ -401,14 +406,21 @@ WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
WB_END WB_END
WB_ENTRY(jlong, WB_PSVirtualSpaceAlignment(JNIEnv* env, jobject o)) WB_ENTRY(jlong, WB_PSVirtualSpaceAlignment(JNIEnv* env, jobject o))
ParallelScavengeHeap* ps = ParallelScavengeHeap::heap(); #if INCLUDE_ALL_GCS
size_t alignment = ps->gens()->virtual_spaces()->alignment(); if (UseParallelGC) {
return (jlong)alignment; return ParallelScavengeHeap::heap()->gens()->virtual_spaces()->alignment();
}
#endif // INCLUDE_ALL_GCS
THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "WB_PSVirtualSpaceAlignment: Parallel GC is not enabled");
WB_END WB_END
WB_ENTRY(jlong, WB_PSHeapGenerationAlignment(JNIEnv* env, jobject o)) WB_ENTRY(jlong, WB_PSHeapGenerationAlignment(JNIEnv* env, jobject o))
size_t alignment = ParallelScavengeHeap::heap()->generation_alignment(); #if INCLUDE_ALL_GCS
return (jlong)alignment; if (UseParallelGC) {
return ParallelScavengeHeap::heap()->generation_alignment();
}
#endif // INCLUDE_ALL_GCS
THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "WB_PSHeapGenerationAlignment: Parallel GC is not enabled");
WB_END WB_END
WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env)) WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
@ -1694,6 +1706,7 @@ static JNINativeMethod methods[] = {
{CC"getVMAllocationGranularity", CC"()J", (void*)&WB_GetVMAllocationGranularity }, {CC"getVMAllocationGranularity", CC"()J", (void*)&WB_GetVMAllocationGranularity },
{CC"getVMLargePageSize", CC"()J", (void*)&WB_GetVMLargePageSize}, {CC"getVMLargePageSize", CC"()J", (void*)&WB_GetVMLargePageSize},
{CC"getHeapSpaceAlignment", CC"()J", (void*)&WB_GetHeapSpaceAlignment}, {CC"getHeapSpaceAlignment", CC"()J", (void*)&WB_GetHeapSpaceAlignment},
{CC"getHeapAlignment", CC"()J", (void*)&WB_GetHeapAlignment},
{CC"isClassAlive0", CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive }, {CC"isClassAlive0", CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive },
{CC"parseCommandLine0", {CC"parseCommandLine0",
CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;", CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",

View file

@ -225,6 +225,19 @@ JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) con
return NULL; return NULL;
} }
bool frame::is_entry_frame_valid(JavaThread* thread) const {
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)fp()); // less than stack base
if (!jcw_safe) {
return false;
}
// Validate sp saved in the java frame anchor
JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
return (jfa->last_Java_sp() > sp());
}
bool frame::should_be_deoptimized() const { bool frame::should_be_deoptimized() const {
if (_deopt_state == is_deoptimized || if (_deopt_state == is_deoptimized ||
!is_compiled_frame() ) return false; !is_compiled_frame() ) return false;

View file

@ -166,6 +166,8 @@ class frame VALUE_OBJ_CLASS_SPEC {
frame sender_for_interpreter_frame(RegisterMap* map) const; frame sender_for_interpreter_frame(RegisterMap* map) const;
frame sender_for_native_frame(RegisterMap* map) const; frame sender_for_native_frame(RegisterMap* map) const;
bool is_entry_frame_valid(JavaThread* thread) const;
// All frames: // All frames:
// A low-level interface for vframes: // A low-level interface for vframes:

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -226,6 +226,9 @@ BUNDLE_UP_AND_EXIT = \
( \ ( \
jtregExitCode=$$? && \ jtregExitCode=$$? && \
_summary="$(SUMMARY_TXT)"; \ _summary="$(SUMMARY_TXT)"; \
if [ $${jtregExitCode} = 1 ] ; then \
jtregExitCode=0; \
fi; \
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \ $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \ $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
if [ -r "$${_summary}" ] ; then \ if [ -r "$${_summary}" ] ; then \

View file

@ -24,6 +24,7 @@
/* /*
* @test RandomAllocationTest * @test RandomAllocationTest
* @key stress
* @summary stressing code cache by allocating randomly sized "dummy" code blobs * @summary stressing code cache by allocating randomly sized "dummy" code blobs
* @library /testlibrary /test/lib / * @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc

View file

@ -24,6 +24,7 @@
/* /*
* @test UnexpectedDeoptimizationTest * @test UnexpectedDeoptimizationTest
* @key stress
* @summary stressing code cache by forcing unexpected deoptimizations * @summary stressing code cache by forcing unexpected deoptimizations
* @library /testlibrary /test/lib / * @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc

View file

@ -25,6 +25,7 @@
/** /**
* @test * @test
* @bug 7184394 * @bug 7184394
* @key stress
* @summary add intrinsics to use AES instructions * @summary add intrinsics to use AES instructions
* @library /testlibrary / * @library /testlibrary /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc

View file

@ -26,7 +26,6 @@
* @bug 8015396 * @bug 8015396
* @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X) * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X)
* *
* @ignore 8145543
* @run main compiler.floatingpoint.ModNaN * @run main compiler.floatingpoint.ModNaN
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -60,13 +60,13 @@ public class TestNewSizeFlags {
// Test NewSize and MaxNewSize // Test NewSize and MaxNewSize
testNewSizeFlags(20 * M, 10 * M, 30 * M, 40 * M, options, false); testNewSizeFlags(20 * M, 10 * M, 30 * M, 40 * M, options, false);
testNewSizeFlags(10 * M, 20 * M, 30 * M, 40 * M, options, false); testNewSizeFlags(10 * M, 20 * M, 30 * M, 80 * M, options, false);
testNewSizeFlags(-1, 20 * M, 30 * M, 40 * M, options, false); testNewSizeFlags(-1, 20 * M, 30 * M, 40 * M, options, false);
testNewSizeFlags(10 * M, -1, 30 * M, 40 * M, options, false); testNewSizeFlags(10 * M, -1, 30 * M, 40 * M, options, false);
testNewSizeFlags(20 * M, 20 * M, 30 * M, 40 * M, options, false); testNewSizeFlags(20 * M, 20 * M, 30 * M, 40 * M, options, false);
testNewSizeFlags(20 * M, 30 * M, 40 * M, 50 * M, options, false); testNewSizeFlags(20 * M, 30 * M, 40 * M, 50 * M, options, false);
testNewSizeFlags(30 * M, 100 * M, 150 * M, 200 * M, options, false); testNewSizeFlags(30 * M, 100 * M, 150 * M, 200 * M, options, false);
testNewSizeFlags(0, -1, 30 * M, 40 * M, options, false); testNewSizeFlags(20 * M, 30 * M, 128 * M, 128 * M, options, false);
// Test -Xmn // Test -Xmn
testXmnFlags(0, 30 * M, 40 * M, options, true); testXmnFlags(0, 30 * M, 40 * M, options, true);
@ -88,9 +88,11 @@ public class TestNewSizeFlags {
long heapSize, long maxHeapSize, long heapSize, long maxHeapSize,
LinkedList<String> options, LinkedList<String> options,
boolean failureExpected) throws Exception { boolean failureExpected) throws Exception {
long expectedNewSize = newSize;
long expectedMaxNewSize = (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize);
testVMOptions(newSize, maxNewSize, testVMOptions(newSize, maxNewSize,
heapSize, maxHeapSize, heapSize, maxHeapSize,
newSize, (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize), expectedNewSize, expectedMaxNewSize,
options, failureExpected); options, failureExpected);
} }
@ -159,7 +161,9 @@ public class TestNewSizeFlags {
"-XX:-UseLargePages", "-XX:-UseLargePages",
NewSizeVerifier.class.getName(), NewSizeVerifier.class.getName(),
Long.toString(expectedNewSize), Long.toString(expectedNewSize),
Long.toString(expectedMaxNewSize) Long.toString(expectedMaxNewSize),
Long.toString(heapSize),
Long.toString(maxHeapSize)
); );
vmOptions.removeIf(String::isEmpty); vmOptions.removeIf(String::isEmpty);
ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(vmOptions.toArray(new String[vmOptions.size()])); ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(vmOptions.toArray(new String[vmOptions.size()]));
@ -177,7 +181,12 @@ public class TestNewSizeFlags {
*/ */
public static class NewSizeVerifier { public static class NewSizeVerifier {
static WhiteBox wb = WhiteBox.getWhiteBox(); private static final WhiteBox WB = WhiteBox.getWhiteBox();
private static final GCTypes.YoungGCType YOUNG_GC_TYPE = GCTypes.YoungGCType.getYoungGCType();
private static final long HEAP_SPACE_ALIGNMENT = WB.getHeapSpaceAlignment();
private static final long HEAP_ALIGNMENT = WB.getHeapAlignment();
private static final long PS_VIRTUAL_SPACE_ALIGNMENT =
(YOUNG_GC_TYPE == GCTypes.YoungGCType.PSNew) ? WB.psVirtualSpaceAlignment() : 0;
public static final int ARRAY_LENGTH = 100; public static final int ARRAY_LENGTH = 100;
public static final int CHUNK_SIZE = 1024; public static final int CHUNK_SIZE = 1024;
@ -185,63 +194,79 @@ public class TestNewSizeFlags {
public static byte garbage[][] = new byte[ARRAY_LENGTH][]; public static byte garbage[][] = new byte[ARRAY_LENGTH][];
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
if (args.length != 2) { if (args.length != 4) {
throw new IllegalArgumentException("Expected 2 args: <expectedNewSize> <expectedMaxNewSize>"); throw new IllegalArgumentException("Expected 4 args: <expectedNewSize> <expectedMaxNewSize> <initialHeapSize> <maxHeapSize>");
} }
final long newSize = Long.valueOf(args[0]); final long newSize = Long.valueOf(args[0]);
final long maxNewSize = Long.valueOf(args[1]); final long maxNewSize = Long.valueOf(args[1]);
final long initialHeapSize = Long.valueOf(args[2]);
final long maxHeapSize = Long.valueOf(args[3]);
// verify initial size // verify initial size
verifyNewSize(newSize, maxNewSize); verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize);
// force GC and verify that size is still correct // force GC and verify that size is still correct
AllocationHelper allocator = new AllocationHelper(MAX_ITERATIONS, ARRAY_LENGTH, CHUNK_SIZE, () -> (verifyNewSize(newSize, maxNewSize))); AllocationHelper allocator = new AllocationHelper(MAX_ITERATIONS, ARRAY_LENGTH, CHUNK_SIZE, () -> (verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize)));
allocator.allocateMemoryAndVerifyNoOOME(); allocator.allocateMemoryAndVerifyNoOOME();
} }
/** /**
* Verify that actual young gen size conforms NewSize and MaxNewSize values. * Verify that actual young gen size conforms NewSize and MaxNewSize values.
*/ */
public static Void verifyNewSize(long newSize, long maxNewSize) { public static Void verifyNewSize(long newSize, long maxNewSize,
long alignedNewSize = alignNewSize(newSize); long initialHeapSize, long maxHeapSize) {
long alignedMaxNewSize = alignNewSize(maxNewSize); long alignedNewSize = alignGenSize(newSize);
long alignedMaxNewSize = alignGenSize(maxNewSize);
long alignedXms = alignHeapSize(initialHeapSize);
long alignedXmx = alignHeapSize(maxHeapSize);
MemoryUsage youngGenUsage = getYoungGenUsage(); MemoryUsage youngGenUsage = getYoungGenUsage();
long initSize = youngGenUsage.getInit();
long commitedSize = youngGenUsage.getCommitted();
long maxSize = youngGenUsage.getMax();
if (newSize != -1) { if (newSize != -1) {
if (youngGenUsage.getInit() < alignedNewSize) { if (initSize < alignedNewSize) {
throw new RuntimeException("initial new size < NewSize value: " throw new RuntimeException("initial new size < NewSize value: "
+ youngGenUsage.getInit() + " < " + alignedNewSize); + initSize + " < " + alignedNewSize);
} }
if (youngGenUsage.getCommitted() < alignedNewSize) { if (commitedSize < alignedNewSize) {
throw new RuntimeException("actual new size < NewSize value: " throw new RuntimeException("actual new size < NewSize value: "
+ youngGenUsage.getCommitted() + " < " + alignedNewSize); + commitedSize + " < " + alignedNewSize);
} }
// for G1 max new size == committed new size // for G1 max new size == committed new size
if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1 if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
&& youngGenUsage.getMax() < alignedNewSize) { && maxSize < alignedNewSize) {
throw new RuntimeException("max new size < NewSize value: " throw new RuntimeException("max new size < NewSize value: "
+ youngGenUsage.getMax() + " < " + alignedNewSize); + maxSize + " < " + alignedNewSize);
} }
} }
if (maxNewSize != -1) { if (maxNewSize != -1) {
if (youngGenUsage.getInit() > alignedMaxNewSize) { if (initSize > alignedMaxNewSize) {
throw new RuntimeException("initial new size > MaxNewSize value: " throw new RuntimeException("initial new size > MaxNewSize value: "
+ youngGenUsage.getInit() + " > " + alignedMaxNewSize); + initSize + " > " + alignedMaxNewSize);
} }
if (youngGenUsage.getCommitted() > alignedMaxNewSize) { if (commitedSize > alignedMaxNewSize) {
throw new RuntimeException("actual new size > MaxNewSize value: " throw new RuntimeException("actual new size > MaxNewSize value: "
+ youngGenUsage.getCommitted() + " > " + alignedMaxNewSize); + commitedSize + " > " + alignedMaxNewSize);
} }
if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1 if (alignedXms != alignedXmx) {
&& youngGenUsage.getMax() != alignedMaxNewSize) { if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
&& maxSize != alignedMaxNewSize) {
throw new RuntimeException("max new size != MaxNewSize value: " throw new RuntimeException("max new size != MaxNewSize value: "
+ youngGenUsage.getMax() + " != " + alignedMaxNewSize); + maxSize + " != " + alignedMaxNewSize);
}
} else {
if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
&& maxSize != alignedNewSize) {
throw new RuntimeException("max new size != NewSize for case InitialHeapSize == MaxHeapSize value: "
+ maxSize + " != " + alignedNewSize + " HeapSize == " + alignedXms);
}
} }
} }
return null; return null;
@ -256,41 +281,47 @@ public class TestNewSizeFlags {
* For all GCs used value is 0. * For all GCs used value is 0.
*/ */
private static MemoryUsage getYoungGenUsage() { private static MemoryUsage getYoungGenUsage() {
if (GCTypes.YoungGCType.getYoungGCType() == GCTypes.YoungGCType.G1) { MemoryUsage edenUsage = HeapRegionUsageTool.getEdenUsage();
return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit() MemoryUsage survivorUsage = HeapRegionUsageTool.getSurvivorUsage();
+ HeapRegionUsageTool.getSurvivorUsage().getInit(), long edenUsageInit = edenUsage.getInit();
0, long edenUsageCommited = edenUsage.getCommitted();
HeapRegionUsageTool.getEdenUsage().getCommitted() long survivorUsageInit = survivorUsage.getInit();
+ HeapRegionUsageTool.getSurvivorUsage().getCommitted(), long survivorUsageCommited = survivorUsage.getCommitted();
Long.MAX_VALUE);
if (YOUNG_GC_TYPE == GCTypes.YoungGCType.G1) {
return new MemoryUsage(edenUsageInit + survivorUsageInit, 0,
edenUsageCommited + survivorUsageCommited, Long.MAX_VALUE);
} else { } else {
return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit() return new MemoryUsage(edenUsageInit + survivorUsageInit * 2, 0,
+ HeapRegionUsageTool.getSurvivorUsage().getInit() * 2, edenUsageCommited + survivorUsageCommited * 2,
0, edenUsage.getMax() + survivorUsage.getMax() * 2);
HeapRegionUsageTool.getEdenUsage().getCommitted()
+ HeapRegionUsageTool.getSurvivorUsage().getCommitted() * 2,
HeapRegionUsageTool.getEdenUsage().getMax()
+ HeapRegionUsageTool.getSurvivorUsage().getMax() * 2);
} }
} }
/** /**
* Align value regardful to used young GC. * Align generation size regardful to used young GC.
*/ */
public static long alignNewSize(long value) { public static long alignGenSize(long value) {
switch (GCTypes.YoungGCType.getYoungGCType()) { switch (YOUNG_GC_TYPE) {
case DefNew: case DefNew:
case ParNew: case ParNew:
return HeapRegionUsageTool.alignDown(value, wb.getHeapSpaceAlignment()); return HeapRegionUsageTool.alignDown(value, HEAP_SPACE_ALIGNMENT);
case PSNew: case PSNew:
return HeapRegionUsageTool.alignUp(HeapRegionUsageTool.alignDown(value, return HeapRegionUsageTool.alignUp(HeapRegionUsageTool.alignDown(value,
wb.getHeapSpaceAlignment()), HEAP_SPACE_ALIGNMENT),
wb.psVirtualSpaceAlignment()); PS_VIRTUAL_SPACE_ALIGNMENT);
case G1: case G1:
return HeapRegionUsageTool.alignUp(value, wb.g1RegionSize()); return HeapRegionUsageTool.alignUp(value, WB.g1RegionSize());
default: default:
throw new RuntimeException("Unexpected young GC type"); throw new RuntimeException("Unexpected young GC type");
} }
} }
/**
* Align heap size.
*/
public static long alignHeapSize(long value){
return HeapRegionUsageTool.alignUp(value,HEAP_ALIGNMENT);
}
} }
} }

View file

@ -24,6 +24,7 @@
/* /*
* @test TestIHOPErgo * @test TestIHOPErgo
* @bug 8148397 * @bug 8148397
* @key stress
* @summary Test checks that behavior of Adaptive and Static IHOP at concurrent cycle initiation * @summary Test checks that behavior of Adaptive and Static IHOP at concurrent cycle initiation
* @requires vm.gc.G1 * @requires vm.gc.G1
* @requires !vm.flightRecorder * @requires !vm.flightRecorder

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 8007320 8014709 * @bug 8007320 8014709 8163231
* @summary Test all optional fields in ConstMethod * @summary Test all optional fields in ConstMethod
* @compile -g -parameters ConstMethodTest.java * @compile -g -parameters ConstMethodTest.java
* @run main ConstMethodTest * @run main ConstMethodTest
@ -122,8 +122,8 @@ public class ConstMethodTest {
equal(ann.length, 3); equal(ann.length, 3);
Annotation foo = ann[0][0]; Annotation foo = ann[0][0];
Annotation bar = ann[1][0]; Annotation bar = ann[1][0];
equal(foo.toString(), "@Named(value=aName)"); equal(foo.toString(), "@Named(value=\"aName\")");
equal(bar.toString(), "@Named(value=bName)"); equal(bar.toString(), "@Named(value=\"bName\")");
check(foo.equals(foo)); check(foo.equals(foo));
check(bar.equals(bar)); check(bar.equals(bar));
check(! foo.equals(bar)); check(! foo.equals(bar));
@ -131,7 +131,7 @@ public class ConstMethodTest {
Annotation[] ann2 = m.getAnnotations(); Annotation[] ann2 = m.getAnnotations();
equal(ann2.length, 1); equal(ann2.length, 1);
Annotation mann = ann2[0]; Annotation mann = ann2[0];
equal(mann.toString(), "@MyAnnotation(date=today, name=someName, value=Hello World)"); equal(mann.toString(), "@MyAnnotation(date=\"today\", name=\"someName\", value=\"Hello World\")");
// Test Method parameter names // Test Method parameter names
Parameter[] parameters = m.getParameters(); Parameter[] parameters = m.getParameters();
if(parameters == null) if(parameters == null)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -370,7 +370,7 @@ public class RedefineAnnotations {
} }
private static void verifyTestAnnSite(Annotation testAnn, String expectedSite) { private static void verifyTestAnnSite(Annotation testAnn, String expectedSite) {
String expectedAnn = "@TestAnn(site=" + expectedSite + ")"; String expectedAnn = "@TestAnn(site=\"" + expectedSite + "\")";
assertTrue(testAnn.toString().equals(expectedAnn), assertTrue(testAnn.toString().equals(expectedAnn),
"Expected \"" + expectedAnn + "\", got \"" + testAnn + "\""); "Expected \"" + expectedAnn + "\", got \"" + testAnn + "\"");
} }

View file

@ -242,7 +242,7 @@ int main (int argc, const char** argv) {
CLASS_PATH_OPT, javaclasspath); CLASS_PATH_OPT, javaclasspath);
options[0].optionString = "-Xint"; options[0].optionString = "-Xint";
options[1].optionString = "-Xss328k"; options[1].optionString = "-Xss1M";
options[2].optionString = javaclasspathopt; options[2].optionString = javaclasspathopt;
vm_args.version = JNI_VERSION_1_2; vm_args.version = JNI_VERSION_1_2;

View file

@ -372,3 +372,4 @@ e04a15153cc293f05fcd60bc98236f50e16af46a jdk-9+124
bdc3c0b737efbf899709eb3121ce760dcfb51151 jdk-9+127 bdc3c0b737efbf899709eb3121ce760dcfb51151 jdk-9+127
8a7681a9d70640ac7fbf05c28f53c1d51d8d00a1 jdk-9+128 8a7681a9d70640ac7fbf05c28f53c1d51d8d00a1 jdk-9+128
74241304e87b0d463391a8ecab40979b5af86dc2 jdk-9+129 74241304e87b0d463391a8ecab40979b5af86dc2 jdk-9+129
e66cdc2de6b02443911d386fc9217b0d824d0686 jdk-9+130

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -94,12 +94,12 @@ public abstract class XPathFactory {
try { try {
return newInstance(DEFAULT_OBJECT_MODEL_URI); return newInstance(DEFAULT_OBJECT_MODEL_URI);
} catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) { } catch (XPathFactoryConfigurationException e) {
throw new RuntimeException( throw new RuntimeException(
"XPathFactory#newInstance() failed to create an XPathFactory for the default object model: " "XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
+ DEFAULT_OBJECT_MODEL_URI + DEFAULT_OBJECT_MODEL_URI
+ " with the XPathFactoryConfigurationException: " + " with the XPathFactoryConfigurationException: "
+ xpathFactoryConfigurationException.toString() + e.getMessage(), e
); );
} }
} }

View file

@ -27,4 +27,4 @@ javax/xml/jaxp/isolatedjdk/catalog/PropertiesTest.sh 8147431 generic-
javax/xml/jaxp/unittest/common/TransformationWarningsTest.java 8150145 generic-all javax/xml/jaxp/unittest/common/TransformationWarningsTest.java 8150145 generic-all
javax/xml/jaxp/unittest/stream/FactoryFindTest.java 8156508 generic-all javax/xml/jaxp/unittest/common/ValidationWarningsTest.java 8150145 generic-all

View file

@ -14,6 +14,11 @@ keys=intermittent randomness
# Tests that must run in othervm mode # Tests that must run in othervm mode
othervm.dirs=javax/xml/jaxp othervm.dirs=javax/xml/jaxp
lib.dirs = /javax/xml/jaxp/libs
# Declare module dependency
modules=java.xml
# Group definitions # Group definitions
groups=TEST.groups groups=TEST.groups

View file

@ -1,12 +0,0 @@
# This file identifies root(s) of the test-ng hierarchy.
TestNG.dirs = .
lib.dirs = /javax/xml/jaxp/libs
# Tests that must run in othervm mode
othervm.dirs= /javax/xml/jaxp/functional
# Declare module dependency
modules=java.xml

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,17 +28,21 @@ import static catalog.CatalogTestUtils.catalogResolver;
import javax.xml.catalog.CatalogException; import javax.xml.catalog.CatalogException;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.CatalogReferCircularityTest
* @run testng/othervm catalog.CatalogReferCircularityTest
* @summary Via nextCatalog entry, the catalog reference chain may be * @summary Via nextCatalog entry, the catalog reference chain may be
* a (partial) closed circuit. For instance, a catalog may use itself * a (partial) closed circuit. For instance, a catalog may use itself
* as an additional catalog specified in its own nextCatalog entry. * as an additional catalog specified in its own nextCatalog entry.
* This case tests if the implementation handles this issue. * This case tests if the implementation handles this issue.
* @compile ../../libs/catalog/CatalogTestUtils.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class CatalogReferCircularityTest { public class CatalogReferCircularityTest {
@Test(dataProvider = "catalogName", @Test(dataProvider = "catalogName",
@ -49,7 +53,7 @@ public class CatalogReferCircularityTest {
} }
@DataProvider(name = "catalogName") @DataProvider(name = "catalogName")
private Object[][] catalogName() { public Object[][] catalogName() {
return new Object[][] { return new Object[][] {
// This catalog defines itself as next catalog. // This catalog defines itself as next catalog.
{ "catalogReferCircle-itself.xml" }, { "catalogReferCircle-itself.xml" },
@ -60,3 +64,4 @@ public class CatalogReferCircularityTest {
{ "catalogReferCircle-left.xml" } }; { "catalogReferCircle-left.xml" } };
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,13 +29,18 @@ import javax.xml.catalog.CatalogFeatures.Feature;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DefaultFeaturesTest
* @run testng/othervm catalog.DefaultFeaturesTest
* @summary This case tests if the default feature values are expected. * @summary This case tests if the default feature values are expected.
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class DefaultFeaturesTest { public class DefaultFeaturesTest {
private CatalogFeatures defaultFeature; private CatalogFeatures defaultFeature;
@ -56,7 +61,7 @@ public class DefaultFeaturesTest {
} }
@DataProvider(name = "feature-value") @DataProvider(name = "feature-value")
private Object[][] data() { public Object[][] data() {
return new Object[][] { return new Object[][] {
{ Feature.FILES, null }, { Feature.FILES, null },
{ Feature.PREFER, CatalogTestUtils.PREFER_PUBLIC }, { Feature.PREFER, CatalogTestUtils.PREFER_PUBLIC },
@ -64,3 +69,4 @@ public class DefaultFeaturesTest {
{ Feature.RESOLVE, CatalogTestUtils.RESOLVE_STRICT } }; { Feature.RESOLVE, CatalogTestUtils.RESOLVE_STRICT } };
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,8 @@ import static catalog.CatalogTestUtils.DEFER_TRUE;
import static catalog.CatalogTestUtils.getCatalogPath; import static catalog.CatalogTestUtils.getCatalogPath;
import static javax.xml.catalog.CatalogFeatures.Feature.DEFER; import static javax.xml.catalog.CatalogFeatures.Feature.DEFER;
import static javax.xml.catalog.CatalogManager.catalog; import static javax.xml.catalog.CatalogManager.catalog;
import static jaxp.library.JAXPTestUtilities.runWithAllPerm;
import static jaxp.library.JAXPTestUtilities.tryRunWithAllPerm;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -36,16 +38,20 @@ import javax.xml.catalog.CatalogFeatures;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DeferFeatureTest
* @run testng/othervm catalog.DeferFeatureTest
* @summary This case tests whether the catalogs specified in delegateSystem, * @summary This case tests whether the catalogs specified in delegateSystem,
* delegatePublic, delegateURI and nextCatalog entries are used lazily * delegatePublic, delegateURI and nextCatalog entries are used lazily
* in resolution via defer feature. * in resolution via defer feature.
* @compile ../../libs/catalog/CatalogTestUtils.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class DeferFeatureTest { public class DeferFeatureTest {
@Test(dataProvider = "catalog-countOfLoadedCatalogFile") @Test(dataProvider = "catalog-countOfLoadedCatalogFile")
@ -55,7 +61,7 @@ public class DeferFeatureTest {
} }
@DataProvider(name = "catalog-countOfLoadedCatalogFile") @DataProvider(name = "catalog-countOfLoadedCatalogFile")
private Object[][] data() { public Object[][] data() {
return new Object[][]{ return new Object[][]{
// By default, alternative catalogs are not loaded. // By default, alternative catalogs are not loaded.
{createCatalog(CatalogFeatures.defaults()), 0}, {createCatalog(CatalogFeatures.defaults()), 0},
@ -75,9 +81,9 @@ public class DeferFeatureTest {
} }
private int loadedCatalogCount(Catalog catalog) throws Exception { private int loadedCatalogCount(Catalog catalog) throws Exception {
Method method = catalog.getClass().getDeclaredMethod( Method method = tryRunWithAllPerm(() -> catalog.getClass().getDeclaredMethod("loadedCatalogCount"));
"loadedCatalogCount"); runWithAllPerm(() -> method.setAccessible(true));
method.setAccessible(true);
return (int) method.invoke(catalog); return (int) method.invoke(catalog);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DelegatePublicTest
* @run testng/othervm catalog.DelegatePublicTest
* @summary Get matched URIs from DelegatePublic entries. * @summary Get matched URIs from DelegatePublic entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class DelegatePublicTest { public class DelegatePublicTest {
@Test(dataProvider = "publicId-matchedUri") @Test(dataProvider = "publicId-matchedUri")
@ -48,7 +51,7 @@ public class DelegatePublicTest {
} }
@DataProvider(name = "publicId-matchedUri") @DataProvider(name = "publicId-matchedUri")
private Object[][] dataOnMatch() { public Object[][] dataOnMatch() {
return new Object[][] { return new Object[][] {
// The matched URI of the specified public id is defined in // The matched URI of the specified public id is defined in
// a delegate catalog file of the current catalog file. // a delegate catalog file of the current catalog file.
@ -79,7 +82,7 @@ public class DelegatePublicTest {
} }
@DataProvider(name = "publicId-expectedExceptionClass") @DataProvider(name = "publicId-expectedExceptionClass")
private Object[][] dataOnException() { public Object[][] dataOnException() {
return new Object[][] { return new Object[][] {
// The matched delegatePublic entry of the specified public id // The matched delegatePublic entry of the specified public id
// defines a non-existing delegate catalog file. That should // defines a non-existing delegate catalog file. That should
@ -97,3 +100,4 @@ public class DelegatePublicTest {
return catalogResolver("delegatePublic.xml"); return catalogResolver("delegatePublic.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DelegateSystemTest
* @run testng/othervm catalog.DelegateSystemTest
* @summary Get matched URIs from delegateSystem entries. * @summary Get matched URIs from delegateSystem entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class DelegateSystemTest { public class DelegateSystemTest {
@Test(dataProvider = "systemId-matchedUri") @Test(dataProvider = "systemId-matchedUri")
@ -48,7 +51,7 @@ public class DelegateSystemTest {
} }
@DataProvider(name = "systemId-matchedUri") @DataProvider(name = "systemId-matchedUri")
private Object[][] dataOnMatch() { public Object[][] dataOnMatch() {
return new Object[][] { return new Object[][] {
// The matched URI of the specified system id is defined in // The matched URI of the specified system id is defined in
// a delegate catalog file of the current catalog file. // a delegate catalog file of the current catalog file.
@ -79,7 +82,7 @@ public class DelegateSystemTest {
} }
@DataProvider(name = "systemId-expectedExceptionClass") @DataProvider(name = "systemId-expectedExceptionClass")
private Object[][] dataOnException() { public Object[][] dataOnException() {
return new Object[][] { return new Object[][] {
// The matched delegateSystem entry of the specified system id // The matched delegateSystem entry of the specified system id
// defines a non-existing delegate catalog file. That should // defines a non-existing delegate catalog file. That should
@ -97,3 +100,4 @@ public class DelegateSystemTest {
return catalogResolver("delegateSystem.xml"); return catalogResolver("delegateSystem.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.DelegateUriTest
* @run testng/othervm catalog.DelegateUriTest
* @summary Get matched URIs from delegateURI entries. * @summary Get matched URIs from delegateURI entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class DelegateUriTest { public class DelegateUriTest {
@Test(dataProvider = "uri-matchedUri") @Test(dataProvider = "uri-matchedUri")
@ -48,7 +51,7 @@ public class DelegateUriTest {
} }
@DataProvider(name = "uri-matchedUri") @DataProvider(name = "uri-matchedUri")
private Object[][] data() { public Object[][] data() {
return new Object[][] { return new Object[][] {
// The matched URI of the specified URI reference is defined in // The matched URI of the specified URI reference is defined in
// a delegate catalog file of the current catalog file. // a delegate catalog file of the current catalog file.
@ -78,7 +81,7 @@ public class DelegateUriTest {
} }
@DataProvider(name = "uri-expectedExceptionClass") @DataProvider(name = "uri-expectedExceptionClass")
private Object[][] dataOnException() { public Object[][] dataOnException() {
return new Object[][] { return new Object[][] {
// The matched delegateURI entry of the specified URI reference // The matched delegateURI entry of the specified URI reference
// defines a non-existing delegate catalog file. That should // defines a non-existing delegate catalog file. That should
@ -96,3 +99,4 @@ public class DelegateUriTest {
return catalogUriResolver("delegateUri.xml"); return catalogUriResolver("delegateUri.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,16 +32,19 @@ import static catalog.ResolutionChecker.checkUriResolution;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.GroupTest
* @run testng/othervm catalog.GroupTest
* @summary Get matched URIs from system, public and uri entries respectively, * @summary Get matched URIs from system, public and uri entries respectively,
* and some of the entries are enclosed by group entries. * and some of the entries are enclosed by group entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class GroupTest { public class GroupTest {
private static final String CATALOG_GROUP = "group.xml"; private static final String CATALOG_GROUP = "group.xml";
@ -52,7 +55,7 @@ public class GroupTest {
} }
@DataProvider(name = "systemId-matchedUri") @DataProvider(name = "systemId-matchedUri")
private Object[][] dataOnSysId() { public Object[][] dataOnSysId() {
return new Object[][] { return new Object[][] {
// The matched URI of the specified system id is enclosed by a // The matched URI of the specified system id is enclosed by a
// group entry. // group entry.
@ -78,7 +81,7 @@ public class GroupTest {
} }
@DataProvider(name = "publicId-matchedUri") @DataProvider(name = "publicId-matchedUri")
private Object[][] dataOnPubId() { public Object[][] dataOnPubId() {
return new Object[][] { return new Object[][] {
// The matched URI of the specified public id is enclosed by a // The matched URI of the specified public id is enclosed by a
// group entry. // group entry.
@ -104,7 +107,7 @@ public class GroupTest {
} }
@DataProvider(name = "uri-matchedUri") @DataProvider(name = "uri-matchedUri")
private Object[][] dataOnUri() { public Object[][] dataOnUri() {
return new Object[][] { return new Object[][] {
// The matched URI of the specified URI reference is enclosed by // The matched URI of the specified URI reference is enclosed by
// a group entry. // a group entry.
@ -128,3 +131,4 @@ public class GroupTest {
return catalogResolver(CATALOG_GROUP); return catalogResolver(CATALOG_GROUP);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -36,17 +36,20 @@ import javax.xml.catalog.CatalogResolver;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.LoadCatalogTest
* @run testng/othervm catalog.LoadCatalogTest
* @summary When catalog resolver loads catalog files, the current catalog file * @summary When catalog resolver loads catalog files, the current catalog file
* and the catalog files specified by the nextCatalog entries may not * and the catalog files specified by the nextCatalog entries may not
* accessible. This case tests how does the resolver handle this issue. * accessible. This case tests how does the resolver handle this issue.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class LoadCatalogTest { public class LoadCatalogTest {
private static final String CATALOG_LOADCATALOGFILES = "loadCatalogFiles.xml"; private static final String CATALOG_LOADCATALOGFILES = "loadCatalogFiles.xml";
@ -62,7 +65,7 @@ public class LoadCatalogTest {
} }
@DataProvider(name = "entityResolver") @DataProvider(name = "entityResolver")
private Object[][] entityResolver() { public Object[][] entityResolver() {
return new Object[][] { return new Object[][] {
// This EntityResolver loads multiple catalog files one by one. // This EntityResolver loads multiple catalog files one by one.
// All of the files are available. // All of the files are available.
@ -82,7 +85,7 @@ public class LoadCatalogTest {
} }
@DataProvider(name = "uriResolver") @DataProvider(name = "uriResolver")
private Object[][] uriResolver() { public Object[][] uriResolver() {
return new Object[][] { return new Object[][] {
// This URIResolver loads multiple catalog files one by one. // This URIResolver loads multiple catalog files one by one.
// All of the files are available. // All of the files are available.
@ -108,7 +111,7 @@ public class LoadCatalogTest {
} }
@DataProvider(name = "catalogName") @DataProvider(name = "catalogName")
private Object[][] catalogName() { public Object[][] catalogName() {
return new Object[][] { return new Object[][] {
// This catalog file set includes null catalog files. // This catalog file set includes null catalog files.
{ (String[]) null }, { (String[]) null },
@ -118,3 +121,4 @@ public class LoadCatalogTest {
{ new String[] { CATALOG_LOADCATALOGFILES } } }; { new String[] { CATALOG_LOADCATALOGFILES } } };
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,16 +33,19 @@ import javax.xml.catalog.CatalogResolver;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.NextCatalogTest
* @run testng/othervm catalog.NextCatalogTest
* @summary Get matched URIs from system, public and uri entries respectively, * @summary Get matched URIs from system, public and uri entries respectively,
* but some of the entries are defined in none-current catalog files. * but some of the entries are defined in none-current catalog files.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class NextCatalogTest { public class NextCatalogTest {
private static final String CATALOG_NEXTCATALOGLEFT private static final String CATALOG_NEXTCATALOGLEFT
@ -56,7 +59,7 @@ public class NextCatalogTest {
} }
@DataProvider(name = "systemId-matchedUri") @DataProvider(name = "systemId-matchedUri")
private Object[][] dataOnSysId() { public Object[][] dataOnSysId() {
return new Object[][] { return new Object[][] {
// This matched URI of the specified system id is defined in a // This matched URI of the specified system id is defined in a
// next catalog file. // next catalog file.
@ -88,7 +91,7 @@ public class NextCatalogTest {
} }
@DataProvider(name = "publicId-matchedUri") @DataProvider(name = "publicId-matchedUri")
private Object[][] dataOnPubId() { public Object[][] dataOnPubId() {
return new Object[][] { return new Object[][] {
// This matched URI of the specified public id is defined in a // This matched URI of the specified public id is defined in a
// next catalog file. // next catalog file.
@ -120,7 +123,7 @@ public class NextCatalogTest {
} }
@DataProvider(name = "uri-matchedUri") @DataProvider(name = "uri-matchedUri")
private Object[][] dataOnUri() { public Object[][] dataOnUri() {
return new Object[][] { return new Object[][] {
// This matched URI of the specified URI reference is defined in // This matched URI of the specified URI reference is defined in
// a next catalog file. // a next catalog file.
@ -156,3 +159,4 @@ public class NextCatalogTest {
CATALOG_NEXTCATALOGRIGHT); CATALOG_NEXTCATALOGRIGHT);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,18 +33,21 @@ import javax.xml.catalog.CatalogResolver;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.NormalizationTest
* @run testng/othervm catalog.NormalizationTest
* @summary Before matching identifiers and URI references, it has to normalize * @summary Before matching identifiers and URI references, it has to normalize
* the passed identifiers and URI references. And then the catalog * the passed identifiers and URI references. And then the catalog
* resolver uses the normalized stuff to search the counterparts in * resolver uses the normalized stuff to search the counterparts in
* catalog files. * catalog files.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class NormalizationTest { public class NormalizationTest {
private static final String CATALOG_NORMALIZATION = "normalization.xml"; private static final String CATALOG_NORMALIZATION = "normalization.xml";
@ -65,7 +68,7 @@ public class NormalizationTest {
} }
@DataProvider(name = "systemId_uri-matchedUri") @DataProvider(name = "systemId_uri-matchedUri")
private Object[][] dataOnSysIdAndUri() { public Object[][] dataOnSysIdAndUri() {
return new Object[][] { return new Object[][] {
// The specified system id/URI reference contains spaces. And // The specified system id/URI reference contains spaces. And
// the counterparts in system/uri entries also contain spaces. // the counterparts in system/uri entries also contain spaces.
@ -87,7 +90,7 @@ public class NormalizationTest {
} }
@DataProvider(name = "publicId-matchedUri") @DataProvider(name = "publicId-matchedUri")
private Object[][] dataOnPubId() { public Object[][] dataOnPubId() {
return new Object[][] { return new Object[][] {
// The specified public id contains spaces. And the counterparts // The specified public id contains spaces. And the counterparts
// in public entry also contains spaces. // in public entry also contains spaces.
@ -112,3 +115,4 @@ public class NormalizationTest {
return catalogUriResolver(CATALOG_NORMALIZATION); return catalogUriResolver(CATALOG_NORMALIZATION);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,16 +33,20 @@ import javax.xml.catalog.CatalogFeatures;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PreferFeatureTest
* @run testng/othervm catalog.PreferFeatureTest
* @summary This case tests how does the feature affect the catalog resolution, * @summary This case tests how does the feature affect the catalog resolution,
* and tests the priority between this feature and attribute prefer * and tests the priority between this feature and attribute prefer
* in catalog file. * in catalog file.
* @compile ../../libs/catalog/CatalogTestUtils.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class PreferFeatureTest { public class PreferFeatureTest {
@Test(dataProvider = "prefer-publicId-systemId", @Test(dataProvider = "prefer-publicId-systemId",
@ -53,7 +57,7 @@ public class PreferFeatureTest {
} }
@DataProvider(name = "prefer-publicId-systemId") @DataProvider(name = "prefer-publicId-systemId")
private Object[][] data() { public Object[][] data() {
return new Object[][] { return new Object[][] {
// The feature prefer is system. There's a match for the // The feature prefer is system. There's a match for the
// specified public id, and no match for the specified system id. // specified public id, and no match for the specified system id.
@ -77,3 +81,4 @@ public class PreferFeatureTest {
"preferFeature.xml"); "preferFeature.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,18 +29,21 @@ import static catalog.ResolutionChecker.checkExtIdResolution;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PreferTest
* @run testng/othervm catalog.PreferTest
* @summary Get matched URIs from system and public family entries, which * @summary Get matched URIs from system and public family entries, which
* specify the prefer attribute. It tests how does the prefer attribute * specify the prefer attribute. It tests how does the prefer attribute
* affect the resolution procedure. The test rule is based on OASIS * affect the resolution procedure. The test rule is based on OASIS
* Standard V1.1 section 4.1.1. "The prefer attribute". * Standard V1.1 section 4.1.1. "The prefer attribute".
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class PreferTest { public class PreferTest {
@Test(dataProvider = "publicId-systemId-matchedUri") @Test(dataProvider = "publicId-systemId-matchedUri")
@ -50,7 +53,7 @@ public class PreferTest {
} }
@DataProvider(name = "publicId-systemId-matchedUri") @DataProvider(name = "publicId-systemId-matchedUri")
private Object[][] data() { public Object[][] data() {
return new Object[][] { return new Object[][] {
// The prefer attribute is public. Both of the specified public // The prefer attribute is public. Both of the specified public
// id and system id have matches in the catalog file. But // id and system id have matches in the catalog file. But
@ -89,3 +92,4 @@ public class PreferTest {
return catalogResolver("prefer.xml"); return catalogResolver("prefer.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -30,18 +30,21 @@ import static catalog.ResolutionChecker.checkPubIdResolution;
import javax.xml.catalog.CatalogException; import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PublicFamilyTest
* @run testng/othervm catalog.PublicFamilyTest
* @summary Get matched URIs from public and delegatePublic entries. * @summary Get matched URIs from public and delegatePublic entries.
* It tests the resolution priorities among the public family entries. * It tests the resolution priorities among the public family entries.
* The test rule is based on OASIS Standard V1.1 section 7.1.2. * The test rule is based on OASIS Standard V1.1 section 7.1.2.
* "Resolution of External Identifiers". * "Resolution of External Identifiers".
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class PublicFamilyTest { public class PublicFamilyTest {
/* /*
@ -67,3 +70,4 @@ public class PublicFamilyTest {
return catalogResolver("publicFamily.xml"); return catalogResolver("publicFamily.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,15 +32,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.PublicTest
* @run testng/othervm catalog.PublicTest
* @summary Get matched URIs from public entries. * @summary Get matched URIs from public entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class PublicTest { public class PublicTest {
@Test(dataProvider = "publicId-matchedUri") @Test(dataProvider = "publicId-matchedUri")
@ -89,3 +92,4 @@ public class PublicTest {
return catalogResolver(CATALOG_PUBLIC); return catalogResolver(CATALOG_PUBLIC);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -40,16 +40,19 @@ import javax.xml.catalog.CatalogFeatures.Feature;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.ResolveFeatureTest
* @run testng/othervm catalog.ResolveFeatureTest
* @summary This case tests how does resolve feature affect the catalog * @summary This case tests how does resolve feature affect the catalog
* resolution. * resolution.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class ResolveFeatureTest { public class ResolveFeatureTest {
/* /*
@ -128,3 +131,4 @@ public class ResolveFeatureTest {
return builder().with(Feature.RESOLVE, resolve).build(); return builder().with(Feature.RESOLVE, resolve).build();
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.RewriteSystemTest
* @run testng/othervm catalog.RewriteSystemTest
* @summary Get matched URIs from rewriteSystem entries. * @summary Get matched URIs from rewriteSystem entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class RewriteSystemTest { public class RewriteSystemTest {
@Test(dataProvider = "systemId-matchedUri") @Test(dataProvider = "systemId-matchedUri")
@ -92,3 +95,4 @@ public class RewriteSystemTest {
return catalogResolver("rewriteSystem.xml"); return catalogResolver("rewriteSystem.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.RewriteUriTest
* @run testng/othervm catalog.RewriteUriTest
* @summary Get matched URIs from rewriteURI entries. * @summary Get matched URIs from rewriteURI entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class RewriteUriTest { public class RewriteUriTest {
@Test(dataProvider = "uri-matchedUri") @Test(dataProvider = "uri-matchedUri")
@ -92,3 +95,4 @@ public class RewriteUriTest {
return catalogUriResolver("rewriteUri.xml"); return catalogUriResolver("rewriteUri.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,8 @@
package catalog; package catalog;
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
import static catalog.CatalogTestUtils.FEATURE_FILES; import static catalog.CatalogTestUtils.FEATURE_FILES;
import static catalog.CatalogTestUtils.catalogResolver; import static catalog.CatalogTestUtils.catalogResolver;
import static catalog.CatalogTestUtils.catalogUriResolver; import static catalog.CatalogTestUtils.catalogUriResolver;
@ -36,15 +38,18 @@ import javax.xml.catalog.CatalogFeatures;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SpecifyCatalogTest
* @run testng/othervm catalog.SpecifyCatalogTest
* @summary This case tests how to specify the catalog files. * @summary This case tests how to specify the catalog files.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class SpecifyCatalogTest { public class SpecifyCatalogTest {
private static final String ID_URI = "http://remote/dtd/uri/doc.dtd"; private static final String ID_URI = "http://remote/dtd/uri/doc.dtd";
@ -76,7 +81,7 @@ public class SpecifyCatalogTest {
*/ */
@Test @Test
public void specifyCatalogViaSysProps() { public void specifyCatalogViaSysProps() {
System.setProperty(FEATURE_FILES, setSystemProperty(FEATURE_FILES,
getCatalogPath("specifyCatalog-sysProps.xml")); getCatalogPath("specifyCatalog-sysProps.xml"));
checkResolutionOnEntityResolver(catalogResolver((String[]) null), checkResolutionOnEntityResolver(catalogResolver((String[]) null),
@ -106,3 +111,4 @@ public class SpecifyCatalogTest {
return builder().with(FILES, getCatalogPath(catalogName)).build(); return builder().with(FILES, getCatalogPath(catalogName)).build();
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,18 +31,21 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SystemFamilyTest
* @run testng/othervm catalog.SystemFamilyTest
* @summary Get matched URIs from system, rewriteSystem, systemSuffix and * @summary Get matched URIs from system, rewriteSystem, systemSuffix and
* delegateSystem entries. It tests the resolution priorities among * delegateSystem entries. It tests the resolution priorities among
* the system family entries. The test rule is based on OASIS * the system family entries. The test rule is based on OASIS
* Standard V1.1 section 7.1.2. "Resolution of External Identifiers". * Standard V1.1 section 7.1.2. "Resolution of External Identifiers".
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class SystemFamilyTest { public class SystemFamilyTest {
@Test(dataProvider = "systemId-matchedUri") @Test(dataProvider = "systemId-matchedUri")
@ -81,3 +84,4 @@ public class SystemFamilyTest {
return catalogResolver("systemFamily.xml"); return catalogResolver("systemFamily.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SystemSuffixTest
* @run testng/othervm catalog.SystemSuffixTest
* @summary Get matched URIs from systemSuffix entries. * @summary Get matched URIs from systemSuffix entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class SystemSuffixTest { public class SystemSuffixTest {
@Test(dataProvider = "systemId-matchedUri") @Test(dataProvider = "systemId-matchedUri")
@ -92,3 +95,4 @@ public class SystemSuffixTest {
return catalogResolver("systemSuffix.xml"); return catalogResolver("systemSuffix.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,15 +32,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.SystemTest
* @run testng/othervm catalog.SystemTest
* @summary Get matched URIs from system entries. * @summary Get matched URIs from system entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class SystemTest { public class SystemTest {
@Test(dataProvider = "systemId-matchedUri") @Test(dataProvider = "systemId-matchedUri")
@ -89,3 +92,4 @@ public class SystemTest {
return catalogResolver(CATALOG_SYSTEM); return catalogResolver(CATALOG_SYSTEM);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,18 +31,21 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UriFamilyTest
* @run testng/othervm catalog.UriFamilyTest
* @summary Get matched URIs from uri, rewriteURI, uriSuffix and delegateURI * @summary Get matched URIs from uri, rewriteURI, uriSuffix and delegateURI
* entries. It tests the resolution priorities among the uri family * entries. It tests the resolution priorities among the uri family
* entries. The test rule is based on OASIS Standard V1.1 section * entries. The test rule is based on OASIS Standard V1.1 section
* 7.2.2. "Resolution of External Identifiers". * 7.2.2. "Resolution of External Identifiers".
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class UriFamilyTest { public class UriFamilyTest {
@Test(dataProvider = "uri-matchedUri") @Test(dataProvider = "uri-matchedUri")
@ -81,3 +84,4 @@ public class UriFamilyTest {
return catalogUriResolver("uriFamily.xml"); return catalogUriResolver("uriFamily.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,15 +31,18 @@ import javax.xml.catalog.CatalogException;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UriSuffixTest
* @run testng/othervm catalog.UriSuffixTest
* @summary Get matched URIs from rewriteURI entries. * @summary Get matched URIs from rewriteURI entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class UriSuffixTest { public class UriSuffixTest {
@Test(dataProvider = "uri-matchedUri") @Test(dataProvider = "uri-matchedUri")
@ -92,3 +95,4 @@ public class UriSuffixTest {
return catalogUriResolver("uriSuffix.xml"); return catalogUriResolver("uriSuffix.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -34,15 +34,18 @@ import javax.xml.catalog.CatalogFeatures;
import javax.xml.catalog.CatalogUriResolver; import javax.xml.catalog.CatalogUriResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UriTest
* @run testng/othervm catalog.UriTest
* @summary Get matched URIs from uri entries. * @summary Get matched URIs from uri entries.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class UriTest { public class UriTest {
@Test(dataProvider = "uri-matchedUri") @Test(dataProvider = "uri-matchedUri")
@ -101,3 +104,4 @@ public class UriTest {
return catalogUriResolver(CATALOG_URI); return catalogUriResolver(CATALOG_URI);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,17 +29,20 @@ import static catalog.ResolutionChecker.checkPubIdResolution;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.UrnUnwrappingTest
* @run testng/othervm catalog.UrnUnwrappingTest
* @summary If the passed public identifier is started with "urn:publicid:", * @summary If the passed public identifier is started with "urn:publicid:",
* it has to be regarded as URN and normalized. And then the catalog * it has to be regarded as URN and normalized. And then the catalog
* resolver uses the normalized stuff to do matching. * resolver uses the normalized stuff to do matching.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class UrnUnwrappingTest { public class UrnUnwrappingTest {
@Test(dataProvider = "urn-matchedUri") @Test(dataProvider = "urn-matchedUri")
@ -48,7 +51,7 @@ public class UrnUnwrappingTest {
} }
@DataProvider(name = "urn-matchedUri") @DataProvider(name = "urn-matchedUri")
private Object[][] data() { public Object[][] data() {
return new Object[][] { return new Object[][] {
// The specified public id is URN format. // The specified public id is URN format.
{ "urn:publicid:-:REMOTE:DTD+ALICE+DOCALICE+XML:EN", { "urn:publicid:-:REMOTE:DTD+ALICE+DOCALICE+XML:EN",
@ -64,3 +67,4 @@ public class UrnUnwrappingTest {
return catalogResolver("urnUnwrapping.xml"); return catalogResolver("urnUnwrapping.xml");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,17 +32,20 @@ import static catalog.ResolutionChecker.checkUriResolution;
import javax.xml.catalog.CatalogException; import javax.xml.catalog.CatalogException;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test * @test
* @bug 8077931 * @bug 8077931
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true catalog.ValidateCatalogTest
* @run testng/othervm catalog.ValidateCatalogTest
* @summary A legal catalog file must be well-formed XML, the root element * @summary A legal catalog file must be well-formed XML, the root element
* must be catalog, and the naming space of the root element must be * must be catalog, and the naming space of the root element must be
* urn:oasis:names:tc:entity:xmlns:xml:catalog. * urn:oasis:names:tc:entity:xmlns:xml:catalog.
* @compile ../../libs/catalog/CatalogTestUtils.java
* @compile ../../libs/catalog/ResolutionChecker.java
*/ */
@Listeners({jaxp.library.FilePolicy.class})
public class ValidateCatalogTest { public class ValidateCatalogTest {
private static final String CATALOG_WRONGROOT = "validateCatalog-wrongRoot.xml"; private static final String CATALOG_WRONGROOT = "validateCatalog-wrongRoot.xml";
@ -99,3 +102,4 @@ public class ValidateCatalogTest {
"http://local/dtd/docAliceURI.dtd"); "http://local/dtd/docAliceURI.dtd");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,17 +44,21 @@ import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration; import javax.xml.datatype.Duration;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import jaxp.library.JAXPBaseTest;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.DurationTest
* @run testng/othervm javax.xml.datatype.ptests.DurationTest
* @summary Class containing the test cases for Duration. * @summary Class containing the test cases for Duration.
*/ */
public class DurationTest extends JAXPBaseTest { @Listeners({jaxp.library.BasePolicy.class})
public class DurationTest {
private DatatypeFactory datatypeFactory; private DatatypeFactory datatypeFactory;
@ -583,3 +587,4 @@ public class DurationTest extends JAXPBaseTest {
private final BigInteger one = BigInteger.ONE; private final BigInteger one = BigInteger.ONE;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -30,15 +30,20 @@ import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration; import javax.xml.datatype.Duration;
import jaxp.library.JAXPDataProvider; import jaxp.library.JAXPDataProvider;
import jaxp.library.JAXPBaseTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.FactoryNewInstanceTest
* @run testng/othervm javax.xml.datatype.ptests.FactoryNewInstanceTest
* @summary Tests for DatatypeFactory.newInstance(factoryClassName , classLoader) * @summary Tests for DatatypeFactory.newInstance(factoryClassName , classLoader)
*/ */
public class FactoryNewInstanceTest extends JAXPBaseTest { @Listeners({jaxp.library.BasePolicy.class})
public class FactoryNewInstanceTest {
private static final String DATATYPE_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl"; private static final String DATATYPE_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl";
@ -72,3 +77,4 @@ public class FactoryNewInstanceTest extends JAXPBaseTest {
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,18 +39,22 @@ import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration; import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.datatype.XMLGregorianCalendar;
import jaxp.library.JAXPBaseTest;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test
* @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528 * @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.XMLGregorianCalendarTest
* @run testng/othervm javax.xml.datatype.ptests.XMLGregorianCalendarTest
* @summary Class containing the test cases for XMLGregorianCalendar * @summary Class containing the test cases for XMLGregorianCalendar
*/ */
public class XMLGregorianCalendarTest extends JAXPBaseTest { @Listeners({jaxp.library.BasePolicy.class})
public class XMLGregorianCalendarTest {
private DatatypeFactory datatypeFactory; private DatatypeFactory datatypeFactory;
@ -354,3 +358,4 @@ public class XMLGregorianCalendarTest extends JAXPBaseTest {
private final int undef = DatatypeConstants.FIELD_UNDEFINED; private final int undef = DatatypeConstants.FIELD_UNDEFINED;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,18 +23,21 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold; import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import java.io.File; import java.io.File;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.SAXResult;
import jaxp.library.JAXPFileBaseTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
@ -42,7 +45,14 @@ import org.w3c.dom.Document;
* This tests DocumentBuilderFactory for namespace processing and no-namespace * This tests DocumentBuilderFactory for namespace processing and no-namespace
* processing. * processing.
*/ */
public class DBFNamespaceTest extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DBFNamespaceTest
* @run testng/othervm javax.xml.parsers.ptests.DBFNamespaceTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class DBFNamespaceTest {
/** /**
* Provide input for the cases that supporting namespace or not. * Provide input for the cases that supporting namespace or not.
@ -95,3 +105,5 @@ public class DBFNamespaceTest extends JAXPFileBaseTest {
} }
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,6 @@ import java.io.Closeable;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FilePermission;
import java.io.FileReader; import java.io.FileReader;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
@ -55,9 +54,9 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.SAXResult;
import jaxp.library.JAXPDataProvider; import jaxp.library.JAXPDataProvider;
import jaxp.library.JAXPFileBaseTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -70,7 +69,14 @@ import org.xml.sax.helpers.DefaultHandler;
* @bug 8080907 * @bug 8080907
* This checks the methods of DocumentBuilderFactoryImpl. * This checks the methods of DocumentBuilderFactoryImpl.
*/ */
public class DocumentBuilderFactoryTest extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DocumentBuilderFactoryTest
* @run testng/othervm javax.xml.parsers.ptests.DocumentBuilderFactoryTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class DocumentBuilderFactoryTest {
/** /**
* DocumentBuilderFactory implementation class name. * DocumentBuilderFactory implementation class name.
*/ */
@ -419,8 +425,6 @@ public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
@Test @Test
public void testCheckDocumentBuilderFactory13() throws Exception { public void testCheckDocumentBuilderFactory13() throws Exception {
// Accesing default working directory. // Accesing default working directory.
String workingDir = getSystemProperty("user.dir");
setPermissions(new FilePermission(workingDir + "/*", "read"));
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbf.newDocumentBuilder(); DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document doc = docBuilder.parse(new File(XML_DIR + "dbf10import.xsl") Document doc = docBuilder.parse(new File(XML_DIR + "dbf10import.xsl")
@ -436,8 +440,6 @@ public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
@Test(expectedExceptions = SAXException.class) @Test(expectedExceptions = SAXException.class)
public void testCheckDocumentBuilderFactory14() throws Exception { public void testCheckDocumentBuilderFactory14() throws Exception {
// Accesing default working directory. // Accesing default working directory.
String workingDir = getSystemProperty("user.dir");
setPermissions(new FilePermission(workingDir, "read"));
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbf.newDocumentBuilder(); DocumentBuilder docBuilder = dbf.newDocumentBuilder();
docBuilder.parse(""); docBuilder.parse("");
@ -529,3 +531,5 @@ public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
assertTrue(compareWithGold(goldFile, outputFile)); assertTrue(compareWithGold(goldFile, outputFile));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,18 +23,21 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.FILE_SEP; import static jaxp.library.JAXPTestUtilities.FILE_SEP;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FilePermission; import java.io.FilePermission;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import jaxp.library.JAXPFileReadOnlyBaseTest;
import static org.testng.Assert.assertNotNull;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.EntityResolver; import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -42,8 +45,14 @@ import org.xml.sax.InputSource;
/** /**
* This checks for the methods of DocumentBuilder * This checks for the methods of DocumentBuilder
*/ */
public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest /*
implements EntityResolver { * @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DocumentBuilderImpl01
* @run testng/othervm javax.xml.parsers.ptests.DocumentBuilderImpl01
*/
@Listeners({jaxp.library.FilePolicy.class})
public class DocumentBuilderImpl01 implements EntityResolver {
/** /**
* Provide DocumentBuilder. * Provide DocumentBuilder.
* *
@ -82,7 +91,7 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
* @param docBuilder document builder instance. * @param docBuilder document builder instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider") @Test(dataProvider = "builder-provider")
public void testCheckDocumentBuilderImpl04(DocumentBuilder docBuilder) public void testCheckDocumentBuilderImpl04(DocumentBuilder docBuilder)
throws Exception { throws Exception {
try (FileInputStream fis = new FileInputStream(new File(XML_DIR, try (FileInputStream fis = new FileInputStream(new File(XML_DIR,
@ -97,7 +106,7 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
* @param docBuilder document builder instance. * @param docBuilder document builder instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider") @Test(dataProvider = "builder-provider")
public void testCheckDocumentBuilderImpl05(DocumentBuilder docBuilder) public void testCheckDocumentBuilderImpl05(DocumentBuilder docBuilder)
throws Exception { throws Exception {
assertNotNull(docBuilder.parse(new File(XML_DIR, assertNotNull(docBuilder.parse(new File(XML_DIR,
@ -109,11 +118,9 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
* @param docBuilder document builder instance. * @param docBuilder document builder instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider") @Test(dataProvider = "builder-provider")
public void testCheckDocumentBuilderImpl06(DocumentBuilder docBuilder) public void testCheckDocumentBuilderImpl06(DocumentBuilder docBuilder)
throws Exception { throws Exception {
setPermissions(new FilePermission(XML_DIR + "../-",
"read"));
try (FileInputStream fis = new FileInputStream(new File(XML_DIR, try (FileInputStream fis = new FileInputStream(new File(XML_DIR,
"DocumentBuilderImpl02.xml"))) { "DocumentBuilderImpl02.xml"))) {
assertNotNull(docBuilder.parse(fis, new File(XML_DIR).toURI() assertNotNull(docBuilder.parse(fis, new File(XML_DIR).toURI()
@ -150,3 +157,5 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
return null; return null;
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,20 +23,30 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import jaxp.library.JAXPBaseTest;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Class containing the test cases for SAXParserFactory/DocumentBuilderFactory * Class containing the test cases for SAXParserFactory/DocumentBuilderFactory
* newInstance methods. * newInstance methods.
*/ */
public class FactoryConfErrorTest extends JAXPBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.FactoryConfErrorTest
* @run testng/othervm javax.xml.parsers.ptests.FactoryConfErrorTest
*/
@Listeners({jaxp.library.BasePolicy.class})
public class FactoryConfErrorTest {
/** /**
* Set properties DocumentBuilderFactory and SAXParserFactory to invalid * Set properties DocumentBuilderFactory and SAXParserFactory to invalid
@ -54,8 +64,8 @@ public class FactoryConfErrorTest extends JAXPBaseTest {
*/ */
@AfterTest @AfterTest
public void cleanup() { public void cleanup() {
setSystemProperty("javax.xml.parsers.DocumentBuilderFactory", null); clearSystemProperty("javax.xml.parsers.DocumentBuilderFactory");
setSystemProperty("javax.xml.parsers.SAXParserFactory", null); clearSystemProperty("javax.xml.parsers.SAXParserFactory");
} }
/** /**
@ -76,3 +86,5 @@ public class FactoryConfErrorTest extends JAXPBaseTest {
DocumentBuilderFactory.newInstance(); DocumentBuilderFactory.newInstance();
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,16 +31,21 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import jaxp.library.JAXPDataProvider; import jaxp.library.JAXPDataProvider;
import jaxp.library.JAXPBaseTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
* @run testng/othervm javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
* @summary Tests for SAXParserFactory.newInstance(factoryClassName , classLoader) * @summary Tests for SAXParserFactory.newInstance(factoryClassName , classLoader)
*/ */
public class SAXFactoryNewInstanceTest extends JAXPBaseTest { @Listeners({jaxp.library.BasePolicy.class})
public class SAXFactoryNewInstanceTest {
private static final String SAXPARSER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"; private static final String SAXPARSER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
@ -73,3 +78,5 @@ public class SAXFactoryNewInstanceTest extends JAXPBaseTest {
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,14 +24,23 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import jaxp.library.JAXPBaseTest;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Class containing the test cases for SAXParserFactory API. * Class containing the test cases for SAXParserFactory API.
*/ */
public class SAXParserFactTest extends JAXPBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserFactTest
* @run testng/othervm javax.xml.parsers.ptests.SAXParserFactTest
*/
@Listeners({jaxp.library.BasePolicy.class})
public class SAXParserFactTest {
private static final String NAMESPACES = "http://xml.org/sax/features/namespaces"; private static final String NAMESPACES = "http://xml.org/sax/features/namespaces";
private static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes"; private static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes";
@ -220,3 +229,5 @@ public class SAXParserFactTest extends JAXPBaseTest {
assertFalse(spf.getFeature(EXTERNAL_P_ENTITIES)); assertFalse(spf.getFeature(EXTERNAL_P_ENTITIES));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,23 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.tryRunWithTmpPermission;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FilePermission; import java.io.FilePermission;
import java.io.IOException; import java.io.IOException;
import java.util.PropertyPermission;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import jaxp.library.JAXPFileReadOnlyBaseTest; import jaxp.library.JAXPTestUtilities;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.HandlerBase; import org.xml.sax.HandlerBase;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -41,7 +49,14 @@ import org.xml.sax.helpers.DefaultHandler;
/** /**
* Class contains the test cases for SAXParser API * Class contains the test cases for SAXParser API
*/ */
public class SAXParserTest extends JAXPFileReadOnlyBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest
* @run testng/othervm javax.xml.parsers.ptests.SAXParserTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class SAXParserTest {
/** /**
* Provide SAXParser. * Provide SAXParser.
* *
@ -92,13 +107,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
@Test(expectedExceptions = { SAXException.class }, @Test(expectedExceptions = { SAXException.class },
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse03(SAXParser saxparser) throws Exception { public void testParse03(SAXParser saxparser) throws Exception {
String workingDir = getSystemProperty("user.dir");
setPermissions(new FilePermission(workingDir, "read"));
try {
saxparser.parse("", new HandlerBase()); saxparser.parse("", new HandlerBase());
} finally {
setPermissions();
}
} }
/** /**
@ -124,13 +133,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
*/ */
@Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider") @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
public void testParse05(SAXParser saxparser) throws Exception { public void testParse05(SAXParser saxparser) throws Exception {
String workingDir = getSystemProperty("user.dir"); tryRunWithTmpPermission(() -> saxparser.parse(new File(""), new HandlerBase()), new PropertyPermission("user.dir", "read"));
setPermissions(new FilePermission(workingDir, "read"));
try {
saxparser.parse(new File(""), new HandlerBase());
} finally {
setPermissions();
}
} }
/** /**
@ -176,23 +179,18 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
} }
/** /**
* Test with non-existence URI, parsing should fail and throw * Test with non-existence URI, parsing should fail and throw SAXException
* SAXException or IOException. * or IOException.
* *
* @param saxparser a SAXParser instance. * @param saxparser
* @throws Exception If any errors occur. * a SAXParser instance.
* @throws Exception
* If any errors occur.
*/ */
@Test(expectedExceptions = { SAXException.class, IOException.class }, @Test(expectedExceptions = { SAXException.class, IOException.class }, dataProvider = "parser-provider")
dataProvider = "parser-provider")
public void testParse09(SAXParser saxparser) throws Exception { public void testParse09(SAXParser saxparser) throws Exception {
String workingDir = getSystemProperty("user.dir"); JAXPTestUtilities.tryRunWithTmpPermission(() -> saxparser.parse(" ", new DefaultHandler()),
setPermissions(new FilePermission(workingDir + "/../-", "read")); new FilePermission(USER_DIR + " ", "read"));
String uri = " ";
try {
saxparser.parse(uri, new DefaultHandler());
} finally {
setPermissions();
}
} }
/** /**
@ -204,14 +202,8 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
*/ */
@Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider") @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
public void testParse10(SAXParser saxparser) throws Exception { public void testParse10(SAXParser saxparser) throws Exception {
String workingDir = getSystemProperty("user.dir");
setPermissions(new FilePermission(workingDir, "read"));
File file = new File(""); File file = new File("");
try { tryRunWithTmpPermission(() -> saxparser.parse(file, new DefaultHandler()), new PropertyPermission("user.dir", "read"));
saxparser.parse(file, new DefaultHandler());
} finally {
setPermissions();
}
} }
/** /**
@ -248,7 +240,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class, @Test(expectedExceptions = SAXException.class,
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse13(SAXParser saxparser) throws Exception { public void testParse13(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream(new File( try (FileInputStream instream = new FileInputStream(new File(
@ -263,7 +255,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse14(SAXParser saxparser) throws Exception { public void testParse14(SAXParser saxparser) throws Exception {
saxparser.parse(new File(XML_DIR, "parsertest.xml"), saxparser.parse(new File(XML_DIR, "parsertest.xml"),
new HandlerBase()); new HandlerBase());
@ -276,7 +268,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse15(SAXParser saxparser) throws Exception { public void testParse15(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream(new File(XML_DIR, try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
"correct.xml"))) { "correct.xml"))) {
@ -291,7 +283,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse16(SAXParser saxparser) throws Exception { public void testParse16(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream( try (FileInputStream instream = new FileInputStream(
new File(XML_DIR, "parsertest.xml"))) { new File(XML_DIR, "parsertest.xml"))) {
@ -306,7 +298,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse17(SAXParser saxparser) throws Exception { public void testParse17(SAXParser saxparser) throws Exception {
File file = new File(XML_DIR, "correct.xml"); File file = new File(XML_DIR, "correct.xml");
saxparser.parse(file.toURI().toASCIIString(), new HandlerBase()); saxparser.parse(file.toURI().toASCIIString(), new HandlerBase());
@ -319,7 +311,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class, @Test(expectedExceptions = SAXException.class,
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse18(SAXParser saxparser) throws Exception { public void testParse18(SAXParser saxparser) throws Exception {
saxparser.parse(new File(XML_DIR, "valid.xml"), new HandlerBase()); saxparser.parse(new File(XML_DIR, "valid.xml"), new HandlerBase());
@ -332,7 +324,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse19(SAXParser saxparser) throws Exception { public void testParse19(SAXParser saxparser) throws Exception {
saxparser.parse(new File(XML_DIR, "correct.xml"), new HandlerBase()); saxparser.parse(new File(XML_DIR, "correct.xml"), new HandlerBase());
} }
@ -344,7 +336,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class, @Test(expectedExceptions = SAXException.class,
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse20(SAXParser saxparser) throws Exception { public void testParse20(SAXParser saxparser) throws Exception {
try(FileInputStream instream = new FileInputStream(new File(XML_DIR, try(FileInputStream instream = new FileInputStream(new File(XML_DIR,
@ -360,7 +352,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse21(SAXParser saxparser) throws Exception { public void testParse21(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream(new File(XML_DIR, try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
"correct.xml"))) { "correct.xml"))) {
@ -375,7 +367,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class, @Test(expectedExceptions = SAXException.class,
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse22(SAXParser saxparser) throws Exception { public void testParse22(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream( try (FileInputStream instream = new FileInputStream(
@ -391,7 +383,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse23(SAXParser saxparser) throws Exception { public void testParse23(SAXParser saxparser) throws Exception {
DefaultHandler handler = new DefaultHandler(); DefaultHandler handler = new DefaultHandler();
saxparser.parse(new File(XML_DIR, "parsertest.xml"), handler); saxparser.parse(new File(XML_DIR, "parsertest.xml"), handler);
@ -404,7 +396,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse24(SAXParser saxparser) throws Exception { public void testParse24(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream(new File(XML_DIR, try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
"correct.xml"))) { "correct.xml"))) {
@ -420,7 +412,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse25(SAXParser saxparser) throws Exception { public void testParse25(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream( try (FileInputStream instream = new FileInputStream(
new File(XML_DIR, "parsertest.xml"))) { new File(XML_DIR, "parsertest.xml"))) {
@ -435,7 +427,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse26(SAXParser saxparser) throws Exception { public void testParse26(SAXParser saxparser) throws Exception {
File file = new File(XML_DIR, "correct.xml"); File file = new File(XML_DIR, "correct.xml");
saxparser.parse(file.toURI().toASCIIString(), new DefaultHandler()); saxparser.parse(file.toURI().toASCIIString(), new DefaultHandler());
@ -448,7 +440,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class, @Test(expectedExceptions = SAXException.class,
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse27(SAXParser saxparser) throws Exception { public void testParse27(SAXParser saxparser) throws Exception {
saxparser.parse(new File(XML_DIR, "valid.xml"), new DefaultHandler()); saxparser.parse(new File(XML_DIR, "valid.xml"), new DefaultHandler());
@ -461,7 +453,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse28(SAXParser saxparser) throws Exception { public void testParse28(SAXParser saxparser) throws Exception {
saxparser.parse(new File(XML_DIR, "correct.xml"), new DefaultHandler()); saxparser.parse(new File(XML_DIR, "correct.xml"), new DefaultHandler());
} }
@ -472,7 +464,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class, @Test(expectedExceptions = SAXException.class,
dataProvider = "parser-provider") dataProvider = "parser-provider")
public void testParse29(SAXParser saxparser) throws Exception { public void testParse29(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream( try (FileInputStream instream = new FileInputStream(
@ -487,7 +479,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* @param saxparser a SAXParser instance. * @param saxparser a SAXParser instance.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider") @Test(dataProvider = "parser-provider")
public void testParse30(SAXParser saxparser) throws Exception { public void testParse30(SAXParser saxparser) throws Exception {
try (FileInputStream instream = new FileInputStream( try (FileInputStream instream = new FileInputStream(
new File(XML_DIR, "correct.xml"))) { new File(XML_DIR, "correct.xml"))) {
@ -500,7 +492,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}) @Test
public void testParse31() throws Exception { public void testParse31() throws Exception {
try (FileInputStream instream = new FileInputStream( try (FileInputStream instream = new FileInputStream(
new File(XML_DIR, "ns4.xml"))) { new File(XML_DIR, "ns4.xml"))) {
@ -510,3 +502,5 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
} }
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,13 +24,15 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import jaxp.library.JAXPBaseTest;
import static org.testng.Assert.assertNotNull;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXNotSupportedException;
@ -40,7 +42,14 @@ import org.xml.sax.ext.LexicalHandler;
/** /**
* Class contains the test cases for SAXParser API * Class contains the test cases for SAXParser API
*/ */
public class SAXParserTest02 extends JAXPBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest02
* @run testng/othervm javax.xml.parsers.ptests.SAXParserTest02
*/
@Listeners({jaxp.library.BasePolicy.class})
public class SAXParserTest02 {
private static final String DOM_NODE = "http://xml.org/sax/properties/dom-node"; private static final String DOM_NODE = "http://xml.org/sax/properties/dom-node";
private static final String XML_STRING = "http://xml.org/sax/properties/xml-string"; private static final String XML_STRING = "http://xml.org/sax/properties/xml-string";
private static final String DECL_HANDLER = "http://xml.org/sax/properties/declaration-handler"; private static final String DECL_HANDLER = "http://xml.org/sax/properties/declaration-handler";
@ -260,3 +269,5 @@ public class SAXParserTest02 extends JAXPBaseTest {
} }
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,25 +23,32 @@
package javax.xml.parsers.ptests; package javax.xml.parsers.ptests;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import java.io.File; import java.io.File;
import java.io.FilePermission;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
import jaxp.library.JAXPFileReadOnlyBaseTest;
import static org.testng.Assert.fail;
import org.testng.annotations.AfterGroups;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
/** /**
* Class contains the test cases for SAXParser API * Class contains the test cases for SAXParser API
*/ */
public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest03
* @run testng/othervm javax.xml.parsers.ptests.SAXParserTest03
*/
@Listeners({jaxp.library.FilePolicy.class})
public class SAXParserTest03 {
/** /**
* Provide SAXParserFactory. * Provide SAXParserFactory.
@ -63,7 +70,7 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
* @param handler an error handler for capturing events. * @param handler an error handler for capturing events.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "input-provider") @Test(dataProvider = "input-provider")
public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler) public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler)
throws Exception { throws Exception {
spf.newSAXParser().parse(new File(XML_DIR, "parsertest.xml"), handler); spf.newSAXParser().parse(new File(XML_DIR, "parsertest.xml"), handler);
@ -78,7 +85,7 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
* @param handler an error handler for capturing events. * @param handler an error handler for capturing events.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "input-provider") @Test(dataProvider = "input-provider")
public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler) public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler)
throws Exception { throws Exception {
spf.setNamespaceAware(true); spf.setNamespaceAware(true);
@ -95,7 +102,7 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
* @param handler an error handler for capturing events. * @param handler an error handler for capturing events.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}, dataProvider = "input-provider") @Test(dataProvider = "input-provider")
public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler) public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler)
throws Exception { throws Exception {
try { try {
@ -109,3 +116,5 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,20 +23,28 @@
package javax.xml.stream.ptests; package javax.xml.stream.ptests;
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
import javax.xml.stream.XMLEventFactory; import javax.xml.stream.XMLEventFactory;
import jaxp.library.JAXPDataProvider; import jaxp.library.JAXPDataProvider;
import jaxp.library.JAXPBaseTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.stream.ptests.XMLEventFactoryNewInstanceTest
* @run testng/othervm javax.xml.stream.ptests.XMLEventFactoryNewInstanceTest
* @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader) * @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader)
*/ */
public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest { @Listeners({jaxp.library.BasePolicy.class})
public class XMLEventFactoryNewInstanceTest {
private static final String XMLEVENT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl"; private static final String XMLEVENT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl";
private static final String XMLEVENT_FACRORY_ID = "javax.xml.stream.XMLEventFactory"; private static final String XMLEVENT_FACRORY_ID = "javax.xml.stream.XMLEventFactory";
@ -59,7 +67,7 @@ public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader); XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader);
assertNotNull(xef); assertNotNull(xef);
} finally { } finally {
setSystemProperty(XMLEVENT_FACRORY_ID, null); clearSystemProperty(XMLEVENT_FACRORY_ID);
} }
} }
@ -74,3 +82,4 @@ public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,20 +23,28 @@
package javax.xml.stream.ptests; package javax.xml.stream.ptests;
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLInputFactory;
import jaxp.library.JAXPDataProvider; import jaxp.library.JAXPDataProvider;
import jaxp.library.JAXPBaseTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.stream.ptests.XMLInputFactoryNewInstanceTest
* @run testng/othervm javax.xml.stream.ptests.XMLInputFactoryNewInstanceTest
* @summary Tests for XMLInputFactory.newFactory(factoryId , classLoader) * @summary Tests for XMLInputFactory.newFactory(factoryId , classLoader)
*/ */
public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest { @Listeners({jaxp.library.BasePolicy.class})
public class XMLInputFactoryNewInstanceTest {
private static final String XMLINPUT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.XMLInputFactoryImpl"; private static final String XMLINPUT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
private static final String XMLINPUT_FACRORY_ID = "javax.xml.stream.XMLInputFactory"; private static final String XMLINPUT_FACRORY_ID = "javax.xml.stream.XMLInputFactory";
@ -59,7 +67,7 @@ public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest {
XMLInputFactory xif = XMLInputFactory.newFactory(factoryId, classLoader); XMLInputFactory xif = XMLInputFactory.newFactory(factoryId, classLoader);
assertNotNull(xif); assertNotNull(xif);
} finally { } finally {
setSystemProperty(XMLINPUT_FACRORY_ID, null); clearSystemProperty(XMLINPUT_FACRORY_ID);
} }
} }
@ -74,3 +82,4 @@ public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest {
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,8 @@
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
@ -34,17 +36,20 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest; import org.testng.annotations.Listeners;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
/* /*
* @test
* @bug 6384418 * @bug 6384418
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.Bug6384418Test
* @run testng/othervm javax.xml.transform.ptests.Bug6384418Test
* @summary verify the transforming won't throw any exception * @summary verify the transforming won't throw any exception
*/ */
public class Bug6384418Test extends JAXPFileBaseTest { @Listeners({jaxp.library.FilePolicy.class})
public class Bug6384418Test {
@Test @Test
public void test() throws Exception { public void test() throws Exception {
@ -62,3 +67,5 @@ public class Bug6384418Test extends JAXPFileBaseTest {
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,20 +23,23 @@
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR; import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR; import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import jaxp.library.JAXPFileBaseTest;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold; import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Attr; import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap; import org.w3c.dom.NamedNodeMap;
@ -50,7 +53,14 @@ import org.xml.sax.helpers.XMLReaderFactory;
* DOM parse on test file to be compared with golden output file. No Exception * DOM parse on test file to be compared with golden output file. No Exception
* is expected. * is expected.
*/ */
public class DOMResultTest extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.DOMResultTest
* @run testng/othervm javax.xml.transform.ptests.DOMResultTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class DOMResultTest {
/** /**
* Unit test for simple DOM parsing. * Unit test for simple DOM parsing.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
@ -108,3 +118,5 @@ public class DOMResultTest extends JAXPFileBaseTest {
writeNodes(kids.item(i), bWriter); writeNodes(kids.item(i), bWriter);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,23 +23,32 @@
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import java.io.File; import java.io.File;
import java.io.FilePermission;
import javax.xml.transform.ErrorListener; import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPBaseTest;
import static org.testng.Assert.assertEquals; import org.testng.annotations.Listeners;
import static org.testng.Assert.fail;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Class containing the test cases for ErrorListener interface * Class containing the test cases for ErrorListener interface
*/ */
public class ErrorListenerTest extends JAXPBaseTest implements ErrorListener { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.ErrorListenerTest
* @run testng/othervm javax.xml.transform.ptests.ErrorListenerTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class ErrorListenerTest implements ErrorListener {
/** /**
* Define ErrorListener's status. * Define ErrorListener's status.
*/ */
@ -60,7 +69,6 @@ public class ErrorListenerTest extends JAXPBaseTest implements ErrorListener {
try { try {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
tfactory.setErrorListener (listener); tfactory.setErrorListener (listener);
setPermissions(new FilePermission(XML_DIR + "invalid.xsl", "read"));
tfactory.newTransformer(new StreamSource( tfactory.newTransformer(new StreamSource(
new File(XML_DIR + "invalid.xsl"))); new File(XML_DIR + "invalid.xsl")));
fail("Expect TransformerConfigurationException here"); fail("Expect TransformerConfigurationException here");
@ -96,3 +104,5 @@ public class ErrorListenerTest extends JAXPBaseTest implements ErrorListener {
this.status = ListenerStatus.FATAL; this.status = ListenerStatus.FATAL;
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,18 +23,21 @@
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR; import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileReadOnlyBaseTest;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -42,7 +45,14 @@ import org.xml.sax.InputSource;
/** /**
* Unit test for SAXSource sourceToInputSource API. * Unit test for SAXSource sourceToInputSource API.
*/ */
public class SAXSourceTest extends JAXPFileReadOnlyBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.SAXSourceTest
* @run testng/othervm javax.xml.transform.ptests.SAXSourceTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class SAXSourceTest {
/** /**
* Test style-sheet file name * Test style-sheet file name
*/ */
@ -53,7 +63,7 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws IOException reading file error. * @throws IOException reading file error.
*/ */
@Test(groups = {"readLocalFiles"}) @Test
public void source2inputsource01() throws IOException { public void source2inputsource01() throws IOException {
try (FileInputStream fis = new FileInputStream(TEST_FILE)) { try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
StreamSource streamSource = new StreamSource(fis); StreamSource streamSource = new StreamSource(fis);
@ -68,7 +78,7 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test(groups = {"readLocalFiles"}) @Test
public void source2inputsource02() throws Exception { public void source2inputsource02() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true); dbf.setNamespaceAware(true);
@ -83,7 +93,7 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws IOException reading file error. * @throws IOException reading file error.
*/ */
@Test(groups = {"readLocalFiles"}) @Test
public void source2inputsource03() throws IOException { public void source2inputsource03() throws IOException {
String SYSTEM_ID = "file:///" + XML_DIR; String SYSTEM_ID = "file:///" + XML_DIR;
try (FileInputStream fis = new FileInputStream(TEST_FILE)) { try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
@ -95,3 +105,5 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
} }
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,27 +23,30 @@
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result; import javax.xml.transform.Result;
import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TemplatesHandler; import javax.xml.transform.sax.TemplatesHandler;
import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import org.testng.annotations.Listeners;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
@ -56,7 +59,14 @@ import org.xml.sax.helpers.XMLReaderFactory;
* Test newTransformerhandler() method which takes StreamSource as argument can * Test newTransformerhandler() method which takes StreamSource as argument can
* be set to XMLReader. * be set to XMLReader.
*/ */
public class SAXTFactoryTest extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.SAXTFactoryTest
* @run testng/othervm javax.xml.transform.ptests.SAXTFactoryTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class SAXTFactoryTest {
/** /**
* Test style-sheet file. * Test style-sheet file.
*/ */
@ -421,3 +431,5 @@ public class SAXTFactoryTest extends JAXPFileBaseTest {
assertTrue(compareWithGold(goldFile, outputFile)); assertTrue(compareWithGold(goldFile, outputFile));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,11 +22,16 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.failUnexpected;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Properties; import java.util.Properties;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
@ -34,12 +39,10 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import org.testng.annotations.Listeners;
import static jaxp.library.JAXPTestUtilities.failUnexpected;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
@ -48,7 +51,14 @@ import org.xml.sax.SAXException;
* Test a StreamResult using a file name that contains URL characters that need * Test a StreamResult using a file name that contains URL characters that need
* to be encoded. * to be encoded.
*/ */
public class StreamResultTest extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.StreamResultTest
* @run testng/othervm javax.xml.transform.ptests.StreamResultTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class StreamResultTest {
/** /**
* Unit test for StreamResult. * Unit test for StreamResult.
*/ */
@ -96,3 +106,5 @@ public class StreamResultTest extends JAXPFileBaseTest {
}); });
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,20 +22,23 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer; import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileReadOnlyBaseTest;
import static org.testng.Assert.assertEquals; import org.testng.annotations.Listeners;
import static org.testng.Assert.assertNull;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
@ -44,7 +47,14 @@ import org.xml.sax.InputSource;
/** /**
* Class containing the test cases for SAXParserFactory API * Class containing the test cases for SAXParserFactory API
*/ */
public class TfClearParamTest extends JAXPFileReadOnlyBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TfClearParamTest
* @run testng/othervm javax.xml.transform.ptests.TfClearParamTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class TfClearParamTest {
/** /**
* Test style-sheet file name. * Test style-sheet file name.
*/ */
@ -128,7 +138,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
* @throws TransformerConfigurationException If for some reason the * @throws TransformerConfigurationException If for some reason the
* TransformerHandler can not be created. * TransformerHandler can not be created.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void clear05() throws TransformerConfigurationException { public void clear05() throws TransformerConfigurationException {
Transformer transformer = TransformerFactory.newInstance(). Transformer transformer = TransformerFactory.newInstance().
newTransformer(new StreamSource(new File(XSL_FILE))); newTransformer(new StreamSource(new File(XSL_FILE)));
@ -143,7 +153,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
* @throws TransformerConfigurationException If for some reason the * @throws TransformerConfigurationException If for some reason the
* TransformerHandler can not be created. * TransformerHandler can not be created.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void clear06() throws TransformerConfigurationException { public void clear06() throws TransformerConfigurationException {
Transformer transformer = TransformerFactory.newInstance(). Transformer transformer = TransformerFactory.newInstance().
newTransformer(new StreamSource(new File(XSL_FILE))); newTransformer(new StreamSource(new File(XSL_FILE)));
@ -157,7 +167,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
* the a name that set before. Value should be same as set one. * the a name that set before. Value should be same as set one.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void clear07() throws Exception { public void clear07() throws Exception {
try (FileInputStream fis = new FileInputStream(XSL_FILE)) { try (FileInputStream fis = new FileInputStream(XSL_FILE)) {
SAXSource saxSource = new SAXSource(); SAXSource saxSource = new SAXSource();
@ -174,7 +184,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
* the a name that wasn't set before. Null is expected. * the a name that wasn't set before. Null is expected.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void clear08() throws Exception { public void clear08() throws Exception {
try (FileInputStream fis = new FileInputStream(XSL_FILE)) { try (FileInputStream fis = new FileInputStream(XSL_FILE)) {
SAXSource saxSource = new SAXSource(); SAXSource saxSource = new SAXSource();
@ -192,7 +202,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
* the a name that set before. Value should be same as set one. * the a name that set before. Value should be same as set one.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void clear09() throws Exception { public void clear09() throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -213,7 +223,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
* the a name that wasn't set before. Null is expected. * the a name that wasn't set before. Null is expected.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void clear10() throws Exception { public void clear10() throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -229,3 +239,5 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
assertNull(transformer.getParameter(LONG_PARAM_NAME)); assertNull(transformer.getParameter(LONG_PARAM_NAME));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,6 @@ import java.util.function.Supplier;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLEventWriter; import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLOutputFactory;
@ -58,10 +57,9 @@ import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.xml.sax.Attributes; import org.xml.sax.Attributes;
@ -71,10 +69,15 @@ import org.xml.sax.Locator;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformTest
* @run testng/othervm javax.xml.transform.ptests.TransformTest
* @summary Tests for variable combination of Transformer.transform(Source, Result) * @summary Tests for variable combination of Transformer.transform(Source, Result)
*/ */
@Test(singleThreaded = true) @Test(singleThreaded = true)
public class TransformTest extends JAXPFileBaseTest { @Listeners({jaxp.library.FilePolicy.class})
public class TransformTest {
/* /*
* Initialize the share objects. * Initialize the share objects.
@ -381,3 +384,5 @@ public class TransformTest extends JAXPFileBaseTest {
private Document xmlDoc; private Document xmlDoc;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,32 +22,40 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import java.io.File;
import java.io.FilePermission;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR; import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPBaseTest;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull; import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.io.File;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Basic test for TransformerException specification. * Basic test for TransformerException specification.
*/ */
public class TransformerExcpTest extends JAXPBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerExcpTest
* @run testng/othervm javax.xml.transform.ptests.TransformerExcpTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class TransformerExcpTest {
/** /**
* Transform an unformatted style-sheet file. TransformerException is thrown. * Transform an unformatted style-sheet file. TransformerException is thrown.
*/ */
@Test @Test
public void tfexception() { public void tfexception() {
try { try {
setPermissions(new FilePermission(XML_DIR + "-", "read"));
// invalid.xsl has well-formedness error. Therefore transform throws // invalid.xsl has well-formedness error. Therefore transform throws
// TransformerException // TransformerException
StreamSource streamSource StreamSource streamSource
@ -63,8 +71,6 @@ public class TransformerExcpTest extends JAXPBaseTest {
assertNotNull(e.getException()); assertNotNull(e.getException());
assertNull(e.getLocationAsString()); assertNull(e.getLocationAsString());
assertEquals(e.getMessageAndLocation(),e.getMessage()); assertEquals(e.getMessageAndLocation(),e.getMessage());
} finally {
setPermissions();
} }
} }
@ -99,3 +105,5 @@ public class TransformerExcpTest extends JAXPBaseTest {
assertNotNull(te.initCause(null)); assertNotNull(te.initCause(null));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,33 +22,45 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import java.io.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR; import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR; import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.stream.*;
import jaxp.library.JAXPDataProvider;
import jaxp.library.JAXPFileBaseTest;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold; import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import jaxp.library.JAXPDataProvider;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.*; import org.w3c.dom.Document;
/** /**
* Class containing the test cases for TransformerFactory API's * Class containing the test cases for TransformerFactory API's
* getAssociatedStyleSheet method and TransformerFactory.newInstance(factoryClassName , classLoader). * getAssociatedStyleSheet method and TransformerFactory.newInstance(factoryClassName , classLoader).
*/ */
public class TransformerFactoryTest extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerFactoryTest
* @run testng/othervm javax.xml.transform.ptests.TransformerFactoryTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class TransformerFactoryTest {
/** /**
* TransformerFactory implementation class name. * TransformerFactory implementation class name.
*/ */
@ -129,3 +141,5 @@ public class TransformerFactoryTest extends JAXPFileBaseTest {
assertTrue(compareWithGold(goldFile, outputFile)); assertTrue(compareWithGold(goldFile, outputFile));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,9 +22,15 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.Properties; import java.util.Properties;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.ErrorListener; import javax.xml.transform.ErrorListener;
@ -33,13 +39,10 @@ import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileReadOnlyBaseTest;
import static org.testng.Assert.assertEquals; import org.testng.annotations.Listeners;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -47,7 +50,14 @@ import org.xml.sax.InputSource;
/** /**
* Basic test cases for Transformer API * Basic test cases for Transformer API
*/ */
public class TransformerTest extends JAXPFileReadOnlyBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerTest
* @run testng/othervm javax.xml.transform.ptests.TransformerTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class TransformerTest {
/** /**
* XSLT file serves every test method. * XSLT file serves every test method.
*/ */
@ -58,7 +68,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
* @throws TransformerConfigurationException If for some reason the * @throws TransformerConfigurationException If for some reason the
* TransformerHandler can not be created. * TransformerHandler can not be created.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void transformer01() throws TransformerConfigurationException { public void transformer01() throws TransformerConfigurationException {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
StreamSource streamSource = new StreamSource( StreamSource streamSource = new StreamSource(
@ -71,7 +81,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
* This tests if newTransformer(SAXSource) method returns Transformer. * This tests if newTransformer(SAXSource) method returns Transformer.
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void transformer02() throws Exception { public void transformer02() throws Exception {
try (FileInputStream fis = new FileInputStream(TEST_XSL)) { try (FileInputStream fis = new FileInputStream(TEST_XSL)) {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -86,7 +96,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void transformer03() throws Exception { public void transformer03() throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -105,7 +115,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void transformer04() throws Exception { public void transformer04() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true); dbf.setNamespaceAware(true);
@ -125,7 +135,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void transformer05() throws Exception { public void transformer05() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true); dbf.setNamespaceAware(true);
@ -150,7 +160,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public void transformer06() throws Exception { public void transformer06() throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -197,3 +207,5 @@ class MyErrorListener implements ErrorListener {
System.out.println(" In fatal"); System.out.println(" In fatal");
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,21 +22,24 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer; import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import org.testng.annotations.Listeners;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -44,7 +47,14 @@ import org.testng.annotations.Test;
* Here a transformer is created using DOMSource. Some specific output property * Here a transformer is created using DOMSource. Some specific output property
* is set on transformer. Then transform(StreamSource, StreamResult) is tested. * is set on transformer. Then transform(StreamSource, StreamResult) is tested.
*/ */
public class TransformerTest02 extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerTest02
* @run testng/othervm javax.xml.transform.ptests.TransformerTest02
*/
@Listeners({jaxp.library.FilePolicy.class})
public class TransformerTest02 {
/** /**
* Unit test for transform(StreamSource, StreamResult). * Unit test for transform(StreamSource, StreamResult).
* *
@ -75,3 +85,5 @@ public class TransformerTest02 extends JAXPFileBaseTest {
assertTrue(compareWithGold(goldFile, outputFile)); assertTrue(compareWithGold(goldFile, outputFile));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,22 +22,25 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static jaxp.library.JAXPTestUtilities.USER_DIR;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.util.Properties; import java.util.Properties;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer; import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest;
import static jaxp.library.JAXPTestUtilities.USER_DIR; import org.testng.annotations.Listeners;
import static jaxp.library.JAXPTestUtilities.compareWithGold;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
@ -46,7 +49,14 @@ import org.testng.annotations.Test;
* for transformer. Then transform(StreamSource, StreamResult) is used for * for transformer. Then transform(StreamSource, StreamResult) is used for
* transformation. This tests the setOutputProperties() method. * transformation. This tests the setOutputProperties() method.
*/ */
public class TransformerTest03 extends JAXPFileBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerTest03
* @run testng/othervm javax.xml.transform.ptests.TransformerTest03
*/
@Listeners({jaxp.library.FilePolicy.class})
public class TransformerTest03 {
/** /**
* Test for Transformer.setOutputProperties method. * Test for Transformer.setOutputProperties method.
* *
@ -84,3 +94,5 @@ public class TransformerTest03 extends JAXPFileBaseTest {
assertTrue(compareWithGold(goldFile, outputFile)); assertTrue(compareWithGold(goldFile, outputFile));
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,8 +22,13 @@
*/ */
package javax.xml.transform.ptests; package javax.xml.transform.ptests;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Source; import javax.xml.transform.Source;
@ -31,13 +36,11 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.URIResolver; import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource; import javax.xml.transform.dom.DOMSource;
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import jaxp.library.JAXPFileBaseTest;
import static org.testng.Assert.assertEquals; import org.testng.annotations.Listeners;
import static org.testng.Assert.assertNotNull;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -45,7 +48,14 @@ import org.xml.sax.InputSource;
/** /**
* URIResolver should be invoked when transform happens. * URIResolver should be invoked when transform happens.
*/ */
public class URIResolverTest extends JAXPFileBaseTest implements URIResolver { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.URIResolverTest
* @run testng/othervm javax.xml.transform.ptests.URIResolverTest
*/
@Listeners({jaxp.library.FilePolicy.class})
public class URIResolverTest implements URIResolver {
/** /**
* System ID constant. * System ID constant.
*/ */
@ -115,7 +125,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void resolver01() throws Exception { public static void resolver01() throws Exception {
try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)) { try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)) {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -134,7 +144,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void resolver02() throws Exception { public static void resolver02() throws Exception {
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID); URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@ -155,7 +165,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void resolver03() throws Exception { public static void resolver03() throws Exception {
try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)){ try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)){
URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID); URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@ -174,7 +184,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void resolver04() throws Exception { public static void resolver04() throws Exception {
try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)) { try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)) {
URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID); URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@ -192,7 +202,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void resolver05() throws Exception { public static void resolver05() throws Exception {
URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID); URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
TransformerFactory tfactory = TransformerFactory.newInstance(); TransformerFactory tfactory = TransformerFactory.newInstance();
@ -211,7 +221,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void resolver06() throws Exception { public static void resolver06() throws Exception {
try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)){ try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)){
URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID); URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@ -230,7 +240,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
* *
* @throws Exception If any errors occur. * @throws Exception If any errors occur.
*/ */
@Test (groups = {"readLocalFiles"}) @Test
public static void docResolver01() throws Exception { public static void docResolver01() throws Exception {
try (FileInputStream fis = new FileInputStream(XML_DIR + "doctest.xsl")) { try (FileInputStream fis = new FileInputStream(XML_DIR + "doctest.xsl")) {
URIResolverTest resolver = new URIResolverTest("temp/colors.xml", SYSTEM_ID); URIResolverTest resolver = new URIResolverTest("temp/colors.xml", SYSTEM_ID);
@ -252,3 +262,5 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
} }
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -22,15 +22,27 @@
*/ */
package javax.xml.transform.ptests.othervm; package javax.xml.transform.ptests.othervm;
import javax.xml.transform.*; import static jaxp.library.JAXPTestUtilities.setSystemProperty;
import jaxp.library.JAXPBaseTest;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Negative test for set invalid TransformerFactory property. * Negative test for set invalid TransformerFactory property.
*/ */
public class TFCErrorTest extends JAXPBaseTest { /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.othervm.TFCErrorTest
* @run testng/othervm javax.xml.transform.ptests.othervm.TFCErrorTest
*/
@Listeners({jaxp.library.BasePolicy.class})
public class TFCErrorTest {
@Test(expectedExceptions = ClassNotFoundException.class) @Test(expectedExceptions = ClassNotFoundException.class)
public void tfce01() throws Exception { public void tfce01() throws Exception {
try{ try{
@ -42,3 +54,5 @@ public class TFCErrorTest extends JAXPBaseTest {
} }
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -54,6 +54,7 @@ import jaxp.library.JAXPDataProvider;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.xml.sax.ErrorHandler; import org.xml.sax.ErrorHandler;
@ -64,10 +65,15 @@ import org.xml.sax.SAXNotSupportedException;
import org.xml.sax.SAXParseException; import org.xml.sax.SAXParseException;
/* /*
* @test
* @bug 8080907 * @bug 8080907
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.validation.ptests.SchemaFactoryTest
* @run testng/othervm javax.xml.validation.ptests.SchemaFactoryTest
* @summary Class containing the test cases for SchemaFactory * @summary Class containing the test cases for SchemaFactory
*/ */
@Test(singleThreaded = true) @Test(singleThreaded = true)
@Listeners({jaxp.library.FilePolicy.class})
public class SchemaFactoryTest { public class SchemaFactoryTest {
@BeforeClass @BeforeClass
@ -398,3 +404,4 @@ public class SchemaFactoryTest {
private Document xsdDoc2; private Document xsdDoc2;
private byte[] xml; private byte[] xml;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,8 +39,7 @@ import javax.xml.validation.SchemaFactory;
import javax.xml.validation.TypeInfoProvider; import javax.xml.validation.TypeInfoProvider;
import javax.xml.validation.ValidatorHandler; import javax.xml.validation.ValidatorHandler;
import jaxp.library.JAXPFileBaseTest; import org.testng.annotations.Listeners;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.xml.sax.Attributes; import org.xml.sax.Attributes;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -49,9 +48,14 @@ import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.DefaultHandler;
/* /*
* @test
* @library /javax/xml/jaxp/libs
* @run testng/othervm -DrunSecMngr=true javax.xml.validation.ptests.TypeInfoProviderTest
* @run testng/othervm javax.xml.validation.ptests.TypeInfoProviderTest
* @summary test ValidatorHandler.getTypeInfoProvider() * @summary test ValidatorHandler.getTypeInfoProvider()
*/ */
public class TypeInfoProviderTest extends JAXPFileBaseTest { @Listeners({jaxp.library.FilePolicy.class})
public class TypeInfoProviderTest {
private ValidatorHandler validatorHandler; private ValidatorHandler validatorHandler;
@ -91,3 +95,4 @@ public class TypeInfoProviderTest extends JAXPFileBaseTest {
} }
} }

Some files were not shown because too many files have changed in this diff Show more