mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
Merge
This commit is contained in:
commit
3c025b715c
1360 changed files with 15024 additions and 5915 deletions
1
.hgtags
1
.hgtags
|
@ -372,3 +372,4 @@ d53037a90c441cb528dc41c30827985de0e67c62 jdk-9+123
|
|||
8e45018bde9de4ad15b972ae62874bba52dba2d5 jdk-9+127
|
||||
5bf88dce615f6804f9e101a96ffa7c9dfb4fbbbe jdk-9+128
|
||||
e8373543a3f0f60589b7d72b1f9b172721124caf jdk-9+129
|
||||
e613affb88d178dc7c589f1679db113d589bddb4 jdk-9+130
|
||||
|
|
|
@ -372,3 +372,4 @@ f80c841ae2545eaf9acd2724bccc305d98cefbe2 jdk-9+124
|
|||
8fa686245bd2a072ece3392743460030f0854520 jdk-9+127
|
||||
b30ae794d974d7dd3eb4e84203f70021823fa6c6 jdk-9+128
|
||||
f5902d3841b82cac6e7716a20c24e8e916fb14a8 jdk-9+129
|
||||
d94d54a3192fea79234c3ac55cd0b4052d45e954 jdk-9+130
|
||||
|
|
|
@ -684,7 +684,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||
AC_SUBST(CXXFLAGS_TESTEXE)
|
||||
|
||||
LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
|
||||
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
|
||||
LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
|
||||
|
||||
AC_SUBST(LDFLAGS_TESTLIB)
|
||||
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],
|
||||
IF_FALSE: [$2CXXSTD_CXXFLAG=""])
|
||||
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}"
|
||||
$2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}"
|
||||
AC_SUBST([$2CXXSTD_CXXFLAG])
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
$2CFLAGS_JDK="${$2CFLAGS_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
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
$2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
|
||||
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__"
|
||||
$2CFLAGS_JDKLIB_EXTRA='-xstrconst'
|
||||
fi
|
||||
|
||||
$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"
|
||||
;;
|
||||
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
|
||||
$2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
|
||||
|
||||
|
@ -1112,7 +1109,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
|
|||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
|
||||
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
|
||||
$2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
|
||||
LDFLAGS_CXX_SOLSTUDIO="-norunpath"
|
||||
$2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
|
||||
$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}"
|
||||
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"
|
||||
$2JDKLIB_LIBS=""
|
||||
else
|
||||
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \
|
||||
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
|
||||
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)"
|
||||
|
||||
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.
|
||||
# Default to server for other variants.
|
||||
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
|
||||
$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
|
||||
$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
|
||||
$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
|
||||
elif test "x$1" = "xBUILD"; then
|
||||
# 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"
|
||||
fi
|
||||
|
||||
|
@ -1181,6 +1178,8 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
|
|||
|
||||
fi
|
||||
|
||||
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2JAVA_BASE_LDFLAGS}"
|
||||
|
||||
# Set $2JVM_LIBS (per os)
|
||||
if test "x$OPENJDK_$1_OS" = xlinux; then
|
||||
$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_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
|
||||
# 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_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_NULL_POINTER_CHECK_CFLAG -Werror],
|
||||
IF_FALSE: [NO_NULL_POINTER_CHECK_CFLAG=""])
|
||||
AC_SUBST([NO_NULL_POINTER_CHECK_CFLAG])
|
||||
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
|
||||
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
|
||||
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
|
||||
dnl IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
|
||||
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
|
||||
IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
|
||||
CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
|
||||
AC_SUBST([NO_LIFETIME_DSE_CFLAG])
|
||||
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
|
||||
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
|
||||
dnl IF_FALSE: [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}"
|
||||
])
|
||||
|
|
|
@ -749,8 +749,6 @@ CXXFLAGS_JDKLIB
|
|||
CFLAGS_JDKEXE
|
||||
CFLAGS_JDKLIB
|
||||
MACOSX_VERSION_MIN
|
||||
NO_LIFETIME_DSE_CFLAG
|
||||
NO_NULL_POINTER_CHECK_CFLAG
|
||||
CXXSTD_CXXFLAG
|
||||
CXX_O_FLAG_SIZE
|
||||
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_gcc="4.3"
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft=""
|
||||
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12"
|
||||
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
|
||||
TOOLCHAIN_MINIMUM_VERSION_xlc=""
|
||||
|
||||
# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
|
||||
|
@ -5094,7 +5095,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
|||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# Restore old path.
|
||||
PATH="$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"
|
||||
fi
|
||||
|
||||
# Restore the flags to the user specified values.
|
||||
# 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_LDFLAGS="$SYSROOT_LDFLAGS"
|
||||
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
|
||||
|
||||
|
||||
|
@ -49781,20 +49808,17 @@ $as_echo "$supports" >&6; }
|
|||
|
||||
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}"
|
||||
JVM_CFLAGS="${JVM_CFLAGS} ${CXXSTD_CXXFLAG}"
|
||||
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CFLAGS_JDK="${CFLAGS_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
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
|
||||
CFLAGS_JDKLIB_EXTRA='-xstrconst'
|
||||
fi
|
||||
|
||||
CFLAGS_JDK="${CFLAGS_JDK} ${EXTRA_CFLAGS}"
|
||||
|
@ -49913,542 +49937,12 @@ $as_echo "$supports" >&6; }
|
|||
# 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_NULL_POINTER_CHECK_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"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 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}"
|
||||
|
||||
|
||||
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;}
|
||||
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}"
|
||||
|
||||
else
|
||||
:
|
||||
|
@ -50900,7 +50394,7 @@ $as_echo "$supports" >&6; }
|
|||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
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_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
|
||||
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}"
|
||||
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"
|
||||
JDKLIB_LIBS=""
|
||||
else
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
|
||||
JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
|
||||
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)"
|
||||
|
||||
if test "xTARGET" = "xTARGET"; then
|
||||
|
@ -50948,17 +50442,17 @@ $as_echo "$supports" >&6; }
|
|||
# Only add client/minimal dir if client/minimal is being built.
|
||||
# Default to server for other variants.
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
elif test "xTARGET" = "xBUILD"; then
|
||||
# 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"
|
||||
fi
|
||||
|
||||
|
@ -50969,6 +50463,8 @@ $as_echo "$supports" >&6; }
|
|||
|
||||
fi
|
||||
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${JAVA_BASE_LDFLAGS}"
|
||||
|
||||
# Set JVM_LIBS (per os)
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
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_JVM_CFLAGS="${OPENJDK_BUILD_JVM_CFLAGS} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}"
|
||||
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_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
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__"
|
||||
OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__"
|
||||
OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA='-xstrconst'
|
||||
fi
|
||||
|
||||
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
|
||||
:
|
||||
|
||||
# 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
|
||||
:
|
||||
|
||||
|
@ -51705,7 +51209,7 @@ $as_echo "$supports" >&6; }
|
|||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
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"
|
||||
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"
|
||||
|
@ -51740,11 +51244,11 @@ $as_echo "$supports" >&6; }
|
|||
|
||||
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
|
||||
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"
|
||||
OPENJDK_BUILD_JDKLIB_LIBS=""
|
||||
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)"
|
||||
|
||||
if test "xBUILD" = "xTARGET"; then
|
||||
|
@ -51753,17 +51257,17 @@ $as_echo "$supports" >&6; }
|
|||
# Only add client/minimal dir if client/minimal is being built.
|
||||
# Default to server for other variants.
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
elif test "xBUILD" = "xBUILD"; then
|
||||
# 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"
|
||||
fi
|
||||
|
||||
|
@ -51774,6 +51278,8 @@ $as_echo "$supports" >&6; }
|
|||
|
||||
fi
|
||||
|
||||
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${OPENJDK_BUILD_JAVA_BASE_LDFLAGS}"
|
||||
|
||||
# Set OPENJDK_BUILD_JVM_LIBS (per os)
|
||||
if test "x$OPENJDK_BUILD_OS" = xlinux; then
|
||||
OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -ldl -lpthread"
|
||||
|
@ -51838,7 +51344,7 @@ $as_echo "$supports" >&6; }
|
|||
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
if [[ " $JVM_FEATURES " =~ " jvmci " ]] && ! [[ " $JVM_FEATURES " =~ " compiler2 " ]] ; then
|
||||
as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2'" "$LINENO" 5
|
||||
if [[ " $JVM_FEATURES " =~ " jvmci " ]] && ! ( [[ " $JVM_FEATURES " =~ " compiler1 " ]] || [[ " $JVM_FEATURES " =~ " compiler2 " ]] ); then
|
||||
as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'" "$LINENO" 5
|
||||
fi
|
||||
|
||||
if [[ " $JVM_FEATURES " =~ " compiler2 " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then
|
||||
|
@ -53369,7 +52875,7 @@ $as_echo "$JVM_FEATURES" >&6; }
|
|||
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" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
|
||||
|
@ -53383,7 +52889,7 @@ $as_echo "$JVM_FEATURES" >&6; }
|
|||
|
||||
# Enable features depending on variant.
|
||||
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_minimal="compiler1 minimal $JVM_FEATURES"
|
||||
JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
|
||||
|
|
|
@ -198,8 +198,8 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
|||
AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
|
||||
fi
|
||||
|
||||
if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! HOTSPOT_CHECK_JVM_FEATURE(compiler2); then
|
||||
AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2'])
|
||||
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' or 'compiler1'])
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
# 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" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
|
||||
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
|
||||
|
@ -253,7 +253,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
|||
|
||||
# Enable features depending on variant.
|
||||
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_minimal="compiler1 minimal $JVM_FEATURES"
|
||||
JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
|
||||
|
|
|
@ -391,8 +391,6 @@ CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
|
|||
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
||||
|
||||
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@
|
||||
|
||||
# Tools that potentially need to be cross compilation aware.
|
||||
|
|
|
@ -54,7 +54,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
|||
TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
|
||||
TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
|
||||
TOOLCHAIN_MINIMUM_VERSION_microsoft=""
|
||||
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12"
|
||||
TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
|
||||
TOOLCHAIN_MINIMUM_VERSION_xlc=""
|
||||
|
||||
# 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
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
|
||||
[
|
||||
# Restore old path.
|
||||
PATH="$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"
|
||||
fi
|
||||
|
||||
# Restore the flags to the user specified values.
|
||||
# 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_LDFLAGS="$SYSROOT_LDFLAGS"
|
||||
BUILD_AR="$AR"
|
||||
|
||||
TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS([], [OPENJDK_BUILD_])
|
||||
fi
|
||||
|
||||
AC_SUBST(BUILD_CC)
|
||||
|
|
|
@ -335,7 +335,10 @@ else
|
|||
for j in ${repos_extra} ; do
|
||||
if [ "${i}" = "${j}" ] ; then
|
||||
# it's an "extra"
|
||||
pull_base="${pull_extra}"
|
||||
if [ -n "${pull_extra}" ]; then
|
||||
# if no pull_extra is defined, assume that pull_default is valid
|
||||
pull_base="${pull_extra}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -357,6 +357,18 @@ var getJibProfilesDependencies = function (input, common) {
|
|||
var boot_jdk_platform = input.build_os + "-"
|
||||
+ (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 = {
|
||||
linux_x64: "gcc4.9.2-OEL6.4+1.0",
|
||||
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
|
||||
|
@ -374,12 +386,12 @@ var getJibProfilesDependencies = function (input, common) {
|
|||
boot_jdk: {
|
||||
server: "javare",
|
||||
module: "jdk",
|
||||
revision: "8",
|
||||
revision: boot_jdk_revision,
|
||||
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"
|
||||
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.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 + ".jdk/Contents/Home"
|
||||
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart)
|
||||
},
|
||||
|
||||
devkit: {
|
||||
|
|
|
@ -372,3 +372,4 @@ c7f5ba08fcd4b8416e62c21229f9a07c95498919 jdk-9+126
|
|||
8fab452b6f4710762ba1d8e55fd62db00b1355fe jdk-9+127
|
||||
1f093d3f8cd99cd37c3b0af4cf5c3bffaa9c8b98 jdk-9+128
|
||||
c3e83ccab3bb1733ae903d681879a33f85ed465c jdk-9+129
|
||||
77f9692d5976ae155773dd3e07533616bb95bae1 jdk-9+130
|
||||
|
|
|
@ -532,3 +532,4 @@ adc8c84b7cf8c540d920182f78a2bc982366432a jdk-9+126
|
|||
352357128f602dcf0426b1cbe011a4685a4d9f97 jdk-9+127
|
||||
22bf6db9767b1b3a1994cbf32eb3331f31ae2093 jdk-9+128
|
||||
e96b34b76d863ed1fa04e0eeb3f297ac17b490fd jdk-9+129
|
||||
7d54c7056328b6a2bf4877458b8f4d8cd870f93b jdk-9+130
|
||||
|
|
|
@ -50,7 +50,6 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \
|
|||
$(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \
|
||||
$(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \
|
||||
$(HOTSPOT_TOPDIR)/test/compiler/calls \
|
||||
$(HOTSPOT_TOPDIR)/test/compiler/native \
|
||||
$(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetNamedModule \
|
||||
$(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \
|
||||
$(HOTSPOT_TOPDIR)/test/compiler/jvmci/jdk.vm.ci.code.test \
|
||||
|
|
|
@ -110,17 +110,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
|||
// Entry frame checks
|
||||
if (is_entry_frame()) {
|
||||
// an entry frame must have a valid fp.
|
||||
|
||||
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;
|
||||
|
||||
return fp_safe && is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
intptr_t* sender_sp = NULL;
|
||||
|
@ -210,15 +200,8 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
|||
}
|
||||
|
||||
// construct the potential sender
|
||||
|
||||
frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
|
||||
|
||||
// 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;
|
||||
return sender.is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
|
||||
|
|
|
@ -225,19 +225,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
|||
// Entry frame checks
|
||||
if (is_entry_frame()) {
|
||||
// an entry frame must have a valid fp.
|
||||
|
||||
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;
|
||||
|
||||
return fp_safe && is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
intptr_t* younger_sp = sp();
|
||||
|
@ -290,14 +278,8 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if( sender.is_entry_frame()) {
|
||||
// Validate the JavaCallWrapper an entry frame must have
|
||||
|
||||
address jcw = (address)sender.entry_frame_call_wrapper();
|
||||
|
||||
bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > sender_fp);
|
||||
|
||||
return jcw_safe;
|
||||
if (sender.is_entry_frame()) {
|
||||
return sender.is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
// If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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
|
||||
#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/register.hpp"
|
||||
#include "interp_masm_sparc.hpp"
|
||||
|
|
|
@ -108,17 +108,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
|||
// Entry frame checks
|
||||
if (is_entry_frame()) {
|
||||
// an entry frame must have a valid fp.
|
||||
|
||||
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;
|
||||
|
||||
return fp_safe && is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
intptr_t* sender_sp = NULL;
|
||||
|
@ -209,15 +199,8 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
|||
}
|
||||
|
||||
// construct the potential sender
|
||||
|
||||
frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
|
||||
|
||||
// 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;
|
||||
return sender.is_entry_frame_valid(thread);
|
||||
}
|
||||
|
||||
CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
|
|
@ -1173,7 +1173,7 @@ void ClassLoaderData::print_value_on(outputStream* out) const {
|
|||
if (class_loader() == NULL) {
|
||||
out->print("NULL class_loader");
|
||||
} else {
|
||||
out->print("class loader " INTPTR_FORMAT, p2i(this));
|
||||
out->print("class loader " INTPTR_FORMAT " ", p2i(this));
|
||||
class_loader()->print_value_on(out);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -316,10 +316,14 @@ size_t G1Analytics::predict_pending_cards() const {
|
|||
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();
|
||||
}
|
||||
|
||||
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,
|
||||
double pause_time_ms) {
|
||||
_recent_gc_times_ms->add(pause_time_ms);
|
||||
|
|
|
@ -155,6 +155,7 @@ public:
|
|||
void update_recent_gc_times(double end_time_sec, double elapsed_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;
|
||||
};
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "classfile/symbolTable.hpp"
|
||||
#include "code/codeCache.hpp"
|
||||
#include "code/icBuffer.hpp"
|
||||
#include "gc/g1/g1Analytics.hpp"
|
||||
#include "gc/g1/bufferingOopClosure.hpp"
|
||||
#include "gc/g1/concurrentG1Refine.hpp"
|
||||
#include "gc/g1/concurrentG1RefineThread.hpp"
|
||||
|
@ -2473,8 +2474,19 @@ size_t G1CollectedHeap::max_capacity() const {
|
|||
}
|
||||
|
||||
jlong G1CollectedHeap::millis_since_last_gc() {
|
||||
// assert(false, "NYI");
|
||||
return 0;
|
||||
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 ret_val;
|
||||
}
|
||||
|
||||
void G1CollectedHeap::prepare_for_verify() {
|
||||
|
|
|
@ -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);
|
||||
|
||||
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->compute_pause_time_ratio(interval_ms, pause_time_ms);
|
||||
}
|
||||
|
|
|
@ -1256,21 +1256,21 @@ class GenTimeOfLastGCClosure: public GenCollectedHeap::GenClosure {
|
|||
};
|
||||
|
||||
jlong GenCollectedHeap::millis_since_last_gc() {
|
||||
// We need a monotonically non-decreasing time in ms but
|
||||
// os::javaTimeMillis() does not guarantee monotonicity.
|
||||
// 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 now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
|
||||
GenTimeOfLastGCClosure tolgc_cl(now);
|
||||
// iterate over generations getting the oldest
|
||||
// time that a generation was collected
|
||||
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();
|
||||
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 retVal;
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
|
|
@ -350,6 +350,11 @@ WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
|
|||
return (jlong)alignment;
|
||||
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
|
||||
WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj))
|
||||
G1CollectedHeap* g1 = G1CollectedHeap::heap();
|
||||
|
@ -401,14 +406,21 @@ WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
|
|||
WB_END
|
||||
|
||||
WB_ENTRY(jlong, WB_PSVirtualSpaceAlignment(JNIEnv* env, jobject o))
|
||||
ParallelScavengeHeap* ps = ParallelScavengeHeap::heap();
|
||||
size_t alignment = ps->gens()->virtual_spaces()->alignment();
|
||||
return (jlong)alignment;
|
||||
#if INCLUDE_ALL_GCS
|
||||
if (UseParallelGC) {
|
||||
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_ENTRY(jlong, WB_PSHeapGenerationAlignment(JNIEnv* env, jobject o))
|
||||
size_t alignment = ParallelScavengeHeap::heap()->generation_alignment();
|
||||
return (jlong)alignment;
|
||||
#if INCLUDE_ALL_GCS
|
||||
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_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
|
||||
|
@ -1694,6 +1706,7 @@ static JNINativeMethod methods[] = {
|
|||
{CC"getVMAllocationGranularity", CC"()J", (void*)&WB_GetVMAllocationGranularity },
|
||||
{CC"getVMLargePageSize", CC"()J", (void*)&WB_GetVMLargePageSize},
|
||||
{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"parseCommandLine0",
|
||||
CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
|
||||
|
|
|
@ -225,6 +225,19 @@ JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) con
|
|||
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 {
|
||||
if (_deopt_state == is_deoptimized ||
|
||||
!is_compiled_frame() ) return false;
|
||||
|
|
|
@ -166,6 +166,8 @@ class frame VALUE_OBJ_CLASS_SPEC {
|
|||
frame sender_for_interpreter_frame(RegisterMap* map) const;
|
||||
frame sender_for_native_frame(RegisterMap* map) const;
|
||||
|
||||
bool is_entry_frame_valid(JavaThread* thread) const;
|
||||
|
||||
// All frames:
|
||||
|
||||
// A low-level interface for vframes:
|
||||
|
|
|
@ -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.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -226,6 +226,9 @@ BUNDLE_UP_AND_EXIT = \
|
|||
( \
|
||||
jtregExitCode=$$? && \
|
||||
_summary="$(SUMMARY_TXT)"; \
|
||||
if [ $${jtregExitCode} = 1 ] ; then \
|
||||
jtregExitCode=0; \
|
||||
fi; \
|
||||
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
|
||||
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
|
||||
if [ -r "$${_summary}" ] ; then \
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
/*
|
||||
* @test RandomAllocationTest
|
||||
* @key stress
|
||||
* @summary stressing code cache by allocating randomly sized "dummy" code blobs
|
||||
* @library /testlibrary /test/lib /
|
||||
* @modules java.base/jdk.internal.misc
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
/*
|
||||
* @test UnexpectedDeoptimizationTest
|
||||
* @key stress
|
||||
* @summary stressing code cache by forcing unexpected deoptimizations
|
||||
* @library /testlibrary /test/lib /
|
||||
* @modules java.base/jdk.internal.misc
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
/**
|
||||
* @test
|
||||
* @bug 7184394
|
||||
* @key stress
|
||||
* @summary add intrinsics to use AES instructions
|
||||
* @library /testlibrary /
|
||||
* @modules java.base/jdk.internal.misc
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
* @bug 8015396
|
||||
* @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
|
||||
*/
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -60,13 +60,13 @@ public class TestNewSizeFlags {
|
|||
|
||||
// Test NewSize and MaxNewSize
|
||||
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(10 * M, -1, 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(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
|
||||
testXmnFlags(0, 30 * M, 40 * M, options, true);
|
||||
|
@ -88,9 +88,11 @@ public class TestNewSizeFlags {
|
|||
long heapSize, long maxHeapSize,
|
||||
LinkedList<String> options,
|
||||
boolean failureExpected) throws Exception {
|
||||
long expectedNewSize = newSize;
|
||||
long expectedMaxNewSize = (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize);
|
||||
testVMOptions(newSize, maxNewSize,
|
||||
heapSize, maxHeapSize,
|
||||
newSize, (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize),
|
||||
expectedNewSize, expectedMaxNewSize,
|
||||
options, failureExpected);
|
||||
}
|
||||
|
||||
|
@ -159,7 +161,9 @@ public class TestNewSizeFlags {
|
|||
"-XX:-UseLargePages",
|
||||
NewSizeVerifier.class.getName(),
|
||||
Long.toString(expectedNewSize),
|
||||
Long.toString(expectedMaxNewSize)
|
||||
Long.toString(expectedMaxNewSize),
|
||||
Long.toString(heapSize),
|
||||
Long.toString(maxHeapSize)
|
||||
);
|
||||
vmOptions.removeIf(String::isEmpty);
|
||||
ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(vmOptions.toArray(new String[vmOptions.size()]));
|
||||
|
@ -177,7 +181,12 @@ public class TestNewSizeFlags {
|
|||
*/
|
||||
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 CHUNK_SIZE = 1024;
|
||||
|
@ -185,63 +194,79 @@ public class TestNewSizeFlags {
|
|||
public static byte garbage[][] = new byte[ARRAY_LENGTH][];
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
if (args.length != 2) {
|
||||
throw new IllegalArgumentException("Expected 2 args: <expectedNewSize> <expectedMaxNewSize>");
|
||||
if (args.length != 4) {
|
||||
throw new IllegalArgumentException("Expected 4 args: <expectedNewSize> <expectedMaxNewSize> <initialHeapSize> <maxHeapSize>");
|
||||
}
|
||||
final long newSize = Long.valueOf(args[0]);
|
||||
final long maxNewSize = Long.valueOf(args[1]);
|
||||
final long initialHeapSize = Long.valueOf(args[2]);
|
||||
final long maxHeapSize = Long.valueOf(args[3]);
|
||||
|
||||
// verify initial size
|
||||
verifyNewSize(newSize, maxNewSize);
|
||||
verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize);
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that actual young gen size conforms NewSize and MaxNewSize values.
|
||||
*/
|
||||
public static Void verifyNewSize(long newSize, long maxNewSize) {
|
||||
long alignedNewSize = alignNewSize(newSize);
|
||||
long alignedMaxNewSize = alignNewSize(maxNewSize);
|
||||
public static Void verifyNewSize(long newSize, long maxNewSize,
|
||||
long initialHeapSize, long maxHeapSize) {
|
||||
long alignedNewSize = alignGenSize(newSize);
|
||||
long alignedMaxNewSize = alignGenSize(maxNewSize);
|
||||
long alignedXms = alignHeapSize(initialHeapSize);
|
||||
long alignedXmx = alignHeapSize(maxHeapSize);
|
||||
|
||||
MemoryUsage youngGenUsage = getYoungGenUsage();
|
||||
long initSize = youngGenUsage.getInit();
|
||||
long commitedSize = youngGenUsage.getCommitted();
|
||||
long maxSize = youngGenUsage.getMax();
|
||||
|
||||
if (newSize != -1) {
|
||||
if (youngGenUsage.getInit() < alignedNewSize) {
|
||||
if (initSize < alignedNewSize) {
|
||||
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: "
|
||||
+ youngGenUsage.getCommitted() + " < " + alignedNewSize);
|
||||
+ commitedSize + " < " + alignedNewSize);
|
||||
}
|
||||
|
||||
// for G1 max new size == committed new size
|
||||
if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1
|
||||
&& youngGenUsage.getMax() < alignedNewSize) {
|
||||
if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
|
||||
&& maxSize < alignedNewSize) {
|
||||
throw new RuntimeException("max new size < NewSize value: "
|
||||
+ youngGenUsage.getMax() + " < " + alignedNewSize);
|
||||
+ maxSize + " < " + alignedNewSize);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxNewSize != -1) {
|
||||
if (youngGenUsage.getInit() > alignedMaxNewSize) {
|
||||
if (initSize > alignedMaxNewSize) {
|
||||
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: "
|
||||
+ youngGenUsage.getCommitted() + " > " + alignedMaxNewSize);
|
||||
+ commitedSize + " > " + alignedMaxNewSize);
|
||||
}
|
||||
|
||||
if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1
|
||||
&& youngGenUsage.getMax() != alignedMaxNewSize) {
|
||||
throw new RuntimeException("max new size != MaxNewSize value: "
|
||||
+ youngGenUsage.getMax() + " != " + alignedMaxNewSize);
|
||||
if (alignedXms != alignedXmx) {
|
||||
if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
|
||||
&& maxSize != alignedMaxNewSize) {
|
||||
throw new RuntimeException("max new size != MaxNewSize value: "
|
||||
+ 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;
|
||||
|
@ -256,41 +281,47 @@ public class TestNewSizeFlags {
|
|||
* For all GCs used value is 0.
|
||||
*/
|
||||
private static MemoryUsage getYoungGenUsage() {
|
||||
if (GCTypes.YoungGCType.getYoungGCType() == GCTypes.YoungGCType.G1) {
|
||||
return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit()
|
||||
+ HeapRegionUsageTool.getSurvivorUsage().getInit(),
|
||||
0,
|
||||
HeapRegionUsageTool.getEdenUsage().getCommitted()
|
||||
+ HeapRegionUsageTool.getSurvivorUsage().getCommitted(),
|
||||
Long.MAX_VALUE);
|
||||
MemoryUsage edenUsage = HeapRegionUsageTool.getEdenUsage();
|
||||
MemoryUsage survivorUsage = HeapRegionUsageTool.getSurvivorUsage();
|
||||
long edenUsageInit = edenUsage.getInit();
|
||||
long edenUsageCommited = edenUsage.getCommitted();
|
||||
long survivorUsageInit = survivorUsage.getInit();
|
||||
long survivorUsageCommited = survivorUsage.getCommitted();
|
||||
|
||||
if (YOUNG_GC_TYPE == GCTypes.YoungGCType.G1) {
|
||||
return new MemoryUsage(edenUsageInit + survivorUsageInit, 0,
|
||||
edenUsageCommited + survivorUsageCommited, Long.MAX_VALUE);
|
||||
} else {
|
||||
return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit()
|
||||
+ HeapRegionUsageTool.getSurvivorUsage().getInit() * 2,
|
||||
0,
|
||||
HeapRegionUsageTool.getEdenUsage().getCommitted()
|
||||
+ HeapRegionUsageTool.getSurvivorUsage().getCommitted() * 2,
|
||||
HeapRegionUsageTool.getEdenUsage().getMax()
|
||||
+ HeapRegionUsageTool.getSurvivorUsage().getMax() * 2);
|
||||
return new MemoryUsage(edenUsageInit + survivorUsageInit * 2, 0,
|
||||
edenUsageCommited + survivorUsageCommited * 2,
|
||||
edenUsage.getMax() + survivorUsage.getMax() * 2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Align value regardful to used young GC.
|
||||
* Align generation size regardful to used young GC.
|
||||
*/
|
||||
public static long alignNewSize(long value) {
|
||||
switch (GCTypes.YoungGCType.getYoungGCType()) {
|
||||
public static long alignGenSize(long value) {
|
||||
switch (YOUNG_GC_TYPE) {
|
||||
case DefNew:
|
||||
case ParNew:
|
||||
return HeapRegionUsageTool.alignDown(value, wb.getHeapSpaceAlignment());
|
||||
return HeapRegionUsageTool.alignDown(value, HEAP_SPACE_ALIGNMENT);
|
||||
case PSNew:
|
||||
return HeapRegionUsageTool.alignUp(HeapRegionUsageTool.alignDown(value,
|
||||
wb.getHeapSpaceAlignment()),
|
||||
wb.psVirtualSpaceAlignment());
|
||||
HEAP_SPACE_ALIGNMENT),
|
||||
PS_VIRTUAL_SPACE_ALIGNMENT);
|
||||
case G1:
|
||||
return HeapRegionUsageTool.alignUp(value, wb.g1RegionSize());
|
||||
return HeapRegionUsageTool.alignUp(value, WB.g1RegionSize());
|
||||
default:
|
||||
throw new RuntimeException("Unexpected young GC type");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Align heap size.
|
||||
*/
|
||||
public static long alignHeapSize(long value){
|
||||
return HeapRegionUsageTool.alignUp(value,HEAP_ALIGNMENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
/*
|
||||
* @test TestIHOPErgo
|
||||
* @bug 8148397
|
||||
* @key stress
|
||||
* @summary Test checks that behavior of Adaptive and Static IHOP at concurrent cycle initiation
|
||||
* @requires vm.gc.G1
|
||||
* @requires !vm.flightRecorder
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8007320 8014709
|
||||
* @bug 8007320 8014709 8163231
|
||||
* @summary Test all optional fields in ConstMethod
|
||||
* @compile -g -parameters ConstMethodTest.java
|
||||
* @run main ConstMethodTest
|
||||
|
@ -122,8 +122,8 @@ public class ConstMethodTest {
|
|||
equal(ann.length, 3);
|
||||
Annotation foo = ann[0][0];
|
||||
Annotation bar = ann[1][0];
|
||||
equal(foo.toString(), "@Named(value=aName)");
|
||||
equal(bar.toString(), "@Named(value=bName)");
|
||||
equal(foo.toString(), "@Named(value=\"aName\")");
|
||||
equal(bar.toString(), "@Named(value=\"bName\")");
|
||||
check(foo.equals(foo));
|
||||
check(bar.equals(bar));
|
||||
check(! foo.equals(bar));
|
||||
|
@ -131,7 +131,7 @@ public class ConstMethodTest {
|
|||
Annotation[] ann2 = m.getAnnotations();
|
||||
equal(ann2.length, 1);
|
||||
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
|
||||
Parameter[] parameters = m.getParameters();
|
||||
if(parameters == null)
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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) {
|
||||
String expectedAnn = "@TestAnn(site=" + expectedSite + ")";
|
||||
String expectedAnn = "@TestAnn(site=\"" + expectedSite + "\")";
|
||||
assertTrue(testAnn.toString().equals(expectedAnn),
|
||||
"Expected \"" + expectedAnn + "\", got \"" + testAnn + "\"");
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ int main (int argc, const char** argv) {
|
|||
CLASS_PATH_OPT, javaclasspath);
|
||||
|
||||
options[0].optionString = "-Xint";
|
||||
options[1].optionString = "-Xss328k";
|
||||
options[1].optionString = "-Xss1M";
|
||||
options[2].optionString = javaclasspathopt;
|
||||
|
||||
vm_args.version = JNI_VERSION_1_2;
|
||||
|
|
|
@ -372,3 +372,4 @@ e04a15153cc293f05fcd60bc98236f50e16af46a jdk-9+124
|
|||
bdc3c0b737efbf899709eb3121ce760dcfb51151 jdk-9+127
|
||||
8a7681a9d70640ac7fbf05c28f53c1d51d8d00a1 jdk-9+128
|
||||
74241304e87b0d463391a8ecab40979b5af86dc2 jdk-9+129
|
||||
e66cdc2de6b02443911d386fc9217b0d824d0686 jdk-9+130
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -93,14 +93,14 @@ public abstract class XPathFactory {
|
|||
public static XPathFactory newInstance() {
|
||||
|
||||
try {
|
||||
return newInstance(DEFAULT_OBJECT_MODEL_URI);
|
||||
} catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
|
||||
throw new RuntimeException(
|
||||
"XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
|
||||
+ DEFAULT_OBJECT_MODEL_URI
|
||||
+ " with the XPathFactoryConfigurationException: "
|
||||
+ xpathFactoryConfigurationException.toString()
|
||||
);
|
||||
return newInstance(DEFAULT_OBJECT_MODEL_URI);
|
||||
} catch (XPathFactoryConfigurationException e) {
|
||||
throw new RuntimeException(
|
||||
"XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
|
||||
+ DEFAULT_OBJECT_MODEL_URI
|
||||
+ " with the XPathFactoryConfigurationException: "
|
||||
+ e.getMessage(), e
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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/stream/FactoryFindTest.java 8156508 generic-all
|
||||
javax/xml/jaxp/unittest/common/ValidationWarningsTest.java 8150145 generic-all
|
||||
|
|
|
@ -14,6 +14,11 @@ keys=intermittent randomness
|
|||
# Tests that must run in othervm mode
|
||||
othervm.dirs=javax/xml/jaxp
|
||||
|
||||
lib.dirs = /javax/xml/jaxp/libs
|
||||
|
||||
# Declare module dependency
|
||||
modules=java.xml
|
||||
|
||||
# Group definitions
|
||||
groups=TEST.groups
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* a (partial) closed circuit. For instance, a catalog may use itself
|
||||
* as an additional catalog specified in its own nextCatalog entry.
|
||||
* This case tests if the implementation handles this issue.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class CatalogReferCircularityTest {
|
||||
|
||||
@Test(dataProvider = "catalogName",
|
||||
|
@ -49,7 +53,7 @@ public class CatalogReferCircularityTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "catalogName")
|
||||
private Object[][] catalogName() {
|
||||
public Object[][] catalogName() {
|
||||
return new Object[][] {
|
||||
// This catalog defines itself as next catalog.
|
||||
{ "catalogReferCircle-itself.xml" },
|
||||
|
@ -60,3 +64,4 @@ public class CatalogReferCircularityTest {
|
|||
{ "catalogReferCircle-left.xml" } };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class DefaultFeaturesTest {
|
||||
|
||||
private CatalogFeatures defaultFeature;
|
||||
|
@ -56,7 +61,7 @@ public class DefaultFeaturesTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "feature-value")
|
||||
private Object[][] data() {
|
||||
public Object[][] data() {
|
||||
return new Object[][] {
|
||||
{ Feature.FILES, null },
|
||||
{ Feature.PREFER, CatalogTestUtils.PREFER_PUBLIC },
|
||||
|
@ -64,3 +69,4 @@ public class DefaultFeaturesTest {
|
|||
{ Feature.RESOLVE, CatalogTestUtils.RESOLVE_STRICT } };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 javax.xml.catalog.CatalogFeatures.Feature.DEFER;
|
||||
import static javax.xml.catalog.CatalogManager.catalog;
|
||||
import static jaxp.library.JAXPTestUtilities.runWithAllPerm;
|
||||
import static jaxp.library.JAXPTestUtilities.tryRunWithAllPerm;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
@ -36,16 +38,20 @@ import javax.xml.catalog.CatalogFeatures;
|
|||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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,
|
||||
* delegatePublic, delegateURI and nextCatalog entries are used lazily
|
||||
* in resolution via defer feature.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class DeferFeatureTest {
|
||||
|
||||
@Test(dataProvider = "catalog-countOfLoadedCatalogFile")
|
||||
|
@ -55,7 +61,7 @@ public class DeferFeatureTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "catalog-countOfLoadedCatalogFile")
|
||||
private Object[][] data() {
|
||||
public Object[][] data() {
|
||||
return new Object[][]{
|
||||
// By default, alternative catalogs are not loaded.
|
||||
{createCatalog(CatalogFeatures.defaults()), 0},
|
||||
|
@ -75,9 +81,9 @@ public class DeferFeatureTest {
|
|||
}
|
||||
|
||||
private int loadedCatalogCount(Catalog catalog) throws Exception {
|
||||
Method method = catalog.getClass().getDeclaredMethod(
|
||||
"loadedCatalogCount");
|
||||
method.setAccessible(true);
|
||||
Method method = tryRunWithAllPerm(() -> catalog.getClass().getDeclaredMethod("loadedCatalogCount"));
|
||||
runWithAllPerm(() -> method.setAccessible(true));
|
||||
return (int) method.invoke(catalog);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class DelegatePublicTest {
|
||||
|
||||
@Test(dataProvider = "publicId-matchedUri")
|
||||
|
@ -48,7 +51,7 @@ public class DelegatePublicTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "publicId-matchedUri")
|
||||
private Object[][] dataOnMatch() {
|
||||
public Object[][] dataOnMatch() {
|
||||
return new Object[][] {
|
||||
// The matched URI of the specified public id is defined in
|
||||
// a delegate catalog file of the current catalog file.
|
||||
|
@ -79,7 +82,7 @@ public class DelegatePublicTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "publicId-expectedExceptionClass")
|
||||
private Object[][] dataOnException() {
|
||||
public Object[][] dataOnException() {
|
||||
return new Object[][] {
|
||||
// The matched delegatePublic entry of the specified public id
|
||||
// defines a non-existing delegate catalog file. That should
|
||||
|
@ -97,3 +100,4 @@ public class DelegatePublicTest {
|
|||
return catalogResolver("delegatePublic.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class DelegateSystemTest {
|
||||
|
||||
@Test(dataProvider = "systemId-matchedUri")
|
||||
|
@ -48,7 +51,7 @@ public class DelegateSystemTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "systemId-matchedUri")
|
||||
private Object[][] dataOnMatch() {
|
||||
public Object[][] dataOnMatch() {
|
||||
return new Object[][] {
|
||||
// The matched URI of the specified system id is defined in
|
||||
// a delegate catalog file of the current catalog file.
|
||||
|
@ -79,7 +82,7 @@ public class DelegateSystemTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "systemId-expectedExceptionClass")
|
||||
private Object[][] dataOnException() {
|
||||
public Object[][] dataOnException() {
|
||||
return new Object[][] {
|
||||
// The matched delegateSystem entry of the specified system id
|
||||
// defines a non-existing delegate catalog file. That should
|
||||
|
@ -97,3 +100,4 @@ public class DelegateSystemTest {
|
|||
return catalogResolver("delegateSystem.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class DelegateUriTest {
|
||||
|
||||
@Test(dataProvider = "uri-matchedUri")
|
||||
|
@ -48,7 +51,7 @@ public class DelegateUriTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "uri-matchedUri")
|
||||
private Object[][] data() {
|
||||
public Object[][] data() {
|
||||
return new Object[][] {
|
||||
// The matched URI of the specified URI reference is defined in
|
||||
// a delegate catalog file of the current catalog file.
|
||||
|
@ -78,7 +81,7 @@ public class DelegateUriTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "uri-expectedExceptionClass")
|
||||
private Object[][] dataOnException() {
|
||||
public Object[][] dataOnException() {
|
||||
return new Object[][] {
|
||||
// The matched delegateURI entry of the specified URI reference
|
||||
// defines a non-existing delegate catalog file. That should
|
||||
|
@ -96,3 +99,4 @@ public class DelegateUriTest {
|
|||
return catalogUriResolver("delegateUri.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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,
|
||||
* 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 {
|
||||
|
||||
private static final String CATALOG_GROUP = "group.xml";
|
||||
|
@ -52,7 +55,7 @@ public class GroupTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "systemId-matchedUri")
|
||||
private Object[][] dataOnSysId() {
|
||||
public Object[][] dataOnSysId() {
|
||||
return new Object[][] {
|
||||
// The matched URI of the specified system id is enclosed by a
|
||||
// group entry.
|
||||
|
@ -78,7 +81,7 @@ public class GroupTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "publicId-matchedUri")
|
||||
private Object[][] dataOnPubId() {
|
||||
public Object[][] dataOnPubId() {
|
||||
return new Object[][] {
|
||||
// The matched URI of the specified public id is enclosed by a
|
||||
// group entry.
|
||||
|
@ -104,7 +107,7 @@ public class GroupTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "uri-matchedUri")
|
||||
private Object[][] dataOnUri() {
|
||||
public Object[][] dataOnUri() {
|
||||
return new Object[][] {
|
||||
// The matched URI of the specified URI reference is enclosed by
|
||||
// a group entry.
|
||||
|
@ -128,3 +131,4 @@ public class GroupTest {
|
|||
return catalogResolver(CATALOG_GROUP);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* and the catalog files specified by the nextCatalog entries may not
|
||||
* 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 {
|
||||
|
||||
private static final String CATALOG_LOADCATALOGFILES = "loadCatalogFiles.xml";
|
||||
|
@ -62,7 +65,7 @@ public class LoadCatalogTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "entityResolver")
|
||||
private Object[][] entityResolver() {
|
||||
public Object[][] entityResolver() {
|
||||
return new Object[][] {
|
||||
// This EntityResolver loads multiple catalog files one by one.
|
||||
// All of the files are available.
|
||||
|
@ -82,7 +85,7 @@ public class LoadCatalogTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "uriResolver")
|
||||
private Object[][] uriResolver() {
|
||||
public Object[][] uriResolver() {
|
||||
return new Object[][] {
|
||||
// This URIResolver loads multiple catalog files one by one.
|
||||
// All of the files are available.
|
||||
|
@ -108,7 +111,7 @@ public class LoadCatalogTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "catalogName")
|
||||
private Object[][] catalogName() {
|
||||
public Object[][] catalogName() {
|
||||
return new Object[][] {
|
||||
// This catalog file set includes null catalog files.
|
||||
{ (String[]) null },
|
||||
|
@ -118,3 +121,4 @@ public class LoadCatalogTest {
|
|||
{ new String[] { CATALOG_LOADCATALOGFILES } } };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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,
|
||||
* 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 {
|
||||
|
||||
private static final String CATALOG_NEXTCATALOGLEFT
|
||||
|
@ -56,7 +59,7 @@ public class NextCatalogTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "systemId-matchedUri")
|
||||
private Object[][] dataOnSysId() {
|
||||
public Object[][] dataOnSysId() {
|
||||
return new Object[][] {
|
||||
// This matched URI of the specified system id is defined in a
|
||||
// next catalog file.
|
||||
|
@ -88,7 +91,7 @@ public class NextCatalogTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "publicId-matchedUri")
|
||||
private Object[][] dataOnPubId() {
|
||||
public Object[][] dataOnPubId() {
|
||||
return new Object[][] {
|
||||
// This matched URI of the specified public id is defined in a
|
||||
// next catalog file.
|
||||
|
@ -120,7 +123,7 @@ public class NextCatalogTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "uri-matchedUri")
|
||||
private Object[][] dataOnUri() {
|
||||
public Object[][] dataOnUri() {
|
||||
return new Object[][] {
|
||||
// This matched URI of the specified URI reference is defined in
|
||||
// a next catalog file.
|
||||
|
@ -156,3 +159,4 @@ public class NextCatalogTest {
|
|||
CATALOG_NEXTCATALOGRIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* the passed identifiers and URI references. And then the catalog
|
||||
* resolver uses the normalized stuff to search the counterparts in
|
||||
* catalog files.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class NormalizationTest {
|
||||
|
||||
private static final String CATALOG_NORMALIZATION = "normalization.xml";
|
||||
|
@ -65,7 +68,7 @@ public class NormalizationTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "systemId_uri-matchedUri")
|
||||
private Object[][] dataOnSysIdAndUri() {
|
||||
public Object[][] dataOnSysIdAndUri() {
|
||||
return new Object[][] {
|
||||
// The specified system id/URI reference contains spaces. And
|
||||
// the counterparts in system/uri entries also contain spaces.
|
||||
|
@ -87,7 +90,7 @@ public class NormalizationTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "publicId-matchedUri")
|
||||
private Object[][] dataOnPubId() {
|
||||
public Object[][] dataOnPubId() {
|
||||
return new Object[][] {
|
||||
// The specified public id contains spaces. And the counterparts
|
||||
// in public entry also contains spaces.
|
||||
|
@ -112,3 +115,4 @@ public class NormalizationTest {
|
|||
return catalogUriResolver(CATALOG_NORMALIZATION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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,
|
||||
* and tests the priority between this feature and attribute prefer
|
||||
* in catalog file.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class PreferFeatureTest {
|
||||
|
||||
@Test(dataProvider = "prefer-publicId-systemId",
|
||||
|
@ -53,7 +57,7 @@ public class PreferFeatureTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "prefer-publicId-systemId")
|
||||
private Object[][] data() {
|
||||
public Object[][] data() {
|
||||
return new Object[][] {
|
||||
// The feature prefer is system. There's a match for the
|
||||
// specified public id, and no match for the specified system id.
|
||||
|
@ -77,3 +81,4 @@ public class PreferFeatureTest {
|
|||
"preferFeature.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* specify the prefer attribute. It tests how does the prefer attribute
|
||||
* affect the resolution procedure. The test rule is based on OASIS
|
||||
* 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 {
|
||||
|
||||
@Test(dataProvider = "publicId-systemId-matchedUri")
|
||||
|
@ -50,7 +53,7 @@ public class PreferTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "publicId-systemId-matchedUri")
|
||||
private Object[][] data() {
|
||||
public Object[][] data() {
|
||||
return new Object[][] {
|
||||
// The prefer attribute is public. Both of the specified public
|
||||
// id and system id have matches in the catalog file. But
|
||||
|
@ -89,3 +92,4 @@ public class PreferTest {
|
|||
return catalogResolver("prefer.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.CatalogResolver;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* It tests the resolution priorities among the public family entries.
|
||||
* The test rule is based on OASIS 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 PublicFamilyTest {
|
||||
|
||||
/*
|
||||
|
@ -67,3 +70,4 @@ public class PublicFamilyTest {
|
|||
return catalogResolver("publicFamily.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class PublicTest {
|
||||
|
||||
@Test(dataProvider = "publicId-matchedUri")
|
||||
|
@ -89,3 +92,4 @@ public class PublicTest {
|
|||
return catalogResolver(CATALOG_PUBLIC);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.CatalogUriResolver;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* resolution.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class ResolveFeatureTest {
|
||||
|
||||
/*
|
||||
|
@ -128,3 +131,4 @@ public class ResolveFeatureTest {
|
|||
return builder().with(Feature.RESOLVE, resolve).build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class RewriteSystemTest {
|
||||
|
||||
@Test(dataProvider = "systemId-matchedUri")
|
||||
|
@ -92,3 +95,4 @@ public class RewriteSystemTest {
|
|||
return catalogResolver("rewriteSystem.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class RewriteUriTest {
|
||||
|
||||
@Test(dataProvider = "uri-matchedUri")
|
||||
|
@ -92,3 +95,4 @@ public class RewriteUriTest {
|
|||
return catalogUriResolver("rewriteUri.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,6 +23,8 @@
|
|||
|
||||
package catalog;
|
||||
|
||||
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
|
||||
|
||||
import static catalog.CatalogTestUtils.FEATURE_FILES;
|
||||
import static catalog.CatalogTestUtils.catalogResolver;
|
||||
import static catalog.CatalogTestUtils.catalogUriResolver;
|
||||
|
@ -36,15 +38,18 @@ import javax.xml.catalog.CatalogFeatures;
|
|||
import javax.xml.catalog.CatalogResolver;
|
||||
import javax.xml.catalog.CatalogUriResolver;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class SpecifyCatalogTest {
|
||||
|
||||
private static final String ID_URI = "http://remote/dtd/uri/doc.dtd";
|
||||
|
@ -76,7 +81,7 @@ public class SpecifyCatalogTest {
|
|||
*/
|
||||
@Test
|
||||
public void specifyCatalogViaSysProps() {
|
||||
System.setProperty(FEATURE_FILES,
|
||||
setSystemProperty(FEATURE_FILES,
|
||||
getCatalogPath("specifyCatalog-sysProps.xml"));
|
||||
|
||||
checkResolutionOnEntityResolver(catalogResolver((String[]) null),
|
||||
|
@ -106,3 +111,4 @@ public class SpecifyCatalogTest {
|
|||
return builder().with(FILES, getCatalogPath(catalogName)).build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* delegateSystem entries. It tests the resolution priorities among
|
||||
* the system family entries. The test rule is based on OASIS
|
||||
* 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 {
|
||||
|
||||
@Test(dataProvider = "systemId-matchedUri")
|
||||
|
@ -81,3 +84,4 @@ public class SystemFamilyTest {
|
|||
return catalogResolver("systemFamily.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class SystemSuffixTest {
|
||||
|
||||
@Test(dataProvider = "systemId-matchedUri")
|
||||
|
@ -92,3 +95,4 @@ public class SystemSuffixTest {
|
|||
return catalogResolver("systemSuffix.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class SystemTest {
|
||||
|
||||
@Test(dataProvider = "systemId-matchedUri")
|
||||
|
@ -89,3 +92,4 @@ public class SystemTest {
|
|||
return catalogResolver(CATALOG_SYSTEM);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* entries. It tests the resolution priorities among the uri family
|
||||
* entries. The test rule is based on OASIS Standard V1.1 section
|
||||
* 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 {
|
||||
|
||||
@Test(dataProvider = "uri-matchedUri")
|
||||
|
@ -81,3 +84,4 @@ public class UriFamilyTest {
|
|||
return catalogUriResolver("uriFamily.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class UriSuffixTest {
|
||||
|
||||
@Test(dataProvider = "uri-matchedUri")
|
||||
|
@ -92,3 +95,4 @@ public class UriSuffixTest {
|
|||
return catalogUriResolver("uriSuffix.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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.
|
||||
* @compile ../../libs/catalog/CatalogTestUtils.java
|
||||
* @compile ../../libs/catalog/ResolutionChecker.java
|
||||
*/
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class UriTest {
|
||||
|
||||
@Test(dataProvider = "uri-matchedUri")
|
||||
|
@ -101,3 +104,4 @@ public class UriTest {
|
|||
return catalogUriResolver(CATALOG_URI);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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:",
|
||||
* it has to be regarded as URN and normalized. And then the catalog
|
||||
* 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 {
|
||||
|
||||
@Test(dataProvider = "urn-matchedUri")
|
||||
|
@ -48,7 +51,7 @@ public class UrnUnwrappingTest {
|
|||
}
|
||||
|
||||
@DataProvider(name = "urn-matchedUri")
|
||||
private Object[][] data() {
|
||||
public Object[][] data() {
|
||||
return new Object[][] {
|
||||
// The specified public id is URN format.
|
||||
{ "urn:publicid:-:REMOTE:DTD+ALICE+DOCALICE+XML:EN",
|
||||
|
@ -64,3 +67,4 @@ public class UrnUnwrappingTest {
|
|||
return catalogResolver("urnUnwrapping.xml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
* must be catalog, and the naming space of the root element must be
|
||||
* 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 {
|
||||
|
||||
private static final String CATALOG_WRONGROOT = "validateCatalog-wrongRoot.xml";
|
||||
|
@ -99,3 +102,4 @@ public class ValidateCatalogTest {
|
|||
"http://local/dtd/docAliceURI.dtd");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.namespace.QName;
|
||||
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
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.
|
||||
*/
|
||||
public class DurationTest extends JAXPBaseTest {
|
||||
@Listeners({jaxp.library.BasePolicy.class})
|
||||
public class DurationTest {
|
||||
|
||||
private DatatypeFactory datatypeFactory;
|
||||
|
||||
|
@ -583,3 +587,4 @@ public class DurationTest extends JAXPBaseTest {
|
|||
private final BigInteger one = BigInteger.ONE;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 jaxp.library.JAXPDataProvider;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
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)
|
||||
*/
|
||||
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";
|
||||
|
||||
|
@ -72,3 +77,4 @@ public class FactoryNewInstanceTest extends JAXPBaseTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.XMLGregorianCalendar;
|
||||
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
*/
|
||||
public class XMLGregorianCalendarTest extends JAXPBaseTest {
|
||||
@Listeners({jaxp.library.BasePolicy.class})
|
||||
public class XMLGregorianCalendarTest {
|
||||
|
||||
private DatatypeFactory datatypeFactory;
|
||||
|
||||
|
@ -354,3 +358,4 @@ public class XMLGregorianCalendarTest extends JAXPBaseTest {
|
|||
private final int undef = DatatypeConstants.FIELD_UNDEFINED;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,18 +23,21 @@
|
|||
|
||||
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.compareWithGold;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
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.dom.DOMSource;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
|
@ -42,7 +45,14 @@ import org.w3c.dom.Document;
|
|||
* This tests DocumentBuilderFactory for namespace processing and no-namespace
|
||||
* 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.
|
||||
|
@ -95,3 +105,5 @@ public class DBFNamespaceTest extends JAXPFileBaseTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FilePermission;
|
||||
import java.io.FileReader;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
|
@ -55,9 +54,9 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.sax.SAXResult;
|
||||
|
||||
import jaxp.library.JAXPDataProvider;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@ -70,7 +69,14 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
* @bug 8080907
|
||||
* 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.
|
||||
*/
|
||||
|
@ -419,8 +425,6 @@ public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
|
|||
@Test
|
||||
public void testCheckDocumentBuilderFactory13() throws Exception {
|
||||
// Accesing default working directory.
|
||||
String workingDir = getSystemProperty("user.dir");
|
||||
setPermissions(new FilePermission(workingDir + "/*", "read"));
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
|
||||
Document doc = docBuilder.parse(new File(XML_DIR + "dbf10import.xsl")
|
||||
|
@ -436,8 +440,6 @@ public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
|
|||
@Test(expectedExceptions = SAXException.class)
|
||||
public void testCheckDocumentBuilderFactory14() throws Exception {
|
||||
// Accesing default working directory.
|
||||
String workingDir = getSystemProperty("user.dir");
|
||||
setPermissions(new FilePermission(workingDir, "read"));
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
|
||||
docBuilder.parse("");
|
||||
|
@ -529,3 +531,5 @@ public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
|
|||
assertTrue(compareWithGold(goldFile, outputFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,18 +23,21 @@
|
|||
|
||||
package javax.xml.parsers.ptests;
|
||||
|
||||
import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
|
||||
import static jaxp.library.JAXPTestUtilities.FILE_SEP;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FilePermission;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
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.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -42,8 +45,14 @@ import org.xml.sax.InputSource;
|
|||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@ -82,7 +91,7 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
|
|||
* @param docBuilder document builder instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider")
|
||||
@Test(dataProvider = "builder-provider")
|
||||
public void testCheckDocumentBuilderImpl04(DocumentBuilder docBuilder)
|
||||
throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(new File(XML_DIR,
|
||||
|
@ -97,7 +106,7 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
|
|||
* @param docBuilder document builder instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider")
|
||||
@Test(dataProvider = "builder-provider")
|
||||
public void testCheckDocumentBuilderImpl05(DocumentBuilder docBuilder)
|
||||
throws Exception {
|
||||
assertNotNull(docBuilder.parse(new File(XML_DIR,
|
||||
|
@ -109,11 +118,9 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
|
|||
* @param docBuilder document builder instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider")
|
||||
@Test(dataProvider = "builder-provider")
|
||||
public void testCheckDocumentBuilderImpl06(DocumentBuilder docBuilder)
|
||||
throws Exception {
|
||||
setPermissions(new FilePermission(XML_DIR + "../-",
|
||||
"read"));
|
||||
try (FileInputStream fis = new FileInputStream(new File(XML_DIR,
|
||||
"DocumentBuilderImpl02.xml"))) {
|
||||
assertNotNull(docBuilder.parse(fis, new File(XML_DIR).toURI()
|
||||
|
@ -150,3 +157,5 @@ public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,20 +23,30 @@
|
|||
|
||||
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.FactoryConfigurationError;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.annotations.AfterTest;
|
||||
import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* Class containing the test cases for SAXParserFactory/DocumentBuilderFactory
|
||||
* 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
|
||||
|
@ -54,8 +64,8 @@ public class FactoryConfErrorTest extends JAXPBaseTest {
|
|||
*/
|
||||
@AfterTest
|
||||
public void cleanup() {
|
||||
setSystemProperty("javax.xml.parsers.DocumentBuilderFactory", null);
|
||||
setSystemProperty("javax.xml.parsers.SAXParserFactory", null);
|
||||
clearSystemProperty("javax.xml.parsers.DocumentBuilderFactory");
|
||||
clearSystemProperty("javax.xml.parsers.SAXParserFactory");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,3 +86,5 @@ public class FactoryConfErrorTest extends JAXPBaseTest {
|
|||
DocumentBuilderFactory.newInstance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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 jaxp.library.JAXPDataProvider;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
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)
|
||||
*/
|
||||
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";
|
||||
|
||||
|
@ -73,3 +78,5 @@ public class SAXFactoryNewInstanceTest extends JAXPBaseTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -24,14 +24,23 @@
|
|||
package javax.xml.parsers.ptests;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* 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 NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes";
|
||||
|
@ -220,3 +229,5 @@ public class SAXParserFactTest extends JAXPBaseTest {
|
|||
assertFalse(spf.getFeature(EXTERNAL_P_ENTITIES));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,15 +23,23 @@
|
|||
|
||||
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.FileInputStream;
|
||||
import java.io.FilePermission;
|
||||
import java.io.IOException;
|
||||
import java.util.PropertyPermission;
|
||||
|
||||
import javax.xml.parsers.SAXParser;
|
||||
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.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.xml.sax.HandlerBase;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -41,7 +49,14 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@ -92,13 +107,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
@Test(expectedExceptions = { SAXException.class },
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse03(SAXParser saxparser) throws Exception {
|
||||
String workingDir = getSystemProperty("user.dir");
|
||||
setPermissions(new FilePermission(workingDir, "read"));
|
||||
try {
|
||||
saxparser.parse("", new HandlerBase());
|
||||
} finally {
|
||||
setPermissions();
|
||||
}
|
||||
saxparser.parse("", new HandlerBase());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,13 +133,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
*/
|
||||
@Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
|
||||
public void testParse05(SAXParser saxparser) throws Exception {
|
||||
String workingDir = getSystemProperty("user.dir");
|
||||
setPermissions(new FilePermission(workingDir, "read"));
|
||||
try {
|
||||
saxparser.parse(new File(""), new HandlerBase());
|
||||
} finally {
|
||||
setPermissions();
|
||||
}
|
||||
tryRunWithTmpPermission(() -> saxparser.parse(new File(""), new HandlerBase()), new PropertyPermission("user.dir", "read"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -176,23 +179,18 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Test with non-existence URI, parsing should fail and throw
|
||||
* SAXException or IOException.
|
||||
* Test with non-existence URI, parsing should fail and throw SAXException
|
||||
* or IOException.
|
||||
*
|
||||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
* @param saxparser
|
||||
* a SAXParser instance.
|
||||
* @throws Exception
|
||||
* If any errors occur.
|
||||
*/
|
||||
@Test(expectedExceptions = { SAXException.class, IOException.class },
|
||||
dataProvider = "parser-provider")
|
||||
@Test(expectedExceptions = { SAXException.class, IOException.class }, dataProvider = "parser-provider")
|
||||
public void testParse09(SAXParser saxparser) throws Exception {
|
||||
String workingDir = getSystemProperty("user.dir");
|
||||
setPermissions(new FilePermission(workingDir + "/../-", "read"));
|
||||
String uri = " ";
|
||||
try {
|
||||
saxparser.parse(uri, new DefaultHandler());
|
||||
} finally {
|
||||
setPermissions();
|
||||
}
|
||||
JAXPTestUtilities.tryRunWithTmpPermission(() -> saxparser.parse(" ", new DefaultHandler()),
|
||||
new FilePermission(USER_DIR + " ", "read"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -204,14 +202,8 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
*/
|
||||
@Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
|
||||
public void testParse10(SAXParser saxparser) throws Exception {
|
||||
String workingDir = getSystemProperty("user.dir");
|
||||
setPermissions(new FilePermission(workingDir, "read"));
|
||||
File file = new File("");
|
||||
try {
|
||||
saxparser.parse(file, new DefaultHandler());
|
||||
} finally {
|
||||
setPermissions();
|
||||
}
|
||||
tryRunWithTmpPermission(() -> saxparser.parse(file, new DefaultHandler()), new PropertyPermission("user.dir", "read"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,7 +240,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
|
||||
@Test(expectedExceptions = SAXException.class,
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse13(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(new File(
|
||||
|
@ -263,7 +255,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse14(SAXParser saxparser) throws Exception {
|
||||
saxparser.parse(new File(XML_DIR, "parsertest.xml"),
|
||||
new HandlerBase());
|
||||
|
@ -276,7 +268,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse15(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
|
||||
"correct.xml"))) {
|
||||
|
@ -291,7 +283,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse16(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(
|
||||
new File(XML_DIR, "parsertest.xml"))) {
|
||||
|
@ -306,7 +298,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse17(SAXParser saxparser) throws Exception {
|
||||
File file = new File(XML_DIR, "correct.xml");
|
||||
saxparser.parse(file.toURI().toASCIIString(), new HandlerBase());
|
||||
|
@ -319,7 +311,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
|
||||
@Test(expectedExceptions = SAXException.class,
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse18(SAXParser saxparser) throws Exception {
|
||||
saxparser.parse(new File(XML_DIR, "valid.xml"), new HandlerBase());
|
||||
|
@ -332,7 +324,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse19(SAXParser saxparser) throws Exception {
|
||||
saxparser.parse(new File(XML_DIR, "correct.xml"), new HandlerBase());
|
||||
}
|
||||
|
@ -344,7 +336,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
|
||||
@Test(expectedExceptions = SAXException.class,
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse20(SAXParser saxparser) throws Exception {
|
||||
try(FileInputStream instream = new FileInputStream(new File(XML_DIR,
|
||||
|
@ -360,7 +352,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse21(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
|
||||
"correct.xml"))) {
|
||||
|
@ -375,7 +367,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
|
||||
@Test(expectedExceptions = SAXException.class,
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse22(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(
|
||||
|
@ -391,7 +383,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse23(SAXParser saxparser) throws Exception {
|
||||
DefaultHandler handler = new DefaultHandler();
|
||||
saxparser.parse(new File(XML_DIR, "parsertest.xml"), handler);
|
||||
|
@ -404,7 +396,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse24(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
|
||||
"correct.xml"))) {
|
||||
|
@ -420,7 +412,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse25(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(
|
||||
new File(XML_DIR, "parsertest.xml"))) {
|
||||
|
@ -435,7 +427,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse26(SAXParser saxparser) throws Exception {
|
||||
File file = new File(XML_DIR, "correct.xml");
|
||||
saxparser.parse(file.toURI().toASCIIString(), new DefaultHandler());
|
||||
|
@ -448,7 +440,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
|
||||
@Test(expectedExceptions = SAXException.class,
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse27(SAXParser saxparser) throws Exception {
|
||||
saxparser.parse(new File(XML_DIR, "valid.xml"), new DefaultHandler());
|
||||
|
@ -461,7 +453,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse28(SAXParser saxparser) throws Exception {
|
||||
saxparser.parse(new File(XML_DIR, "correct.xml"), new DefaultHandler());
|
||||
}
|
||||
|
@ -472,7 +464,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
|
||||
@Test(expectedExceptions = SAXException.class,
|
||||
dataProvider = "parser-provider")
|
||||
public void testParse29(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(
|
||||
|
@ -487,7 +479,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @param saxparser a SAXParser instance.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
|
||||
@Test(dataProvider = "parser-provider")
|
||||
public void testParse30(SAXParser saxparser) throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(
|
||||
new File(XML_DIR, "correct.xml"))) {
|
||||
|
@ -500,7 +492,7 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void testParse31() throws Exception {
|
||||
try (FileInputStream instream = new FileInputStream(
|
||||
new File(XML_DIR, "ns4.xml"))) {
|
||||
|
@ -510,3 +502,5 @@ public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -24,13 +24,15 @@
|
|||
package javax.xml.parsers.ptests;
|
||||
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertNull;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXNotSupportedException;
|
||||
|
@ -40,7 +42,14 @@ import org.xml.sax.ext.LexicalHandler;
|
|||
/**
|
||||
* 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 XML_STRING = "http://xml.org/sax/properties/xml-string";
|
||||
private static final String DECL_HANDLER = "http://xml.org/sax/properties/declaration-handler";
|
||||
|
@ -260,3 +269,5 @@ public class SAXParserTest02 extends JAXPBaseTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,25 +23,32 @@
|
|||
|
||||
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.assertTrue;
|
||||
import static org.testng.Assert.fail;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilePermission;
|
||||
|
||||
import javax.xml.parsers.SAXParser;
|
||||
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.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
@ -63,7 +70,7 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
|
|||
* @param handler an error handler for capturing events.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "input-provider")
|
||||
@Test(dataProvider = "input-provider")
|
||||
public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler)
|
||||
throws Exception {
|
||||
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.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "input-provider")
|
||||
@Test(dataProvider = "input-provider")
|
||||
public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler)
|
||||
throws Exception {
|
||||
spf.setNamespaceAware(true);
|
||||
|
@ -95,7 +102,7 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
|
|||
* @param handler an error handler for capturing events.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"}, dataProvider = "input-provider")
|
||||
@Test(dataProvider = "input-provider")
|
||||
public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler)
|
||||
throws Exception {
|
||||
try {
|
||||
|
@ -109,3 +116,5 @@ public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,20 +23,28 @@
|
|||
|
||||
package javax.xml.stream.ptests;
|
||||
|
||||
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
|
||||
import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
|
||||
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import javax.xml.stream.XMLEventFactory;
|
||||
|
||||
import jaxp.library.JAXPDataProvider;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
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)
|
||||
*/
|
||||
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_FACRORY_ID = "javax.xml.stream.XMLEventFactory";
|
||||
|
@ -59,7 +67,7 @@ public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
|
|||
XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader);
|
||||
assertNotNull(xef);
|
||||
} finally {
|
||||
setSystemProperty(XMLEVENT_FACRORY_ID, null);
|
||||
clearSystemProperty(XMLEVENT_FACRORY_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,3 +82,4 @@ public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,20 +23,28 @@
|
|||
|
||||
package javax.xml.stream.ptests;
|
||||
|
||||
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
|
||||
import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
|
||||
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
|
||||
import jaxp.library.JAXPDataProvider;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
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)
|
||||
*/
|
||||
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_FACRORY_ID = "javax.xml.stream.XMLInputFactory";
|
||||
|
@ -59,7 +67,7 @@ public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest {
|
|||
XMLInputFactory xif = XMLInputFactory.newFactory(factoryId, classLoader);
|
||||
assertNotNull(xif);
|
||||
} finally {
|
||||
setSystemProperty(XMLINPUT_FACRORY_ID, null);
|
||||
clearSystemProperty(XMLINPUT_FACRORY_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,3 +82,4 @@ public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,6 +23,8 @@
|
|||
|
||||
package javax.xml.transform.ptests;
|
||||
|
||||
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
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.StreamSource;
|
||||
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
*/
|
||||
public class Bug6384418Test extends JAXPFileBaseTest {
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class Bug6384418Test {
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
|
@ -62,3 +67,5 @@ public class Bug6384418Test extends JAXPFileBaseTest {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,20 +23,23 @@
|
|||
|
||||
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.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.compareWithGold;
|
||||
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.w3c.dom.Attr;
|
||||
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
|
||||
* 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.
|
||||
* @throws Exception If any errors occur.
|
||||
|
@ -108,3 +118,5 @@ public class DOMResultTest extends JAXPFileBaseTest {
|
|||
writeNodes(kids.item(i), bWriter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,23 +23,32 @@
|
|||
|
||||
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.FilePermission;
|
||||
|
||||
import javax.xml.transform.ErrorListener;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.fail;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -60,7 +69,6 @@ public class ErrorListenerTest extends JAXPBaseTest implements ErrorListener {
|
|||
try {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
tfactory.setErrorListener (listener);
|
||||
setPermissions(new FilePermission(XML_DIR + "invalid.xsl", "read"));
|
||||
tfactory.newTransformer(new StreamSource(
|
||||
new File(XML_DIR + "invalid.xsl")));
|
||||
fail("Expect TransformerConfigurationException here");
|
||||
|
@ -96,3 +104,5 @@ public class ErrorListenerTest extends JAXPBaseTest implements ErrorListener {
|
|||
this.status = ListenerStatus.FATAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,18 +23,21 @@
|
|||
|
||||
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 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.assertNotNull;
|
||||
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.xml.sax.InputSource;
|
||||
|
||||
|
@ -42,7 +45,14 @@ import org.xml.sax.InputSource;
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -53,7 +63,7 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws IOException reading file error.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void source2inputsource01() throws IOException {
|
||||
try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
|
||||
StreamSource streamSource = new StreamSource(fis);
|
||||
|
@ -68,7 +78,7 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void source2inputsource02() throws Exception {
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true);
|
||||
|
@ -83,7 +93,7 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws IOException reading file error.
|
||||
*/
|
||||
@Test(groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void source2inputsource03() throws IOException {
|
||||
String SYSTEM_ID = "file:///" + XML_DIR;
|
||||
try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
|
||||
|
@ -95,3 +105,5 @@ public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -23,27 +23,30 @@
|
|||
|
||||
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.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
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.SAXTransformerFactory;
|
||||
import javax.xml.transform.sax.TemplatesHandler;
|
||||
import javax.xml.transform.sax.TransformerHandler;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
import static jaxp.library.JAXPTestUtilities.USER_DIR;
|
||||
import static jaxp.library.JAXPTestUtilities.compareWithGold;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -56,7 +59,14 @@ import org.xml.sax.helpers.XMLReaderFactory;
|
|||
* Test newTransformerhandler() method which takes StreamSource as argument can
|
||||
* 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.
|
||||
*/
|
||||
|
@ -421,3 +431,5 @@ public class SAXTFactoryTest extends JAXPFileBaseTest {
|
|||
assertTrue(compareWithGold(goldFile, outputFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,11 +22,16 @@
|
|||
*/
|
||||
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.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
@ -34,12 +39,10 @@ import javax.xml.transform.Transformer;
|
|||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
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.StreamSource;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
import static jaxp.library.JAXPTestUtilities.USER_DIR;
|
||||
import static jaxp.library.JAXPTestUtilities.failUnexpected;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
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
|
||||
* 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.
|
||||
*/
|
||||
|
@ -96,3 +106,5 @@ public class StreamResultTest extends JAXPFileBaseTest {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,20 +22,23 @@
|
|||
*/
|
||||
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.FileInputStream;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
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.stream.StreamSource;
|
||||
import jaxp.library.JAXPFileReadOnlyBaseTest;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -44,7 +47,14 @@ import org.xml.sax.InputSource;
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -128,7 +138,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @throws TransformerConfigurationException If for some reason the
|
||||
* TransformerHandler can not be created.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void clear05() throws TransformerConfigurationException {
|
||||
Transformer transformer = TransformerFactory.newInstance().
|
||||
newTransformer(new StreamSource(new File(XSL_FILE)));
|
||||
|
@ -143,7 +153,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @throws TransformerConfigurationException If for some reason the
|
||||
* TransformerHandler can not be created.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void clear06() throws TransformerConfigurationException {
|
||||
Transformer transformer = TransformerFactory.newInstance().
|
||||
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.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void clear07() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XSL_FILE)) {
|
||||
SAXSource saxSource = new SAXSource();
|
||||
|
@ -174,7 +184,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
|
|||
* the a name that wasn't set before. Null is expected.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void clear08() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XSL_FILE)) {
|
||||
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.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void clear09() throws Exception {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
||||
|
@ -213,7 +223,7 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
|
|||
* the a name that wasn't set before. Null is expected.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void clear10() throws Exception {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
||||
|
@ -229,3 +239,5 @@ public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
|
|||
assertNull(transformer.getParameter(LONG_PARAM_NAME));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.stream.XMLEventWriter;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
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.StreamSource;
|
||||
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.Attributes;
|
||||
|
@ -71,10 +69,15 @@ import org.xml.sax.Locator;
|
|||
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)
|
||||
*/
|
||||
@Test(singleThreaded = true)
|
||||
public class TransformTest extends JAXPFileBaseTest {
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class TransformTest {
|
||||
|
||||
/*
|
||||
* Initialize the share objects.
|
||||
|
@ -381,3 +384,5 @@ public class TransformTest extends JAXPFileBaseTest {
|
|||
private Document xmlDoc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,32 +22,40 @@
|
|||
*/
|
||||
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 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.assertNotNull;
|
||||
import static org.testng.Assert.assertNull;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Test
|
||||
public void tfexception() {
|
||||
try {
|
||||
setPermissions(new FilePermission(XML_DIR + "-", "read"));
|
||||
// invalid.xsl has well-formedness error. Therefore transform throws
|
||||
// TransformerException
|
||||
StreamSource streamSource
|
||||
|
@ -63,8 +71,6 @@ public class TransformerExcpTest extends JAXPBaseTest {
|
|||
assertNotNull(e.getException());
|
||||
assertNull(e.getLocationAsString());
|
||||
assertEquals(e.getMessageAndLocation(),e.getMessage());
|
||||
} finally {
|
||||
setPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,3 +105,5 @@ public class TransformerExcpTest extends JAXPBaseTest {
|
|||
assertNotNull(te.initCause(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,33 +22,45 @@
|
|||
*/
|
||||
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.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.compareWithGold;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
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.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.*;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/**
|
||||
* Class containing the test cases for TransformerFactory API's
|
||||
* 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.
|
||||
*/
|
||||
|
@ -129,3 +141,5 @@ public class TransformerFactoryTest extends JAXPFileBaseTest {
|
|||
assertTrue(compareWithGold(goldFile, outputFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,9 +22,15 @@
|
|||
*/
|
||||
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.FileInputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.ErrorListener;
|
||||
|
@ -33,13 +39,10 @@ import javax.xml.transform.TransformerConfigurationException;
|
|||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
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.stream.StreamSource;
|
||||
import jaxp.library.JAXPFileReadOnlyBaseTest;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -47,7 +50,14 @@ import org.xml.sax.InputSource;
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -58,7 +68,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
|
|||
* @throws TransformerConfigurationException If for some reason the
|
||||
* TransformerHandler can not be created.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void transformer01() throws TransformerConfigurationException {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
StreamSource streamSource = new StreamSource(
|
||||
|
@ -71,7 +81,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
|
|||
* This tests if newTransformer(SAXSource) method returns Transformer.
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void transformer02() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(TEST_XSL)) {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
@ -86,7 +96,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void transformer03() throws Exception {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
||||
|
@ -105,7 +115,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void transformer04() throws Exception {
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true);
|
||||
|
@ -125,7 +135,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void transformer05() throws Exception {
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true);
|
||||
|
@ -150,7 +160,7 @@ public class TransformerTest extends JAXPFileReadOnlyBaseTest {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public void transformer06() throws Exception {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
||||
|
@ -197,3 +207,5 @@ class MyErrorListener implements ErrorListener {
|
|||
System.out.println(" In fatal");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,21 +22,24 @@
|
|||
*/
|
||||
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.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
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.StreamSource;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
import static jaxp.library.JAXPTestUtilities.USER_DIR;
|
||||
import static jaxp.library.JAXPTestUtilities.compareWithGold;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
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
|
||||
* 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).
|
||||
*
|
||||
|
@ -75,3 +85,5 @@ public class TransformerTest02 extends JAXPFileBaseTest {
|
|||
assertTrue(compareWithGold(goldFile, outputFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,22 +22,25 @@
|
|||
*/
|
||||
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.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
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.StreamSource;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
import static jaxp.library.JAXPTestUtilities.USER_DIR;
|
||||
import static jaxp.library.JAXPTestUtilities.compareWithGold;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
|
@ -46,7 +49,14 @@ import org.testng.annotations.Test;
|
|||
* for transformer. Then transform(StreamSource, StreamResult) is used for
|
||||
* 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.
|
||||
*
|
||||
|
@ -84,3 +94,5 @@ public class TransformerTest03 extends JAXPFileBaseTest {
|
|||
assertTrue(compareWithGold(goldFile, outputFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,8 +22,13 @@
|
|||
*/
|
||||
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.FileInputStream;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.Source;
|
||||
|
@ -31,13 +36,11 @@ import javax.xml.transform.Transformer;
|
|||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.URIResolver;
|
||||
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.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -45,7 +48,14 @@ import org.xml.sax.InputSource;
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -115,7 +125,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void resolver01() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)) {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
@ -134,7 +144,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void resolver02() throws Exception {
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
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.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void resolver03() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)){
|
||||
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.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void resolver04() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)) {
|
||||
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.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void resolver05() throws Exception {
|
||||
URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
|
||||
TransformerFactory tfactory = TransformerFactory.newInstance();
|
||||
|
@ -211,7 +221,7 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
|
|||
*
|
||||
* @throws Exception If any errors occur.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void resolver06() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)){
|
||||
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.
|
||||
*/
|
||||
@Test (groups = {"readLocalFiles"})
|
||||
@Test
|
||||
public static void docResolver01() throws Exception {
|
||||
try (FileInputStream fis = new FileInputStream(XML_DIR + "doctest.xsl")) {
|
||||
URIResolverTest resolver = new URIResolverTest("temp/colors.xml", SYSTEM_ID);
|
||||
|
@ -252,3 +262,5 @@ public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -22,15 +22,27 @@
|
|||
*/
|
||||
package javax.xml.transform.ptests.othervm;
|
||||
|
||||
import javax.xml.transform.*;
|
||||
import jaxp.library.JAXPBaseTest;
|
||||
import static jaxp.library.JAXPTestUtilities.setSystemProperty;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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)
|
||||
public void tfce01() throws Exception {
|
||||
try{
|
||||
|
@ -42,3 +54,5 @@ public class TFCErrorTest extends JAXPBaseTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
|
@ -64,10 +65,15 @@ import org.xml.sax.SAXNotSupportedException;
|
|||
import org.xml.sax.SAXParseException;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @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
|
||||
*/
|
||||
@Test(singleThreaded = true)
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class SchemaFactoryTest {
|
||||
|
||||
@BeforeClass
|
||||
|
@ -398,3 +404,4 @@ public class SchemaFactoryTest {
|
|||
private Document xsdDoc2;
|
||||
private byte[] xml;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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.ValidatorHandler;
|
||||
|
||||
import jaxp.library.JAXPFileBaseTest;
|
||||
|
||||
import org.testng.annotations.Listeners;
|
||||
import org.testng.annotations.Test;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -49,9 +48,14 @@ import org.xml.sax.XMLReader;
|
|||
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()
|
||||
*/
|
||||
public class TypeInfoProviderTest extends JAXPFileBaseTest {
|
||||
@Listeners({jaxp.library.FilePolicy.class})
|
||||
public class TypeInfoProviderTest {
|
||||
|
||||
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
Loading…
Add table
Add a link
Reference in a new issue