diff --git a/.hgtags b/.hgtags
index f011034848d..aaf78d35e9c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -282,3 +282,6 @@ a137992d750c72f6f944f341aa19b0d0d96afe0c jdk9-b35
b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37
948cceef81ba4cb34bc233e7cc5952951ff04e88 jdk9-b38
4e7c4d692e934cb9023af8201e7c2b510e9c4ee1 jdk9-b39
+82f4cb44b2d7af2352f48568a64b7b6a5ae960cd jdk9-b40
+9fffb959eb4197ff806e4ac12244761815b4deee jdk9-b41
+3107be2ba9c6e208a0b86bc7100a141abbc5b5fb jdk9-b42
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index a5f58b034a6..9cbf0f90d4e 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -282,3 +282,6 @@ c173ba994245380fb11ef077d1e59823386840eb jdk9-b35
723a67b0c442391447b1d8aad8b249d06d1032e8 jdk9-b37
d42c0a90afc3c66ca87543076ec9aafd4b4680de jdk9-b38
512dbbeb1730edcebfec873fc3f1455660b32000 jdk9-b39
+cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
+67395f7ca2db3b52e3a62a84888487de5cb9210a jdk9-b41
+f7c11da0b0481d49cc7a65a453336c108191e821 jdk9-b42
diff --git a/Makefile b/Makefile
index d4b36e4539d..1eff79b2194 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ default:
# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
# /usr/ccs/bin/make lacks basically every other flow control mechanism.
-TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
+.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
# Assume we have GNU make, but check version.
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
@@ -46,7 +46,17 @@ ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
else
makefile_path:=$(lastword $(MAKEFILE_LIST))
endif
-root_dir:=$(dir $(makefile_path))
+root_dir:=$(patsubst %/,%,$(dir $(makefile_path)))
+
+ifneq ($(findstring qp,$(MAKEFLAGS)),)
+ # When called with -qp, assume an external part (e.g. bash completion) is trying
+ # to understand our targets.
+ # Duplication of global targets, needed before ParseConfAndSpec in case we have
+ # no configurations.
+ help:
+ # If CONF is not set, look for all available configurations
+ CONF?=
+endif
# ... and then we can include our helper functions
include $(root_dir)/make/MakeHelpers.gmk
@@ -89,6 +99,7 @@ else
# The wrapper target was called so we now have a single configuration. Load the spec file
# and call the real Main.gmk.
include $(SPEC)
+ include $(SRC_ROOT)/make/common/MakeBase.gmk
### Clean up from previous run
# Remove any build.log from a previous run, if they exist
@@ -143,31 +154,37 @@ help:
$(info . make [default] # Compile all modules in langtools, hotspot, jaxp, jaxws,)
$(info . # corba and jdk and create a runnable "exploded" image)
$(info . make all # Compile everything, all repos, docs and images)
- $(info . make images # Create complete j2sdk and j2re images)
+ $(info . make images # Create complete jdk and jre images)
+ $(info . make # Compile the specified phase and everything it depends on)
+ $(info . # (gensrc, java, copy, libs, launchers, gendata, rmic))
+ $(info . make *-only # Applies to most targets and disables compling the)
+ $(info . # dependencies for the target. This is faster but may)
+ $(info . # result in incorrect build results!)
$(info . make docs # Create all docs)
$(info . make docs-javadoc # Create just javadocs, depends on less than full docs)
- $(info . make profiles # Create complete j2re compact profile images)
+ $(info . make profiles # Create complete jre compact profile images)
$(info . make bootcycle-images # Build images twice, second time with newly built JDK)
$(info . make install # Install the generated images locally)
$(info . make reconfigure # Rerun configure with the same arguments as last time)
- $(info . make clean # Remove all files generated by make, but not those)
- $(info . # generated by configure)
- $(info . make dist-clean # Remove all files, including configuration)
$(info . make help # Give some help on using make)
$(info . make test # Run tests, default is all tests (see TEST below))
$(info )
+ $(info Targets for cleaning)
+ $(info . make clean # Remove all files generated by make, but not those)
+ $(info . # generated by configure)
+ $(info . make dist-clean # Remove all files, including configuration)
+ $(info . make clean- # Remove the subdir in the output dir with the name)
+ $(info . make clean- # Remove all build results related to a certain build)
+ $(info . # phase (gensrc, java, libs, launchers))
+ $(info . make clean- # Remove all build results related to a certain module)
+ $(info . make clean-- # Remove all build results related to a certain)
+ $(info . # module and phase)
+ $(info )
$(info Targets for specific modules)
$(info . make # Build and everything it depends on. )
- $(info . make -only # Build only, without dependencies. This)
- $(info . # is faster but can result in incorrect build results!)
- $(info . make -java # Compile java classes for and everything it)
- $(info . # depends on)
- $(info . make -libs # Build native libraries for and everything it)
- $(info . # depends on)
- $(info . make -launchers# Build native executables for and everything it)
- $(info . # depends on)
- $(info . make -gensrc # Execute the gensrc step for and everything it)
- $(info . # depends on)
+ $(info . make - # Compile the specified phase for the specified module)
+ $(info . # and everything it depends on)
+ $(info . # (gensrc, java, copy, libs, launchers, gendata, rmic))
$(info )
$(info Useful make variables)
$(info . make CONF= # Build all configurations (note, assignment is empty))
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index c175085d30d..62d83574289 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -69,7 +69,7 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
# This will make sure the given variable points to a full and proper
# path. This means:
-# 1) There will be no spaces in the path. On posix platforms,
+# 1) There will be no spaces in the path. On unix platforms,
# spaces in the path will result in an error. On Windows,
# the path will be rewritten using short-style to be space-free.
# 2) The path will be absolute, and it will be in unix-style (on
@@ -82,7 +82,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
BASIC_FIXUP_PATH_MSYS($1)
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="[$]$1"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -102,7 +102,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
# This will make sure the given variable points to a executable
# with a full and proper path. This means:
-# 1) There will be no spaces in the path. On posix platforms,
+# 1) There will be no spaces in the path. On unix platforms,
# spaces in the path will result in an error. On Windows,
# the path will be rewritten using short-style to be space-free.
# 2) The path will be absolute, and it will be in unix-style (on
@@ -118,7 +118,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
BASIC_FIXUP_EXECUTABLE_MSYS($1)
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="[$]$1"
@@ -268,7 +268,7 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
fi
])
-# Setup a tool for the given variable. If correctly specified by the user,
+# Setup a tool for the given variable. If correctly specified by the user,
# use that value, otherwise search for the tool using the supplied code snippet.
# $1: variable to set
# $2: code snippet to call to look for the tool
@@ -546,7 +546,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
XCODEBUILD=
AC_SUBST(XCODEBUILD)
fi
-
+
AC_MSG_CHECKING([for sdk name])
AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
[use the platform SDK of the given name. @<:@macosx@:>@])],
diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4
index fbfa15c7b06..c0f0c07b4c8 100644
--- a/common/autoconf/boot-jdk.m4
+++ b/common/autoconf/boot-jdk.m4
@@ -24,31 +24,31 @@
#
########################################################################
-# This file handles detection of the Boot JDK. The Boot JDK detection
-# process has been developed as a response to solve a complex real-world
-# problem. Initially, it was simple, but it has grown as platform after
+# This file handles detection of the Boot JDK. The Boot JDK detection
+# process has been developed as a response to solve a complex real-world
+# problem. Initially, it was simple, but it has grown as platform after
# platform, idiosyncracy after idiosyncracy has been supported.
#
# The basic idea is this:
# 1) You need an acceptable *) JDK to use as a Boot JDK
-# 2) There are several ways to locate a JDK, that are mostly platform
+# 2) There are several ways to locate a JDK, that are mostly platform
# dependent **)
# 3) You can have multiple JDKs installed
-# 4) If possible, configure should try to dig out an acceptable JDK
+# 4) If possible, configure should try to dig out an acceptable JDK
# automatically, without having to resort to command-line options
#
-# *) acceptable means e.g. JDK7 for building JDK8, a complete JDK (with
-# javac) and not a JRE, etc.
+# *) acceptable means e.g. JDK7 for building JDK8, a complete JDK (with
+# javac) and not a JRE, etc.
#
-# **) On Windows we typically use a well-known path.
+# **) On Windows we typically use a well-known path.
# On MacOSX we typically use the tool java_home.
-# On Linux we typically find javac in the $PATH, and then follow a
-# chain of symlinks that often ends up in a real JDK.
+# On Linux we typically find javac in the $PATH, and then follow a
+# chain of symlinks that often ends up in a real JDK.
#
-# This leads to the code where we check in different ways to locate a
-# JDK, and if one is found, check if it is acceptable. If not, we print
-# our reasons for rejecting it (useful when debugging non-working
-# configure situations) and continue checking the next one.
+# This leads to the code where we check in different ways to locate a
+# JDK, and if one is found, check if it is acceptable. If not, we print
+# our reasons for rejecting it (useful when debugging non-working
+# configure situations) and continue checking the next one.
########################################################################
# Execute the check given as argument, and verify the result
@@ -73,31 +73,25 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
AC_MSG_NOTICE([(This might be an JRE instead of an JDK)])
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring])
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ [FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`]
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
+ AC_MSG_NOTICE([(Your Boot JDK must be version 8 or 9)])
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- [FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`]
- if test "x$FOUND_CORRECT_VERSION" = x; then
- AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
- AC_MSG_NOTICE([(Your Boot JDK must be version 8 or 9)])
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
- BASIC_FIXUP_PATH(BOOT_JDK)
- AC_MSG_CHECKING([for Boot JDK])
- AC_MSG_RESULT([$BOOT_JDK])
- AC_MSG_CHECKING([Boot JDK version])
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- AC_MSG_RESULT([$BOOT_JDK_VERSION])
- fi # end check jdk version
- fi # end check rt.jar
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
+ BASIC_FIXUP_PATH(BOOT_JDK)
+ AC_MSG_CHECKING([for Boot JDK])
+ AC_MSG_RESULT([$BOOT_JDK])
+ AC_MSG_CHECKING([Boot JDK version])
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ AC_MSG_RESULT([$BOOT_JDK_VERSION])
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -244,7 +238,7 @@ AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS],
AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK],
[
# Use user overridden value if available, otherwise locate tool in the Boot JDK.
- BASIC_SETUP_TOOL($1,
+ BASIC_SETUP_TOOL($1,
[
AC_MSG_CHECKING([for $2 in Boot JDK])
$1=$BOOT_JDK/bin/$2
@@ -305,20 +299,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
AC_MSG_ERROR([Cannot continue])
fi
- # Setup proper paths for what we found
- BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
- if test ! -f "$BOOT_RTJAR"; then
- # On MacOSX it is called classes.jar
- BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
- if test -f "$BOOT_RTJAR"; then
- # Remove the ..
- BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
- fi
- fi
- BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
- BOOT_JDK="$BOOT_JDK"
- AC_SUBST(BOOT_RTJAR)
- AC_SUBST(BOOT_TOOLSJAR)
AC_SUBST(BOOT_JDK)
# Setup tools from the Boot JDK.
diff --git a/common/autoconf/bootcycle-spec.gmk.in b/common/autoconf/bootcycle-spec.gmk.in
index 87e6203fc88..a547f34c951 100644
--- a/common/autoconf/bootcycle-spec.gmk.in
+++ b/common/autoconf/bootcycle-spec.gmk.in
@@ -42,13 +42,12 @@ endif
# Override specific values to do a boot cycle build
+# Use a different Boot JDK
+BOOT_JDK := $(JDK_IMAGE_DIR)
+
# The bootcycle build has a different output directory
BUILD_OUTPUT:=@BUILD_OUTPUT@/bootcycle-build
-
-# Use a different Boot JDK
-OLD_BOOT_JDK:=$(BOOT_JDK)
-BOOT_JDK:=@BUILD_OUTPUT@/images/j2sdk-image
-BOOT_RTJAR:=$(BOOT_JDK)/jre/lib/rt.jar
+SJAVAC_SERVER_DIR:=$(subst @BUILD_OUTPUT@,$(BUILD_OUTPUT),$(SJAVAC_SERVER_DIR))
JAVA_CMD:=$(BOOT_JDK)/bin/java
JAVAC_CMD:=$(BOOT_JDK)/bin/javac
@@ -57,4 +56,3 @@ JAR_CMD:=$(BOOT_JDK)/bin/jar
NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
-
diff --git a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess
index 355c91e4ebb..a450a2760f6 100644
--- a/common/autoconf/build-aux/config.guess
+++ b/common/autoconf/build-aux/config.guess
@@ -77,7 +77,7 @@ if test $? = 0; then
fi
# Test and fix little endian PowerPC64.
-# TODO: should be handled by autoconf-config.guess.
+# TODO: should be handled by autoconf-config.guess.
if [ "x$OUT" = x ]; then
if [ `uname -m` = ppc64le ]; then
if [ `uname -s` = Linux ]; then
diff --git a/common/autoconf/build-aux/install.sh b/common/autoconf/build-aux/install.sh
index 02d43282e42..98c1dc444a7 100644
--- a/common/autoconf/build-aux/install.sh
+++ b/common/autoconf/build-aux/install.sh
@@ -1,5 +1,5 @@
-#!/bin/sh
-echo >&2 "No suitable 'install' command found.'"
-echo >&2 "If automake is installed, running 'automake -fa'"
-echo >&2 "(and ignoring the errors) might produce one."
-exit 1
+#!/bin/sh
+echo >&2 "No suitable 'install' command found.'"
+echo >&2 "If automake is installed, running 'automake -fa'"
+echo >&2 "(and ignoring the errors) might produce one."
+exit 1
diff --git a/common/autoconf/compare.sh.in b/common/autoconf/compare.sh.in
index 4c6207176c5..244a6ebbab3 100644
--- a/common/autoconf/compare.sh.in
+++ b/common/autoconf/compare.sh.in
@@ -46,7 +46,9 @@ FILE="@FILE@"
FIND="@FIND@"
GREP="@GREP@"
JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
+JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage"
LDD="@LDD@"
+LN="@LN@"
MKDIR="@MKDIR@"
NAWK="@NAWK@"
NM="@GNM@"
diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac
index 481d328a1c4..146556f479e 100644
--- a/common/autoconf/configure.ac
+++ b/common/autoconf/configure.ac
@@ -275,3 +275,4 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
# Finally output some useful information to the user
HELP_PRINT_SUMMARY_AND_WARNINGS
CUSTOM_SUMMARY_AND_WARNINGS_HOOK
+HELP_REPEAT_WARNINGS
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index cd2d4a38eaa..b4bbfe476c3 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -94,9 +94,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
# On Windows, we need to set RC flags.
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- RC_FLAGS="-nologo -l 0x409 -r"
+ RC_FLAGS="-nologo -l0x409"
if test "x$VARIANT" = xOPT; then
- RC_FLAGS="$RC_FLAGS -d NDEBUG"
+ RC_FLAGS="$RC_FLAGS -DNDEBUG"
fi
# The version variables used to create RC_FLAGS may be overridden
@@ -105,13 +105,13 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
# The \$ are escaped to the shell, and the $(...) variables
# are evaluated by make.
RC_FLAGS="$RC_FLAGS \
- -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
- -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
- -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
- -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
- -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
- -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
- -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
+ -D\"JDK_BUILD_ID=\$(FULL_VERSION)\" \
+ -D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
+ -D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
+ -D\"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
+ -D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
+ -D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
+ -D\"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
fi
AC_SUBST(RC_FLAGS)
@@ -348,10 +348,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
# Add runtime stack smashing and undefined behavior checks
CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
CXXFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
- if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
- CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
- CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIsOR_FLAG"
- fi
;;
esac
fi
@@ -668,7 +664,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-I${JDK_TOPDIR}/src/java.base/share/native/include \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \
- -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_API_DIR/native/include"
+ -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include"
# The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
@@ -746,25 +742,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
fi
- if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
- # If undefined behaviour detection is enabled then we need to tell linker.
- case $DEBUG_LEVEL in
- release | fastdebug )
- ;;
- slowdebug )
- AC_MSG_WARN([$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR])
- if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
- # enable undefined behaviour checking
- LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
- LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
- fi
- ;;
- * )
- AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
- ;;
- esac
- fi
-
# Customize LDFLAGS for executables
LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
@@ -784,24 +761,24 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
LDFLAGS_JDKLIB_SUFFIX=""
else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS} \
- -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
+ -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
# On some platforms (mac) the linker warns about non existing -L dirs.
# Add server first if available. Linking aginst client does not always produce the same results.
# Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
# Default to server for other variants.
if test "x$JVM_VARIANT_SERVER" = xtrue; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/client"
elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
else
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
fi
LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index ee4a8945ede..0b1567ce0ce 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -820,8 +820,6 @@ JAVAH
JAVAC
JAVA
BOOT_JDK
-BOOT_TOOLSJAR
-BOOT_RTJAR
JAVA_CHECK
JAVAC_CHECK
COOKED_BUILD_NUMBER
@@ -908,7 +906,6 @@ ZERO_ARCHDEF
DEFINE_CROSS_COMPILE_ARCH
LP64
OPENJDK_TARGET_OS_EXPORT_DIR
-OPENJDK_TARGET_OS_API_DIR
OPENJDK_TARGET_CPU_JLI_CFLAGS
OPENJDK_TARGET_CPU_OSARCH
OPENJDK_TARGET_CPU_ISADIR
@@ -923,14 +920,14 @@ OPENJDK_TARGET_CPU_BITS
OPENJDK_TARGET_CPU_ARCH
OPENJDK_TARGET_CPU
OPENJDK_TARGET_OS_ENV
-OPENJDK_TARGET_OS_API
+OPENJDK_TARGET_OS_TYPE
OPENJDK_TARGET_OS
OPENJDK_BUILD_CPU_ENDIAN
OPENJDK_BUILD_CPU_BITS
OPENJDK_BUILD_CPU_ARCH
OPENJDK_BUILD_CPU
OPENJDK_BUILD_OS_ENV
-OPENJDK_BUILD_OS_API
+OPENJDK_BUILD_OS_TYPE
OPENJDK_BUILD_OS
OPENJDK_BUILD_AUTOCONF_NAME
OPENJDK_TARGET_AUTOCONF_NAME
@@ -1065,6 +1062,7 @@ with_milestone
with_update_version
with_user_release_suffix
with_build_number
+with_copyright_year
with_boot_jdk
with_add_source_root
with_override_source_root
@@ -1906,6 +1904,7 @@ Optional Packages:
Add a custom string to the version string if build
number is not set.[username_builddateb00]
--with-build-number Set build number value for build [b00]
+ --with-copyright-year Set copyright year value for build [current year]
--with-boot-jdk path to Boot JDK (used to bootstrap build) [probed]
--with-add-source-root for each and every source directory, look in this
additional source root for the same directory; if it
@@ -3412,7 +3411,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# This will make sure the given variable points to a full and proper
# path. This means:
-# 1) There will be no spaces in the path. On posix platforms,
+# 1) There will be no spaces in the path. On unix platforms,
# spaces in the path will result in an error. On Windows,
# the path will be rewritten using short-style to be space-free.
# 2) The path will be absolute, and it will be in unix-style (on
@@ -3422,7 +3421,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# This will make sure the given variable points to a executable
# with a full and proper path. This means:
-# 1) There will be no spaces in the path. On posix platforms,
+# 1) There will be no spaces in the path. On unix platforms,
# spaces in the path will result in an error. On Windows,
# the path will be rewritten using short-style to be space-free.
# 2) The path will be absolute, and it will be in unix-style (on
@@ -3970,6 +3969,8 @@ pkgadd_help() {
+
+
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4099,7 +4100,7 @@ pkgadd_help() {
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
# Converts autoconf style OS name to OpenJDK style, into
-# VAR_OS and VAR_OS_API.
+# VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
# Expects $host_os $host_cpu $build_os and $build_cpu
@@ -4328,7 +4329,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1415179461
+DATE_WHEN_GENERATED=1418036274
###############################################################################
#
@@ -13525,38 +13526,31 @@ test -n "$target_alias" &&
case "$build_os" in
*linux*)
VAR_OS=linux
- VAR_OS_API=posix
- VAR_OS_ENV=linux
+ VAR_OS_TYPE=unix
;;
*solaris*)
VAR_OS=solaris
- VAR_OS_API=posix
- VAR_OS_ENV=solaris
+ VAR_OS_TYPE=unix
;;
*darwin*)
VAR_OS=macosx
- VAR_OS_API=posix
- VAR_OS_ENV=macosx
+ VAR_OS_TYPE=unix
;;
*bsd*)
VAR_OS=bsd
- VAR_OS_API=posix
- VAR_OS_ENV=bsd
+ VAR_OS_TYPE=unix
;;
*cygwin*)
VAR_OS=windows
- VAR_OS_API=winapi
VAR_OS_ENV=windows.cygwin
;;
*mingw*)
VAR_OS=windows
- VAR_OS_API=winapi
VAR_OS_ENV=windows.msys
;;
*aix*)
VAR_OS=aix
- VAR_OS_API=posix
- VAR_OS_ENV=aix
+ VAR_OS_TYPE=unix
;;
*)
as_fn_error $? "unsupported operating system $build_os" "$LINENO" 5
@@ -13633,8 +13627,16 @@ test -n "$target_alias" &&
# ..and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_BUILD_OS="$VAR_OS"
- OPENJDK_BUILD_OS_API="$VAR_OS_API"
- OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
+ if test "x$VAR_OS_TYPE" != x; then
+ OPENJDK_BUILD_OS_TYPE="$VAR_OS_TYPE"
+ else
+ OPENJDK_BUILD_OS_TYPE="$VAR_OS"
+ fi
+ if test "x$VAR_OS_ENV" != x; then
+ OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
+ else
+ OPENJDK_BUILD_OS_ENV="$VAR_OS"
+ fi
OPENJDK_BUILD_CPU="$VAR_CPU"
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
@@ -13657,38 +13659,31 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
case "$host_os" in
*linux*)
VAR_OS=linux
- VAR_OS_API=posix
- VAR_OS_ENV=linux
+ VAR_OS_TYPE=unix
;;
*solaris*)
VAR_OS=solaris
- VAR_OS_API=posix
- VAR_OS_ENV=solaris
+ VAR_OS_TYPE=unix
;;
*darwin*)
VAR_OS=macosx
- VAR_OS_API=posix
- VAR_OS_ENV=macosx
+ VAR_OS_TYPE=unix
;;
*bsd*)
VAR_OS=bsd
- VAR_OS_API=posix
- VAR_OS_ENV=bsd
+ VAR_OS_TYPE=unix
;;
*cygwin*)
VAR_OS=windows
- VAR_OS_API=winapi
VAR_OS_ENV=windows.cygwin
;;
*mingw*)
VAR_OS=windows
- VAR_OS_API=winapi
VAR_OS_ENV=windows.msys
;;
*aix*)
VAR_OS=aix
- VAR_OS_API=posix
- VAR_OS_ENV=aix
+ VAR_OS_TYPE=unix
;;
*)
as_fn_error $? "unsupported operating system $host_os" "$LINENO" 5
@@ -13765,8 +13760,16 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
# ... and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_TARGET_OS="$VAR_OS"
- OPENJDK_TARGET_OS_API="$VAR_OS_API"
- OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
+ if test "x$VAR_OS_TYPE" != x; then
+ OPENJDK_TARGET_OS_TYPE="$VAR_OS_TYPE"
+ else
+ OPENJDK_TARGET_OS_TYPE="$VAR_OS"
+ fi
+ if test "x$VAR_OS_ENV" != x; then
+ OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
+ else
+ OPENJDK_TARGET_OS_ENV="$VAR_OS"
+ fi
OPENJDK_TARGET_CPU="$VAR_CPU"
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
@@ -13934,19 +13937,10 @@ $as_echo "$COMPILE_TYPE" >&6; }
fi
- # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
- if test "x$OPENJDK_TARGET_OS_API" = xposix; then
- OPENJDK_TARGET_OS_API_DIR="unix"
- fi
- if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then
- OPENJDK_TARGET_OS_API_DIR="windows"
- fi
-
-
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
OPENJDK_TARGET_OS_EXPORT_DIR=macosx
else
- OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR}
+ OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_TYPE}
fi
@@ -14196,7 +14190,7 @@ $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$CURDIR"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -14318,7 +14312,7 @@ $as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$TOPDIR"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -14838,7 +14832,7 @@ $as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$with_devkit"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -15312,7 +15306,7 @@ $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$OUTPUT_ROOT"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -15679,7 +15673,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$FOUND_MAKE"
@@ -16052,7 +16046,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$FOUND_MAKE"
@@ -16422,7 +16416,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$FOUND_MAKE"
@@ -16797,7 +16791,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$FOUND_MAKE"
@@ -17166,7 +17160,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$FOUND_MAKE"
@@ -20134,7 +20128,19 @@ fi
- COPYRIGHT_YEAR=`date +'%Y'`
+
+# Check whether --with-copyright-year was given.
+if test "${with_copyright_year+set}" = set; then :
+ withval=$with_copyright_year;
+fi
+
+ if test "x$with_copyright_year" = xyes; then
+ as_fn_error $? "Copyright year must have a value" "$LINENO" 5
+ elif test "x$with_copyright_year" != x; then
+ COPYRIGHT_YEAR="$with_copyright_year"
+ else
+ COPYRIGHT_YEAR=`date +'%Y'`
+ fi
if test "x$JDK_UPDATE_VERSION" != x; then
@@ -20197,26 +20203,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -20321,7 +20321,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -20339,17 +20339,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -20529,26 +20528,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -20653,7 +20646,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -20671,17 +20664,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -20723,26 +20715,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -20847,7 +20833,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -20865,17 +20851,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -20910,26 +20895,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -21034,7 +21013,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -21052,17 +21031,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -21096,26 +21074,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -21220,7 +21192,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -21238,17 +21210,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -21282,26 +21253,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -21406,7 +21371,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -21424,17 +21389,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -21459,26 +21423,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -21583,7 +21541,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -21601,17 +21559,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -21729,7 +21686,7 @@ $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$JAVA_HOME_PROCESSED"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -21777,26 +21734,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -21901,7 +21852,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -21919,17 +21870,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -22105,26 +22055,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -22229,7 +22173,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -22247,17 +22191,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -22320,26 +22263,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -22444,7 +22381,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -22462,17 +22399,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -22500,26 +22436,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -22624,7 +22554,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -22642,17 +22572,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -22708,26 +22637,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -22832,7 +22755,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -22850,17 +22773,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -22888,26 +22810,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -23012,7 +22928,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -23030,17 +22946,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -23096,26 +23011,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -23220,7 +23129,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -23238,17 +23147,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -23276,26 +23184,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -23400,7 +23302,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -23418,17 +23320,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -23484,26 +23385,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -23608,7 +23503,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -23626,17 +23521,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -23664,26 +23558,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -23788,7 +23676,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -23806,17 +23694,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -23859,26 +23746,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -23983,7 +23864,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -24001,17 +23882,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -24037,26 +23917,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -24161,7 +24035,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -24179,17 +24053,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -24233,26 +24106,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -24357,7 +24224,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -24375,17 +24242,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -24411,26 +24277,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -24535,7 +24395,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -24553,17 +24413,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -24606,26 +24465,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -24730,7 +24583,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -24748,17 +24601,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -24784,26 +24636,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -24908,7 +24754,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -24926,17 +24772,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -24980,26 +24825,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -25104,7 +24943,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -25122,17 +24961,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -25158,26 +24996,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -25282,7 +25114,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -25300,17 +25132,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -25335,26 +25166,20 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java
$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
BOOT_JDK_FOUND=no
else
- # Do we have an rt.jar? (On MacOSX it is called classes.jar)
- if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
+ # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+ # Extra M4 quote needed to protect [] in grep expression.
+ FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
+ if test "x$FOUND_CORRECT_VERSION" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
- # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
- # Extra M4 quote needed to protect [] in grep expression.
- FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
- if test "x$FOUND_CORRECT_VERSION" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
- BOOT_JDK_FOUND=no
- else
- # We're done! :-)
- BOOT_JDK_FOUND=yes
+ # We're done! :-)
+ BOOT_JDK_FOUND=yes
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -25459,7 +25284,7 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$BOOT_JDK"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -25477,17 +25302,16 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
$as_echo_n "checking for Boot JDK... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
$as_echo "$BOOT_JDK" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
$as_echo_n "checking Boot JDK version... " >&6; }
- BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+ BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
$as_echo "$BOOT_JDK_VERSION" >&6; }
- fi # end check jdk version
- fi # end check rt.jar
+ fi # end check jdk version
fi # end check javac
fi # end check java
fi # end check boot jdk found
@@ -25533,20 +25357,6 @@ $as_echo "$as_me: This might be fixed by explicitely setting --with-boot-jdk" >&
as_fn_error $? "Cannot continue" "$LINENO" 5
fi
- # Setup proper paths for what we found
- BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
- if test ! -f "$BOOT_RTJAR"; then
- # On MacOSX it is called classes.jar
- BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
- if test -f "$BOOT_RTJAR"; then
- # Remove the ..
- BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
- fi
- fi
- BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
- BOOT_JDK="$BOOT_JDK"
-
-
# Setup tools from the Boot JDK.
@@ -27500,7 +27310,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$VS_ENV_CMD"
@@ -28160,7 +27970,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$CC"
@@ -28617,7 +28427,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$PROPER_COMPILER_CC"
@@ -29900,7 +29710,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$CXX"
@@ -30357,7 +30167,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$PROPER_COMPILER_CXX"
@@ -31219,7 +31029,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$CPP"
@@ -31634,7 +31444,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$CXXCPP"
@@ -31978,7 +31788,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$LD"
@@ -32473,7 +32283,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$AS"
@@ -33101,7 +32911,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$AR"
@@ -33637,7 +33447,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$OBJC"
@@ -34105,7 +33915,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$LIPO"
@@ -34446,7 +34256,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$MT"
@@ -34783,7 +34593,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$RC"
@@ -35102,7 +34912,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$DUMPBIN"
@@ -35617,7 +35427,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$STRIP"
@@ -36085,7 +35895,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$NM"
@@ -36553,7 +36363,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$GNM"
@@ -37022,7 +36832,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$MCS"
@@ -37602,7 +37412,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$STRIP"
@@ -38180,7 +37990,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$NM"
@@ -38767,7 +38577,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$OBJCOPY"
@@ -39351,7 +39161,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$OBJDUMP"
@@ -39844,7 +39654,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$BUILD_CC"
@@ -40312,7 +40122,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$BUILD_CXX"
@@ -40780,7 +40590,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh
fi
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first
# space.
complete="$BUILD_LD"
@@ -41009,74 +40819,6 @@ $as_echo "$supports" >&6; }
fi
- # "-fsanitize=undefined" supported for GCC 4.9 and later
- CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG\"" >&5
-$as_echo_n "checking if compiler supports \"$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG\"... " >&6; }
- supports=yes
-
- saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
- 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"
-
- saved_cxxflags="$CXXFLAGS"
- CXXFLAGS="$CXXFLAG $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
- 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
- HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true
- else
- HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false
- fi
-
-
# "-z relro" supported in GNU binutils 2.17 and later
LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
@@ -41332,7 +41074,7 @@ $as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$JT_HOME"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -41633,9 +41375,9 @@ $as_echo "$tool_specified" >&6; }
# On Windows, we need to set RC flags.
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- RC_FLAGS="-nologo -l 0x409 -r"
+ RC_FLAGS="-nologo -l0x409"
if test "x$VARIANT" = xOPT; then
- RC_FLAGS="$RC_FLAGS -d NDEBUG"
+ RC_FLAGS="$RC_FLAGS -DNDEBUG"
fi
# The version variables used to create RC_FLAGS may be overridden
@@ -41644,13 +41386,13 @@ $as_echo "$tool_specified" >&6; }
# The \$ are escaped to the shell, and the $(...) variables
# are evaluated by make.
RC_FLAGS="$RC_FLAGS \
- -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
- -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
- -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
- -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
- -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
- -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
- -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
+ -D\"JDK_BUILD_ID=\$(FULL_VERSION)\" \
+ -D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
+ -D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
+ -D\"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
+ -D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
+ -D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
+ -D\"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
fi
@@ -41860,8 +41602,8 @@ done
LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
elif test "x$COMPILE_TYPE" = xreduced; then
- if test "x$OPENJDK_TARGET_OS" != xwindows; then
- # Specify -m if running reduced on other Posix platforms
+ if test "x$OPENJDK_TARGET_OS_TYPE" = xunix; then
+ # Specify -m if running reduced on unix platforms
# When we add flags to the "official" CFLAGS etc, we need to
# keep track of these additions in ADDED_CFLAGS etc. These
@@ -42420,10 +42162,6 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
# Add runtime stack smashing and undefined behavior checks
CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
CXXFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
- if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
- CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
- CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIsOR_FLAG"
- fi
;;
esac
fi
@@ -42753,7 +42491,7 @@ fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-I${JDK_TOPDIR}/src/java.base/share/native/include \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \
- -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_API_DIR/native/include"
+ -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include"
# The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
@@ -42831,26 +42569,6 @@ fi
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
fi
- if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
- # If undefined behaviour detection is enabled then we need to tell linker.
- case $DEBUG_LEVEL in
- release | fastdebug )
- ;;
- slowdebug )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&5
-$as_echo "$as_me: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&2;}
- if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
- # enable undefined behaviour checking
- LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/ *\(^ \+\)/ -Xlinker \1/g"`"
- LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/ *\(^ \+\)/ -Xlinker \1/g"`"
- fi
- ;;
- * )
- as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
- ;;
- esac
- fi
-
# Customize LDFLAGS for executables
LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
@@ -42870,24 +42588,24 @@ $as_echo "$as_me: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&2;}
LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
LDFLAGS_JDKLIB_SUFFIX=""
else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS} \
- -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
+ -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
# On some platforms (mac) the linker warns about non existing -L dirs.
# Add server first if available. Linking aginst client does not always produce the same results.
# Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
# Default to server for other variants.
if test "x$JVM_VARIANT_SERVER" = xtrue; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/client"
elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
else
- LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
fi
LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
@@ -44739,7 +44457,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -44861,7 +44579,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -45092,7 +44810,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -45214,7 +44932,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -45706,7 +45424,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -45828,7 +45546,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46034,7 +45752,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46156,7 +45874,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46353,7 +46071,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46475,7 +46193,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46672,7 +46390,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46794,7 +46512,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -46992,7 +46710,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -47114,7 +46832,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -47313,7 +47031,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -47435,7 +47153,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -47630,7 +47348,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -47752,7 +47470,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -47947,7 +47665,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -48069,7 +47787,7 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$POTENTIAL_FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -48247,7 +47965,7 @@ $as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$FREETYPE_INCLUDE_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -48377,7 +48095,7 @@ $as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$FREETYPE_LIB_PATH"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -50276,7 +49994,7 @@ $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;}
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
else
- # We're on a posix platform. Hooray! :)
+ # We're on a unix platform. Hooray! :)
path="$MSVCR_DLL"
has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then
@@ -52421,15 +52139,15 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
printf "====================================================\n"
if test "x$no_create" != "xyes"; then
if test "x$IS_RECONFIGURE" != "xyes"; then
- printf "A new configuration has been successfully created in\n %s\n" "$OUTPUT_ROOT"
+ printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT"
else
- printf "The existing configuration has been successfully updated in\n %s\n" "$OUTPUT_ROOT"
+ printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT"
fi
else
if test "x$IS_RECONFIGURE" != "xyes"; then
printf "A configuration has been successfully checked but not created\n"
else
- printf "The existing configuration has been successfully checked in\n %s\n" "$OUTPUT_ROOT"
+ printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT"
fi
fi
if test "x$CONFIGURE_COMMAND_LINE" != x; then
@@ -52501,3 +52219,15 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
fi
+
+if test -e "$OUTPUT_ROOT/config.log"; then
+ $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
+ if test $? -eq 0; then
+ printf "The following warnings were produced. Repeated here for convenience:\n"
+ # We must quote sed expression (using []) to stop m4 from eating the [].
+ $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e 's/^configure:[0-9]*: //'
+ printf "\n"
+ fi
+fi
+
+
diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4
index 90882332a9d..9e7fb73d9ef 100644
--- a/common/autoconf/help.m4
+++ b/common/autoconf/help.m4
@@ -178,15 +178,15 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
printf "====================================================\n"
if test "x$no_create" != "xyes"; then
if test "x$IS_RECONFIGURE" != "xyes"; then
- printf "A new configuration has been successfully created in\n %s\n" "$OUTPUT_ROOT"
+ printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT"
else
- printf "The existing configuration has been successfully updated in\n %s\n" "$OUTPUT_ROOT"
+ printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT"
fi
else
if test "x$IS_RECONFIGURE" != "xyes"; then
printf "A configuration has been successfully checked but not created\n"
else
- printf "The existing configuration has been successfully checked in\n %s\n" "$OUTPUT_ROOT"
+ printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT"
fi
fi
if test "x$CONFIGURE_COMMAND_LINE" != x; then
@@ -257,3 +257,17 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
printf "\n"
fi
])
+
+AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
+[
+if test -e "$OUTPUT_ROOT/config.log"; then
+ $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
+ if test $? -eq 0; then
+ printf "The following warnings were produced. Repeated here for convenience:\n"
+ # We must quote sed expression (using []) to stop m4 from eating the [].
+ $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
+ printf "\n"
+ fi
+fi
+
+])
diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
index 3f0165e52b5..39239fa80d8 100644
--- a/common/autoconf/jdk-options.m4
+++ b/common/autoconf/jdk-options.m4
@@ -549,7 +549,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
- COPYRIGHT_YEAR=`date +'%Y'`
+ AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
+ [Set copyright year value for build @<:@current year@:>@])])
+ if test "x$with_copyright_year" = xyes; then
+ AC_MSG_ERROR([Copyright year must have a value])
+ elif test "x$with_copyright_year" != x; then
+ COPYRIGHT_YEAR="$with_copyright_year"
+ else
+ COPYRIGHT_YEAR=`date +'%Y'`
+ fi
AC_SUBST(COPYRIGHT_YEAR)
if test "x$JDK_UPDATE_VERSION" != x; then
diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4
index 41cb2fb49d6..8d4e73488bc 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -355,7 +355,7 @@ AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
FOUND_FREETYPE=no
fi
fi
-
+
if test "x$FOUND_FREETYPE" = xyes; then
# Include file found, let's continue the sanity check.
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 4eacb397cbe..27db8d047eb 100644
--- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4
@@ -98,44 +98,37 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
# Converts autoconf style OS name to OpenJDK style, into
-# VAR_OS and VAR_OS_API.
+# VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
[
case "$1" in
*linux*)
VAR_OS=linux
- VAR_OS_API=posix
- VAR_OS_ENV=linux
+ VAR_OS_TYPE=unix
;;
*solaris*)
VAR_OS=solaris
- VAR_OS_API=posix
- VAR_OS_ENV=solaris
+ VAR_OS_TYPE=unix
;;
*darwin*)
VAR_OS=macosx
- VAR_OS_API=posix
- VAR_OS_ENV=macosx
+ VAR_OS_TYPE=unix
;;
*bsd*)
VAR_OS=bsd
- VAR_OS_API=posix
- VAR_OS_ENV=bsd
+ VAR_OS_TYPE=unix
;;
*cygwin*)
VAR_OS=windows
- VAR_OS_API=winapi
VAR_OS_ENV=windows.cygwin
;;
*mingw*)
VAR_OS=windows
- VAR_OS_API=winapi
VAR_OS_ENV=windows.msys
;;
*aix*)
VAR_OS=aix
- VAR_OS_API=posix
- VAR_OS_ENV=aix
+ VAR_OS_TYPE=unix
;;
*)
AC_MSG_ERROR([unsupported operating system $1])
@@ -165,14 +158,22 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
# ..and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_BUILD_OS="$VAR_OS"
- OPENJDK_BUILD_OS_API="$VAR_OS_API"
- OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
+ if test "x$VAR_OS_TYPE" != x; then
+ OPENJDK_BUILD_OS_TYPE="$VAR_OS_TYPE"
+ else
+ OPENJDK_BUILD_OS_TYPE="$VAR_OS"
+ fi
+ if test "x$VAR_OS_ENV" != x; then
+ OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
+ else
+ OPENJDK_BUILD_OS_ENV="$VAR_OS"
+ fi
OPENJDK_BUILD_CPU="$VAR_CPU"
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST(OPENJDK_BUILD_OS)
- AC_SUBST(OPENJDK_BUILD_OS_API)
+ AC_SUBST(OPENJDK_BUILD_OS_TYPE)
AC_SUBST(OPENJDK_BUILD_OS_ENV)
AC_SUBST(OPENJDK_BUILD_CPU)
AC_SUBST(OPENJDK_BUILD_CPU_ARCH)
@@ -187,14 +188,22 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
# ... and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_TARGET_OS="$VAR_OS"
- OPENJDK_TARGET_OS_API="$VAR_OS_API"
- OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
+ if test "x$VAR_OS_TYPE" != x; then
+ OPENJDK_TARGET_OS_TYPE="$VAR_OS_TYPE"
+ else
+ OPENJDK_TARGET_OS_TYPE="$VAR_OS"
+ fi
+ if test "x$VAR_OS_ENV" != x; then
+ OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
+ else
+ OPENJDK_TARGET_OS_ENV="$VAR_OS"
+ fi
OPENJDK_TARGET_CPU="$VAR_CPU"
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST(OPENJDK_TARGET_OS)
- AC_SUBST(OPENJDK_TARGET_OS_API)
+ AC_SUBST(OPENJDK_TARGET_OS_TYPE)
AC_SUBST(OPENJDK_TARGET_OS_ENV)
AC_SUBST(OPENJDK_TARGET_CPU)
AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
@@ -331,19 +340,10 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
fi
AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS)
- # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
- if test "x$OPENJDK_TARGET_OS_API" = xposix; then
- OPENJDK_TARGET_OS_API_DIR="unix"
- fi
- if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then
- OPENJDK_TARGET_OS_API_DIR="windows"
- fi
- AC_SUBST(OPENJDK_TARGET_OS_API_DIR)
-
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
OPENJDK_TARGET_OS_EXPORT_DIR=macosx
else
- OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR}
+ OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_TYPE}
fi
AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR)
@@ -472,8 +472,8 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
# And -q on AIX because otherwise the compiler produces 32-bit objects by default
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
elif test "x$COMPILE_TYPE" = xreduced; then
- if test "x$OPENJDK_TARGET_OS" != xwindows; then
- # Specify -m if running reduced on other Posix platforms
+ if test "x$OPENJDK_TARGET_OS_TYPE" = xunix; then
+ # Specify -m if running reduced on unix platforms
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
fi
fi
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index e5b43ecdafb..60d70886925 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -36,6 +36,7 @@
X:=
SPACE:=$(X) $(X)
COMMA:=,
+DOLLAR:=$$
HASH:=\#
LEFT_PAREN:=(
RIGHT_PAREN:=)
@@ -82,7 +83,7 @@ CONF_NAME:=@CONF_NAME@
# The built jdk will run in this target system.
OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
-OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@
+OPENJDK_TARGET_OS_TYPE:=@OPENJDK_TARGET_OS_TYPE@
OPENJDK_TARGET_OS_ENV:=@OPENJDK_TARGET_OS_ENV@
OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
@@ -99,13 +100,12 @@ OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@
-OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@
OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@
# We are building on this build system.
# When not cross-compiling, it is the same as the target.
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
-OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@
+OPENJDK_BUILD_OS_TYPE:=@OPENJDK_BUILD_OS_TYPE@
OPENJDK_BUILD_OS_ENV:=@OPENJDK_BUILD_OS_ENV@
OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@
@@ -236,31 +236,23 @@ BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
BUILD_OUTPUT:=@BUILD_OUTPUT@
# Colon left out to be able to override IMAGES_OUTPUTDIR for bootcycle-images
-LANGTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/langtools
-CORBA_OUTPUTDIR=$(BUILD_OUTPUT)/corba
-JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
-JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
+SUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/support
+BUILDTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/buildtools
+MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/makesupport
+
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
-NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/testmake
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
-LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
-CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
-JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
-JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
HOTSPOT_DIST=@HOTSPOT_DIST@
-NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
BUILD_HOTSPOT=@BUILD_HOTSPOT@
-# The boot jdk to use. These are overridden in bootcycle-spec.gmk. Make sure to keep
-# them in sync.
+# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
+# it in sync.
BOOT_JDK:=@BOOT_JDK@
-BOOT_RTJAR:=@BOOT_RTJAR@
-BOOT_TOOLSJAR=$(BOOT_JDK)/lib/tools.jar
# When compiling Java source to be run by the boot jdk
# use these extra flags, eg -source 6 -target 6
@@ -351,7 +343,7 @@ OBJC:=@CCACHE@ @OBJC@
CPP:=@FIXPATH@ @CPP@
#CPPFLAGS:=@CPPFLAGS@
-# The linker can be gcc or ld on posix systems, or link.exe on windows systems.
+# The linker can be gcc or ld on unix systems, or link.exe on windows systems.
LD:=@FIXPATH@ @LD@
# Xcode SDK path
@@ -392,7 +384,7 @@ BUILD_LD:=@FIXPATH@ @BUILD_LD@
AS:=@FIXPATH@ @AS@
-# AR is used to create a static library (is ar in posix, lib.exe in windows)
+# AR is used to create a static library (is ar in unix, lib.exe in windows)
AR:=@FIXPATH@ @AR@
ARFLAGS:=@ARFLAGS@
@@ -456,7 +448,7 @@ JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
-# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
+# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
# for bootcycle-images build. Make sure to keep them in sync. Do not use the *_CMD
# versions of the variables directly.
JAVA_CMD:=@JAVA@
@@ -484,13 +476,14 @@ SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAG
JAVAC_FLAGS?=@JAVAC_FLAGS@
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
-INTERIM_LANGTOOLS_JAR := $(LANGTOOLS_OUTPUTDIR)/dist/interim_langtools.jar
-INTERIM_LANGTOOLS_ARGS := "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
+# Use = assignment to be able to override in bootcycle-spec.gmk
+INTERIM_LANGTOOLS_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_langtools.jar
+INTERIM_LANGTOOLS_ARGS = "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javadoc.Main
# The interim corba jar is needed for running rmic
-INTERIM_CORBA_JAR := $(CORBA_OUTPUTDIR)/dist/interim_corba.jar
+INTERIM_CORBA_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_corba.jar
# Base flags for RC
# Guarding this against resetting value. Legacy make files include spec multiple
@@ -569,10 +562,10 @@ FIXPATH:=@FIXPATH@
# Where the build output is stored for your convenience.
BUILD_LOG:=@BUILD_LOG@
BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
-# Disable the build log wrapper on sjavac+winapi until
+# Disable the build log wrapper on sjavac+windows until
# we have solved how to prevent the log wrapper to wait
# for the background sjavac server process.
-ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS_API@,yesXwinapi)
+ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS@,yesXwindows)
BUILD_LOG_WRAPPER:=
else
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
@@ -695,25 +688,21 @@ OS_VERSION_MINOR:=@OS_VERSION_MINOR@
OS_VERSION_MICRO:=@OS_VERSION_MICRO@
# Images directory definitions
-JDK_IMAGE_SUBDIR:=j2sdk-image
-JRE_IMAGE_SUBDIR:=j2re-image
-JDK_OVERLAY_IMAGE_SUBDIR:=j2sdk-overlay-image
-JRE_OVERLAY_IMAGE_SUBDIR:=j2re-overlay-image
+JDK_IMAGE_SUBDIR:=jdk
+JRE_IMAGE_SUBDIR:=jre
# Colon left out to be able to override output dir for bootcycle-images
JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
-JDK_OVERLAY_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_OVERLAY_IMAGE_SUBDIR)
-JRE_OVERLAY_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_OVERLAY_IMAGE_SUBDIR)
# Macosx bundles directory definitions
-JDK_BUNDLE_SUBDIR=j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
-JRE_BUNDLE_SUBDIR=j2re-bundle/jre$(JDK_VERSION).jre/Contents
+JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
+JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
JDK_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_BUNDLE_SUBDIR)
JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)
# This macro is called to allow inclusion of closed source counterparts.
# Unless overridden in closed sources, it expands to nothing.
-# Usage: This function is called in an open makefile, with the following
+# Usage: This function is called in an open makefile, with the following
# arguments:
# $1 the name of the repo, or empty if the top-level repo.
# $2 the name of the makefile
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index db0a253a207..9b16574848f 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -712,12 +712,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
[HAS_CFLAG_OPTIMIZE_DEBUG=true],
[HAS_CFLAG_OPTIMIZE_DEBUG=false])
- # "-fsanitize=undefined" supported for GCC 4.9 and later
- CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
- FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG],
- [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true],
- [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false])
-
# "-z relro" supported in GNU binutils 2.17 and later
LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4
index 380f7dd4054..231d2e837f2 100644
--- a/common/autoconf/toolchain_windows.m4
+++ b/common/autoconf/toolchain_windows.m4
@@ -248,7 +248,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL],
METHOD="$2"
if test -e "$POSSIBLE_MSVCR_DLL"; then
AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD])
-
+
# Need to check if the found msvcr is correct architecture
AC_MSG_CHECKING([found msvcr100.dll architecture])
MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
@@ -291,7 +291,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll])
fi
fi
-
+
if test "x$MSVCR_DLL" = x; then
# Probe: Using well-known location from Visual Studio 10.0
if test "x$VCINSTALLDIR" != x; then
@@ -311,9 +311,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK])
fi
-
+
if test "x$MSVCR_DLL" = x; then
- # Probe: Look in the Windows system32 directory
+ # Probe: Look in the Windows system32 directory
CYGWIN_SYSTEMROOT="$SYSTEMROOT"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
@@ -333,7 +333,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS])
fi
fi
-
+
if test "x$MSVCR_DLL" = x; then
# Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
# (This was the original behaviour; kept since it might turn up something)
@@ -347,11 +347,11 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
fi
fi
-
+
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR])
fi
fi
-
+
if test "x$MSVCR_DLL" = x; then
AC_MSG_CHECKING([for msvcr100.dll])
AC_MSG_RESULT([no])
diff --git a/common/bin/compare.sh b/common/bin/compare.sh
index 31ec560dd16..418ca1d3517 100644
--- a/common/bin/compare.sh
+++ b/common/bin/compare.sh
@@ -103,8 +103,8 @@ diff_text() {
-e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
-e thePoint -e aPoint -e setItemsPtr \
-e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then
- $JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap
- $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
+ $JAVAP -c -constants -l -p "${OTHER_FILE}" > ${OTHER_FILE}.javap
+ $JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
$GREP '^[<>]' | \
$SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
@@ -298,7 +298,7 @@ compare_general_files() {
WORK_DIR=$3
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
- ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
+ ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" ! -name "*.jimage" \
! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
@@ -395,8 +395,14 @@ compare_zip_file() {
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
$MKDIR -p $THIS_UNZIPDIR
$MKDIR -p $OTHER_UNZIPDIR
- (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
- (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
+ if [ "$TYPE" = "jimage" ]
+ then
+ (cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
+ (cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
+ else
+ (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
+ (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
+ fi
# Find all archives inside and unzip them as well to compare the contents rather than
# the archives. pie.jar.pack.gz i app3.war is corrupt, skip it.
@@ -525,7 +531,7 @@ compare_all_jar_files() {
# TODO filter?
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \
- | $SORT | $FILTER)
+ -o -name "*.jimage" | $SORT | $FILTER)
if [ -n "$ZIPS" ]; then
echo Jar files...
@@ -633,7 +639,7 @@ compare_bin_file() {
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
# The files were bytewise identical.
if [ -n "$VERBOSE" ]; then
- echo " : : : : : $BIN_FILE"
+ echo " : : : : : : $BIN_FILE"
fi
return 0
fi
@@ -1136,17 +1142,8 @@ fi
if [ "$SKIP_DEFAULT" != "true" ]; then
if [ -z "$OTHER" ]; then
- OTHER="$THIS/../$LEGACY_BUILD_DIR"
- if [ -d "$OTHER" ]; then
- OTHER="$( cd "$OTHER" && pwd )"
- else
- echo "Default old build directory does not exist:"
- echo "$OTHER"
- exit 1
- fi
- echo "Comparing to default old build:"
- echo "$OTHER"
- echo
+ echo "Nothing to compare to, set with -o"
+ exit 1
else
if [ ! -d "$OTHER" ]; then
echo "Other build directory does not exist:"
@@ -1160,90 +1157,36 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
fi
- # Figure out the layout of the this build. Which kinds of images have been produced
- if [ -d "$THIS/install/j2sdk-image" ]; then
- THIS_J2SDK="$THIS/install/j2sdk-image"
- THIS_J2RE="$THIS/install/j2re-image"
- echo "Selecting install images in this build"
- elif [ -d "$THIS/deploy/j2sdk-image" ]; then
- THIS_J2SDK="$THIS/deploy/j2sdk-image"
- THIS_J2RE="$THIS/deploy/j2re-image"
- echo "Selecting deploy images in this build"
- elif [ -d "$THIS/images/j2sdk-image" ]; then
- THIS_J2SDK="$THIS/images/j2sdk-image"
- THIS_J2RE="$THIS/images/j2re-image"
- echo "Selecting jdk images in this build"
+ # Find the common images to compare, prioritizing later build stages
+ if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then
+ THIS_J2SDK="$THIS/install/jdk"
+ THIS_J2RE="$THIS/install/jre"
+ OTHER_J2SDK="$OTHER/install/jdk"
+ OTHER_J2RE="$OTHER/install/jre"
+ echo "Selecting install images for compare"
+ elif [ -d "$THIS/deploy/jdk" ] && [ -d "$OTHER/deploy/jdk" ]; then
+ THIS_J2SDK="$THIS/deploy/jdk"
+ THIS_J2RE="$THIS/deploy/jre"
+ OTHER_J2SDK="$OTHER/deploy/jdk"
+ OTHER_J2RE="$OTHER/deploy/jre"
+ echo "Selecting deploy images for compare"
+ elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
+ THIS_J2SDK="$THIS/images/jdk"
+ THIS_J2RE="$THIS/images/jre"
+ OTHER_J2SDK="$OTHER/images/jdk"
+ OTHER_J2RE="$OTHER/images/jre"
+ echo "Selecting jdk images for compare"
+ else
+ echo "No common images found."
+ exit 1
fi
- if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
- if [ -d "$THIS/install/j2sdk-image" ]; then
- # If there is an install image, prefer that, it's also overlay
- THIS_J2SDK_OVERLAY="$THIS/install/j2sdk-image"
- THIS_J2RE_OVERLAY="$THIS/install/j2re-image"
- echo "Selecting install overlay images in this build"
- else
- THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
- THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
- echo "Selecting jdk overlay images in this build"
- fi
- fi
-
- if [ -d "$THIS/images/j2sdk-bundle" ]; then
- THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
- THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
- echo "Selecting bundles in this build"
- fi
-
- # Figure out the layout of the other build (old or new, normal or overlay image)
- if [ -d "$OTHER/j2sdk-image" ]; then
- if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
- OTHER_J2SDK="$OTHER/j2sdk-image"
- OTHER_J2RE="$OTHER/j2re-image"
- echo "Selecting old-style images in other build"
- else
- OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
- OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
- echo "Selecting overlay images in other build"
- fi
- elif [ -d "$OTHER/install/j2sdk-image" ]; then
- OTHER_J2SDK="$OTHER/install/j2sdk-image"
- OTHER_J2RE="$OTHER/install/j2re-image"
- echo "Selecting install images in other build"
- elif [ -d "$OTHER/deploy/j2sdk-image" ]; then
- OTHER_J2SDK="$OTHER/deploy/j2sdk-image"
- OTHER_J2RE="$OTHER/deploy/j2re-image"
- echo "Selecting deploy images in other build"
- elif [ -d "$OTHER/images/j2sdk-image" ]; then
- OTHER_J2SDK="$OTHER/images/j2sdk-image"
- OTHER_J2RE="$OTHER/images/j2re-image"
- echo "Selecting jdk images in other build"
- fi
-
- if [ -d "$OTHER/j2sdk-bundle" ]; then
- OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle"
- OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle"
- echo "Selecting bundles in other build"
- elif [ -d "$OTHER/images/j2sdk-bundle" ]; then
- OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle"
- OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle"
- echo "Selecting jdk bundles in other build"
- fi
-
- if [ -z "$THIS_J2SDK" ] || [ -z "$THIS_J2RE" ]; then
- if [ -z "$THIS_J2SDK_OVERLAY" ]; then
- echo "Cannot locate images for this build. Are you sure you have run 'make images'?"
- exit 1
- fi
- fi
-
- if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then
- echo "OTHER build only has an overlay image while this build does not. Nothing to compare!"
- exit 1
- fi
-
- if [ -z "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
- echo "WARNING! OTHER build has bundles built while this build does not."
- echo "Skipping bundle compare!"
+ if [ -d "$THIS/images/jdk-bundle" ] && [ -d "$OTHER/images/jdk-bundle" ]; then
+ THIS_J2SDK_BUNDLE="$THIS/images/jdk-bundle"
+ THIS_J2RE_BUNDLE="$THIS/images/jre-bundle"
+ OTHER_J2SDK_BUNDLE="$OTHER/images/jdk-bundle"
+ OTHER_J2RE_BUNDLE="$OTHER/images/jre-bundle"
+ echo "Also comparing macosx bundles"
fi
if [ -d "$OTHER/images" ]; then
@@ -1266,22 +1209,13 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
fi
- if [ -d "$THIS/docs" ]; then
+ if [ -d "$THIS/docs" ] && [ -d "$OTHER/docs" ]; then
THIS_DOCS="$THIS/docs"
- fi
-
- if [ -d "$OTHER/docs" ]; then
OTHER_DOCS="$OTHER/docs"
- fi
-
- if [ -z "$THIS_DOCS" ]; then
+ echo "Also comparing docs"
+ else
echo "WARNING! Docs haven't been built and won't be compared."
fi
-
- if [ -z "$OTHER_DOCS" ]; then
- echo "WARNING! Other build doesn't contain docs, skipping doc compare."
- fi
-
fi
##########################################################################################
@@ -1299,27 +1233,16 @@ if [ "$CMP_NAMES" = "true" ]; then
echo -n "J2RE "
compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
- if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
- echo -n "J2SDK Overlay "
- compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- echo -n "J2RE Overlay "
- compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
-
- echo -n "J2SDK Overlay "
- compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- echo -n "J2RE Overlay "
- compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
- fi
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
echo -n "J2SDK Bundle "
- compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+ compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
echo -n "J2RE Bundle "
- compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+ compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
echo -n "J2SDK Bundle "
- compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+ compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
echo -n "J2RE Bundle "
- compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+ compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
fi
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
echo -n "Docs "
@@ -1340,18 +1263,6 @@ if [ "$CMP_PERMS" = "true" ]; then
echo -n "J2RE "
compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
- if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
- echo -n "J2SDK Overlay "
- compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- echo -n "J2RE Overlay "
- compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
- fi
- if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
- echo -n "J2SDK Bundle "
- compare_permissions $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
- echo -n "J2RE Bundle "
- compare_permissions $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
- fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
@@ -1364,17 +1275,11 @@ if [ "$CMP_TYPES" = "true" ]; then
echo -n "J2RE "
compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
- if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
- echo -n "J2SDK Overlay "
- compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- echo -n "J2RE Overlay "
- compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
- fi
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
echo -n "J2SDK Bundle "
- compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+ compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
echo -n "J2RE Bundle "
- compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+ compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
@@ -1388,17 +1293,11 @@ if [ "$CMP_GENERAL" = "true" ]; then
echo -n "J2RE "
compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
- if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
- echo -n "J2SDK Overlay "
- compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- echo -n "J2RE Overlay "
- compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
- fi
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
echo -n "J2SDK Bundle "
- compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
+ compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
echo -n "J2RE Bundle "
- compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
+ compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
fi
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
echo -n "Docs "
@@ -1454,10 +1353,6 @@ if [ "$CMP_LIBS" = "true" ]; then
compare_all_libs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
fi
- if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
- echo -n "Bundle "
- compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
@@ -1467,10 +1362,6 @@ if [ "$CMP_EXECS" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
fi
- if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
- echo -n "Overlay "
- compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
- fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
diff --git a/common/bin/compare_exceptions.sh.incl b/common/bin/compare_exceptions.sh.incl
index cace701b788..28a132c9afa 100644
--- a/common/bin/compare_exceptions.sh.incl
+++ b/common/bin/compare_exceptions.sh.incl
@@ -84,7 +84,9 @@ ACCEPTED_BIN_DIFF="
./bin/jconsole
./bin/jdb
./bin/jhat
+./bin/jimage
./bin/jinfo
+./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
@@ -108,6 +110,7 @@ ACCEPTED_BIN_DIFF="
./bin/wsimport
./bin/xjc
./jre/bin/java
+./jre/bin/jjs
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
@@ -171,7 +174,9 @@ ACCEPTED_BIN_DIFF="
./bin/jconsole
./bin/jdb
./bin/jhat
+./bin/jimage
./bin/jinfo
+./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
@@ -195,6 +200,7 @@ ACCEPTED_BIN_DIFF="
./bin/wsimport
./bin/xjc
./jre/bin/java
+./jre/bin/jjs
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
@@ -314,7 +320,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/jconsole
./bin/jdb
./bin/jhat
+./bin/jimage
./bin/jinfo
+./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
@@ -453,7 +461,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/amd64/jconsole
./bin/amd64/jdb
./bin/amd64/jhat
+./bin/amd64/jimage
./bin/amd64/jinfo
+./bin/amd64/jjs
./bin/amd64/jmap
./bin/amd64/jps
./bin/amd64/jrunscript
@@ -611,7 +621,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/jconsole
./bin/jdb
./bin/jhat
+./bin/jimage
./bin/jinfo
+./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
@@ -755,7 +767,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/sparcv9/jconsole
./bin/sparcv9/jdb
./bin/sparcv9/jhat
+./bin/sparcv9/jimage
./bin/sparcv9/jinfo
+./bin/sparcv9/jjs
./bin/sparcv9/jmap
./bin/sparcv9/jps
./bin/sparcv9/jrunscript
@@ -836,7 +850,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
./bin/jconsole.exe
./bin/jdb.exe
./bin/jhat.exe
+./bin/jimage.exe
./bin/jinfo.exe
+./bin/jjs.exe
./bin/jmap.exe
./bin/jps.exe
./bin/jrunscript.exe
@@ -910,11 +926,6 @@ ACCEPTED_JARZIP_CONTENTS="
/META-INF/INDEX.LIST
"
-KNOWN_BIN_DIFF="
-./jre/lib/libJObjC.dylib
-./lib/libJObjC.dylib
-"
-
ACCEPTED_BIN_DIFF="
./bin/appletviewer
./bin/idlj
@@ -930,7 +941,9 @@ ACCEPTED_BIN_DIFF="
./bin/jconsole
./bin/jdb
./bin/jhat
+./bin/jimage
./bin/jinfo
+./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
@@ -964,34 +977,82 @@ ACCEPTED_BIN_DIFF="
./jre/bin/tnameserv
./jre/lib/libsaproc.dylib
./jre/lib/server/libjvm.dylib
+./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib
+./demo/jvmti/gctest/lib/libgctest.dylib
+./demo/jvmti/heapTracker/lib/libheapTracker.dylib
+./demo/jvmti/heapViewer/lib/libheapViewer.dylib
+./demo/jvmti/minst/lib/libminst.dylib
+./demo/jvmti/mtrace/lib/libmtrace.dylib
+./demo/jvmti/versionCheck/lib/libversionCheck.dylib
+./demo/jvmti/waiters/lib/libwaiters.dylib
+./Contents/Home/lib/libAppleScriptEngine.dylib
+./Contents/Home/lib/libattach.dylib
+./Contents/Home/lib/libawt_lwawt.dylib
+./Contents/Home/lib/libdeploy.dylib
+./Contents/Home/lib/libdt_socket.dylib
+./Contents/Home/lib/libhprof.dylib
+./Contents/Home/lib/libinstrument.dylib
+./Contents/Home/lib/libjava_crw_demo.dylib
+./Contents/Home/lib/libjdwp.dylib
+./Contents/Home/lib/libjsdt.dylib
+./Contents/Home/lib/libjsig.dylib
+./Contents/Home/lib/libmanagement.dylib
+./Contents/Home/lib/libnpjp2.dylib
+./Contents/Home/lib/libosx.dylib
+./Contents/Home/lib/libosxapp.dylib
+./Contents/Home/lib/libsaproc.dylib
+./Contents/Home/lib/libsplashscreen.dylib
+./Contents/Home/lib/libverify.dylib
+./Contents/Home/lib/server/libjsig.dylib
+./Contents/Home/lib/server/libjvm.dylib
+./jre/lib/libAppleScriptEngine.dylib
+./jre/lib/libattach.dylib
+./jre/lib/libawt_lwawt.dylib
+./jre/lib/libdeploy.dylib
+./jre/lib/libdt_socket.dylib
+./jre/lib/libhprof.dylib
+./jre/lib/libinstrument.dylib
+./jre/lib/libjava_crw_demo.dylib
+./jre/lib/libjdwp.dylib
+./jre/lib/libjsdt.dylib
+./jre/lib/libjsig.dylib
+./jre/lib/libmanagement.dylib
+./jre/lib/libosx.dylib
+./jre/lib/libosxapp.dylib
+./jre/lib/libsaproc.dylib
+./jre/lib/libsplashscreen.dylib
+./jre/lib/libverify.dylib
+./jre/lib/server/libjvm.dylib
+./lib/libAppleScriptEngine.dylib
+./lib/libattach.dylib
+./lib/libawt_lwawt.dylib
+./lib/libdeploy.dylib
+./lib/libdt_socket.dylib
+./lib/libhprof.dylib
+./lib/libinstrument.dylib
+./lib/libjava_crw_demo.dylib
+./lib/libjdwp.dylib
+./lib/libjsdt.dylib
+./lib/libjsig.dylib
+./lib/libmanagement.dylib
+./lib/libnpjp2.dylib
+./lib/libosx.dylib
+./lib/libosxapp.dylib
+./lib/libverify.dylib
./lib/libsaproc.dylib
+./lib/libsplashscreen.dylib
./lib/server/libjvm.dylib
./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
"
-KNOWN_SIZE_DIFF="
-./jre/lib/libJObjC.dylib
-./lib/libJObjC.dylib
-"
-
SORT_SYMBOLS="
-./jre/lib/libJObjC.dylib
-./lib/libJObjC.dylib
+./Contents/Home/lib/libsaproc.dylib
+./jre/lib/libsaproc.dylib
+./lib/libsaproc.dylib
"
-KNOWN_SYM_DIFF="
-./jre/lib/libJObjC.dylib
-./lib/libJObjC.dylib
+ACCEPTED_SMALL_SIZE_DIFF="
+./bin/javaws
+./Contents/Home/bin/_javaws
"
-
-KNOWN_ELF_DIFF="
-./jre/lib/libJObjC.dylib
-./lib/libJObjC.dylib
-"
-
-KNOWN_DIS_DIFF="
-./jre/lib/libJObjC.dylib
-./lib/libJObjC.dylib
-"
-
fi
diff --git a/common/bin/logger.sh b/common/bin/logger.sh
index 46ab48ae47b..7fbc7816d81 100644
--- a/common/bin/logger.sh
+++ b/common/bin/logger.sh
@@ -22,10 +22,10 @@
# questions.
#
-# Usage: ./logger.sh theloggfile acommand arg1 arg2
+# Usage: ./logger.sh theloggfile acommand arg1 arg2
#
# Execute acommand with args, in such a way that
-# both stdout and stderr from acommand are appended to
+# both stdout and stderr from acommand are appended to
# theloggfile.
#
# Preserve stdout and stderr, so that the stdout
diff --git a/common/bin/shell-tracer.sh b/common/bin/shell-tracer.sh
index 27a964c977e..5c7cc449f9c 100644
--- a/common/bin/shell-tracer.sh
+++ b/common/bin/shell-tracer.sh
@@ -26,12 +26,12 @@
#
# This shell script is supposed to be set as a replacement for SHELL in make,
# causing it to be called whenever make wants to execute shell commands.
-# The is suitable for passing on to the old shell,
+# The is suitable for passing on to the old shell,
# typically beginning with -c.
#
-# This script will make sure the shell command line is executed with
+# This script will make sure the shell command line is executed with
# OLD_SHELL -x, and it will also store a simple log of the the time it takes to
-# execute the command in the OUTPUT_FILE, using the "time" utility as pointed
+# execute the command in the OUTPUT_FILE, using the "time" utility as pointed
# to by TIME_CMD. If TIME_CMD is "-", no timestamp will be stored.
TIME_CMD="$1"
diff --git a/common/bin/test_builds.sh b/common/bin/test_builds.sh
index 911008020c9..674693576ab 100644
--- a/common/bin/test_builds.sh
+++ b/common/bin/test_builds.sh
@@ -171,7 +171,7 @@ checkErrors
) 2>&1 | tee ${t3}.build.txt
checkErrors
-# Compare old build to build-infra build
+# Compare old build to build-infra build
( \
sh ${t0}/common/bin/compareimage.sh \
${t3}/build/*/j2sdk-image \
@@ -181,4 +181,3 @@ checkErrors
checkErrors
exit 0
-
diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt
index f05bd5c0c0d..cd0749c7aa8 100644
--- a/common/bin/unshuffle_list.txt
+++ b/common/bin/unshuffle_list.txt
@@ -1212,6 +1212,7 @@ jdk/src/java.rmi/share/classes/sun/rmi/transport/tcp : jdk/src/share/classes/sun
jdk/src/java.rmi/share/doc/stub/java/rmi/activation : jdk/src/share/doc/stub/java/rmi/activation
jdk/src/java.rmi/unix/bin/java-rmi.cgi.sh : jdk/src/solaris/bin/java-rmi.cgi.sh
jdk/src/java.scripting/share/classes/javax/script : jdk/src/share/classes/javax/script
+jdk/src/java.scripting/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
jdk/src/java.security.acl/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl
jdk/src/java.security.acl/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl
jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c : jdk/src/share/native/sun/security/krb5/nativeccache.c
@@ -1301,7 +1302,6 @@ jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/n
jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
-jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar
jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii
diff --git a/common/bin/unshuffle_patch.sh b/common/bin/unshuffle_patch.sh
index f380fb6f2f1..a61864cbd3f 100644
--- a/common/bin/unshuffle_patch.sh
+++ b/common/bin/unshuffle_patch.sh
@@ -80,7 +80,7 @@ for r in $repos ; do
if [ $repo = "$r" ] ; then
found="true"
break;
- fi
+ fi
done
if [ $found = "false" ] ; then
echo "ERROR: Unknown repo: $repo. Should be one of [$repos]." >&2
@@ -200,4 +200,3 @@ do
printf "%s\n" "$line" >> $output
fi
done < "$input"
-
diff --git a/corba/.hgtags b/corba/.hgtags
index ab15ca1134c..26c65ed70d5 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -282,3 +282,6 @@ ffd90c81d4ef9d94d880fc852e2fc482ecd9b374 jdk9-b36
7e9add74ad50841fb39dae75db56374aefa1de4c jdk9-b37
8acf056126e819cf536eef02aee0f61f207a6b52 jdk9-b38
53bf36cb722db50815712258a77cb6bbe25a2f5f jdk9-b39
+e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
+1908b886ba1eda46fa725cf1160fe5d30fd1a7e5 jdk9-b41
+078bb11af876fe528d4b516f33ad4dd9bb60549e jdk9-b42
diff --git a/corba/make/CommonCorba.gmk b/corba/make/CommonCorba.gmk
deleted file mode 100644
index 11b69b6f715..00000000000
--- a/corba/make/CommonCorba.gmk
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (c) 2014, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-################################################################################
-# The Corba sources are old and generates a LOT of warnings.
-# Disable these using Xlint, until someone cares to fix them.
-DISABLE_CORBA_WARNINGS := -Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann
-
-# The "generate old bytecode" javac setup uses the new compiler to compile for the
-# boot jdk to generate tools that need to be run with the boot jdk.
-# Thus we force the target bytecode to the boot jdk bytecode.
-$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
- JVM := $(JAVA), \
- JAVAC := $(NEW_JAVAC), \
- FLAGS := $(BOOT_JDK_SOURCETARGET) \
- -bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(BOOT_TOOLSJAR)" \
- $(DISABLE_CORBA_WARNINGS), \
- SERVER_DIR := $(SJAVAC_SERVER_DIR), \
- SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-# The "generate new bytecode" uses the new compiler to generate bytecode
-# for the new jdk that is being built. The code compiled by this setup
-# cannot necessarily be run with the boot jdk.
-$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE, \
- JVM := $(JAVA), \
- JAVAC := $(NEW_JAVAC), \
- FLAGS := -cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS), \
- SERVER_DIR := $(SJAVAC_SERVER_DIR), \
- SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-################################################################################
diff --git a/corba/make/CompileCorba.gmk b/corba/make/CompileInterim.gmk
similarity index 78%
rename from corba/make/CompileCorba.gmk
rename to corba/make/CompileInterim.gmk
index 3a03e800ec5..7f7e1fdfb98 100644
--- a/corba/make/CompileCorba.gmk
+++ b/corba/make/CompileInterim.gmk
@@ -29,16 +29,16 @@ default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
-
-include CommonCorba.gmk
+include SetupJavaCompilers.gmk
################################################################################
$(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
SETUP := GENERATE_OLDBYTECODE, \
- SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes \
+ SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes \
+ $(CORBA_TOPDIR)/src/java.corba/share/classes \
$(CORBA_TOPDIR)/src/jdk.rmic/share/classes \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba, \
+ $(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \
EXCLUDES := com/sun/corba/se/PortableActivationIDL, \
EXCLUDE_FILES := com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \
com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \
@@ -47,16 +47,9 @@ $(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
com/sun/corba/se/impl/presentation/rmi/jndi.properties, \
COPY := .prp, \
CLEAN := .properties, \
- BIN := $(CORBA_OUTPUTDIR)/interim_classes, \
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_interim_classes, \
JAR := $(INTERIM_CORBA_JAR)))
################################################################################
-# Copy idl files straight to jdk/include.
-$(JDK_OUTPUTDIR)/include/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
- $(install-file)
-IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/include/orb.idl $(JDK_OUTPUTDIR)/include/ir.idl
-
-################################################################################
-
-all: $(BUILD_INTERIM_CORBA) $(IDL_TARGET_FILES)
+all: $(BUILD_INTERIM_CORBA)
diff --git a/langtools/make/CommonLangtools.gmk b/corba/make/copy/Copy-java.corba.gmk
similarity index 69%
rename from langtools/make/CommonLangtools.gmk
rename to corba/make/copy/Copy-java.corba.gmk
index f32a0ac2ab7..fbc26a5833b 100644
--- a/langtools/make/CommonLangtools.gmk
+++ b/corba/make/copy/Copy-java.corba.gmk
@@ -23,13 +23,12 @@
# questions.
#
-# The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
-# and the interim javac, to be run by the boot jdk.
-$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
- JAVAC := $(JAVAC), \
- SERVER_DIR := $(SJAVAC_SERVER_DIR), \
- SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
- FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror))
+################################################################################
+# Copy idl files to jdk/lib.
+$(eval $(call SetupCopyFiles,COPY_IDL, \
+ SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl, \
+ DEST := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \
+ FILES := $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl \
+ $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl))
-# javax.tools.JavaCompilerTool isn't really a suffix but this gets the file copied.
-RESOURCE_SUFFIXES := .gif .xml .css .js javax.tools.JavaCompilerTool
+TARGETS := $(COPY_IDL)
diff --git a/corba/make/GensrcCorba.gmk b/corba/make/gensrc/Gensrc-java.corba.gmk
similarity index 81%
rename from corba/make/GensrcCorba.gmk
rename to corba/make/gensrc/Gensrc-java.corba.gmk
index 1951cd43e37..11e242afe32 100644
--- a/corba/make/GensrcCorba.gmk
+++ b/corba/make/gensrc/Gensrc-java.corba.gmk
@@ -29,35 +29,37 @@ include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include IdlCompilation.gmk
-
-include CommonCorba.gmk
+include SetupJavaCompilers.gmk
################################################################################
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_CORBA, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(CORBA_TOPDIR)/make/src/classes, \
- BIN := $(CORBA_OUTPUTDIR)/tools_classes))
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes))
-TOOL_LOGUTIL_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/tools_classes \
+TOOL_LOGUTIL_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes \
build.tools.logutil.MC
$(eval $(call SetupJavaCompilation,BUILD_IDLJ, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
- BIN := $(CORBA_OUTPUTDIR)/idlj_classes, \
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/idlj_classes, \
COPY := .prp, \
INCLUDES := com/sun/tools/corba/se/idl, \
EXCLUDE_FILES := ResourceBundleUtil.java))
# Force the language to english for predictable source code generation.
-TOOL_IDLJ_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/idlj_classes \
+TOOL_IDLJ_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/idlj_classes \
-Duser.language=en com.sun.tools.corba.se.idl.toJavaPortable.Compile
################################################################################
+EXCEPTION_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging
+LOGWRAPPER_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/_logwrappers
+
# Generate LogWrapper classes
-$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/%SystemException.java: \
+$(EXCEPTION_DIR)/%SystemException.java: \
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
$(BUILD_TOOLS_CORBA)
$(MKDIR) -p $(@D)
@@ -66,21 +68,21 @@ $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/%SystemExcept
$(TOOL_LOGUTIL_CMD) make-class $< $(@D)
# Generate LogWrapper properties file by concatening resource files
-$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/LogStrings.properties: \
- $(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \
- $(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource
+$(EXCEPTION_DIR)/LogStrings.properties: \
+ $(LOGWRAPPER_DIR)/ActivationSystemException.resource \
+ $(LOGWRAPPER_DIR)/IORSystemException.resource \
+ $(LOGWRAPPER_DIR)/InterceptorsSystemException.resource \
+ $(LOGWRAPPER_DIR)/NamingSystemException.resource \
+ $(LOGWRAPPER_DIR)/OMGSystemException.resource \
+ $(LOGWRAPPER_DIR)/ORBUtilSystemException.resource \
+ $(LOGWRAPPER_DIR)/POASystemException.resource \
+ $(LOGWRAPPER_DIR)/UtilSystemException.resource
$(MKDIR) -p $(@D)
$(ECHO) $(LOG_INFO) Concatenating 8 resource files into $(@F)
$(CAT) $^ > $@
# The resources files are generated from lisp-like .mc files.
-$(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: \
+$(LOGWRAPPER_DIR)/%SystemException.resource: \
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
$(BUILD_TOOLS_CORBA)
$(MKDIR) -p $(@D)
@@ -90,15 +92,15 @@ $(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: \
LOGWRAPPER_TARGETS := \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/ActivationSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/IORSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/NamingSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/OMGSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/POASystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/UtilSystemException.java \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/LogStrings.properties
+ $(EXCEPTION_DIR)/ActivationSystemException.java \
+ $(EXCEPTION_DIR)/IORSystemException.java \
+ $(EXCEPTION_DIR)/InterceptorsSystemException.java \
+ $(EXCEPTION_DIR)/NamingSystemException.java \
+ $(EXCEPTION_DIR)/OMGSystemException.java \
+ $(EXCEPTION_DIR)/ORBUtilSystemException.java \
+ $(EXCEPTION_DIR)/POASystemException.java \
+ $(EXCEPTION_DIR)/UtilSystemException.java \
+ $(EXCEPTION_DIR)/LogStrings.properties
################################################################################
# Build the IDLs.
@@ -215,7 +217,7 @@ IDL_DELETES := \
$(eval $(call SetupIdlCompilation,BUILD_IDLS, \
IDLJ := $(TOOL_IDLJ_CMD), \
SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
- BIN := $(CORBA_OUTPUTDIR)/gensrc/java.corba, \
+ BIN := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \
EXCLUDES := com/sun/tools/corba/se/idl/% \
org/omg/CORBA/% \
com/sun/corba/se/GiopIDL/% \
@@ -230,12 +232,12 @@ $(BUILD_IDLS): $(BUILD_IDLJ)
################################################################################
# zh_HK is just a copy of zh_TW
-$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \
+$(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties
$(install-file)
################################################################################
all: $(BUILD_IDLS) $(LOGWRAPPER_TARGETS) \
- $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties
+ $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties
diff --git a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Generator.java b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Generator.java
index e775120460c..a19e1ea519f 100644
--- a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Generator.java
+++ b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Generator.java
@@ -352,7 +352,7 @@ public abstract class Generator implements sun.rmi.rmic.Generator,
env.output(Main.getText("rmic.generated", file.getPath(), Long.toString(duration)));
}
if (sourceFile) {
- env.parseFile(new ClassFile(file));
+ env.parseFile(ClassFile.newClassFile(file));
}
} catch (IOException e) {
env.error(0, "cant.write", file.toString());
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index acafa28f373..ae7d006d45b 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -443,3 +443,5 @@ b1c2dd843f247a1db19e1e85eb62ca405f72dc26 jdk9-b37
c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38
9cb75e5e394827ccbaf2e15524108a412dc4ddc5 jdk9-b39
6b09b3193d731e3288e2a240c504a20d0a06c766 jdk9-b40
+1d29b13e8a515a7ea3b882f140576d5d675bc11f jdk9-b41
+38cb4fbd47e3472bd1b5ebac83bda96fe4869c4f jdk9-b42
diff --git a/hotspot/make/bsd/makefiles/sa.make b/hotspot/make/bsd/makefiles/sa.make
index fb3afd43dad..f07cee605e9 100644
--- a/hotspot/make/bsd/makefiles/sa.make
+++ b/hotspot/make/bsd/makefiles/sa.make
@@ -65,6 +65,10 @@ else
SA_CLASSPATH=$(shell test -f $(ALT_SA_CLASSPATH) && echo $(ALT_SA_CLASSPATH))
endif
+ifneq ($(SA_CLASSPATH),)
+ SA_CLASSPATH_ARG := -classpath $(SA_CLASSPATH)
+endif
+
# TODO: if it's a modules image, check if SA module is installed.
MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
@@ -116,7 +120,7 @@ $(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
# are in AGENT_FILES, so use the shell to expand them.
# Be extra carefull to not produce too long command lines in the shell!
$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
- $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) $(SA_CLASSPATH_ARG) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
$(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp
index a624ec90185..eab7a347ee0 100644
--- a/hotspot/src/os/aix/vm/os_aix.cpp
+++ b/hotspot/src/os/aix/vm/os_aix.cpp
@@ -531,15 +531,13 @@ void os::init_system_properties_values() {
#define DEFAULT_LIBPATH "/usr/lib:/lib"
#define EXTENSIONS_DIR "/lib/ext"
-#define ENDORSED_DIR "/lib/endorsed"
// Buffer that fits several sprintfs.
// Note that the space for the trailing null is provided
// by the nulls included by the sizeof operator.
const size_t bufsize =
- MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
- (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR), // extensions dir
- (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+ MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
+ (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR)); // extensions dir
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// sysclasspath, java_home, dll_dir
@@ -590,15 +588,10 @@ void os::init_system_properties_values() {
sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
Arguments::set_ext_dirs(buf);
- // Endorsed standards default directory.
- sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
- Arguments::set_endorsed_dirs(buf);
-
FREE_C_HEAP_ARRAY(char, buf);
#undef DEFAULT_LIBPATH
#undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
}
////////////////////////////////////////////////////////////////////////////////
@@ -2803,6 +2796,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
return ::read(fd, buf, nBytes);
}
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+ return ::pread(fd, buf, nBytes, offset);
+}
+
void os::naked_short_sleep(jlong ms) {
struct timespec req;
@@ -4151,8 +4148,29 @@ int os::available(int fd, jlong *bytes) {
char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec) {
- Unimplemented();
- return NULL;
+ int prot;
+ int flags = MAP_PRIVATE;
+
+ if (read_only) {
+ prot = PROT_READ;
+ } else {
+ prot = PROT_READ | PROT_WRITE;
+ }
+
+ if (allow_exec) {
+ prot |= PROT_EXEC;
+ }
+
+ if (addr != NULL) {
+ flags |= MAP_FIXED;
+ }
+
+ char* mapped_address = (char*)mmap(addr, (size_t)bytes, prot, flags,
+ fd, file_offset);
+ if (mapped_address == MAP_FAILED) {
+ return NULL;
+ }
+ return mapped_address;
}
// Remap a block of memory.
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index 8a8bfa2162a..1d62a712a06 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -353,7 +353,6 @@ void os::init_system_properties_values() {
// Base path of extensions installed on the system.
#define SYS_EXT_DIR "/usr/java/packages"
#define EXTENSIONS_DIR "/lib/ext"
-#define ENDORSED_DIR "/lib/endorsed"
#ifndef __APPLE__
@@ -361,9 +360,8 @@ void os::init_system_properties_values() {
// Note that the space for the colon and the trailing null are provided
// by the nulls included by the sizeof operator.
const size_t bufsize =
- MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
- (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
- (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+ MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
+ (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// sysclasspath, java_home, dll_dir
@@ -425,10 +423,6 @@ void os::init_system_properties_values() {
sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
Arguments::set_ext_dirs(buf);
- // Endorsed standards default directory.
- sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
- Arguments::set_endorsed_dirs(buf);
-
FREE_C_HEAP_ARRAY(char, buf);
#else // __APPLE__
@@ -445,9 +439,8 @@ void os::init_system_properties_values() {
// Note that the space for the colon and the trailing null are provided
// by the nulls included by the sizeof operator.
const size_t bufsize =
- MAX3((size_t)MAXPATHLEN, // for dll_dir & friends.
- (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + system_ext_size, // extensions dir
- (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+ MAX2((size_t)MAXPATHLEN, // for dll_dir & friends.
+ (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + system_ext_size); // extensions dir
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// sysclasspath, java_home, dll_dir
@@ -525,10 +518,6 @@ void os::init_system_properties_values() {
user_home_dir, Arguments::get_java_home());
Arguments::set_ext_dirs(buf);
- // Endorsed standards default directory.
- sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
- Arguments::set_endorsed_dirs(buf);
-
FREE_C_HEAP_ARRAY(char, buf);
#undef SYS_EXTENSIONS_DIR
@@ -538,7 +527,6 @@ void os::init_system_properties_values() {
#undef SYS_EXT_DIR
#undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
}
////////////////////////////////////////////////////////////////////////////////
@@ -2576,6 +2564,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes));
}
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+ RESTARTABLE_RETURN_INT(::pread(fd, buf, nBytes, offset));
+}
+
void os::naked_short_sleep(jlong ms) {
struct timespec req;
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index c25af522d83..85ec17dcc40 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -338,15 +338,13 @@ void os::init_system_properties_values() {
// Base path of extensions installed on the system.
#define SYS_EXT_DIR "/usr/java/packages"
#define EXTENSIONS_DIR "/lib/ext"
-#define ENDORSED_DIR "/lib/endorsed"
// Buffer that fits several sprintfs.
// Note that the space for the colon and the trailing null are provided
// by the nulls included by the sizeof operator.
const size_t bufsize =
- MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
- (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
- (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+ MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
+ (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// sysclasspath, java_home, dll_dir
@@ -411,16 +409,11 @@ void os::init_system_properties_values() {
sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
Arguments::set_ext_dirs(buf);
- // Endorsed standards default directory.
- sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
- Arguments::set_endorsed_dirs(buf);
-
FREE_C_HEAP_ARRAY(char, buf);
#undef DEFAULT_LIBPATH
#undef SYS_EXT_DIR
#undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
}
////////////////////////////////////////////////////////////////////////////////
@@ -3784,6 +3777,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
return ::read(fd, buf, nBytes);
}
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+ return ::pread(fd, buf, nBytes, offset);
+}
+
// Short sleep, direct OS call.
//
// Note: certain versions of Linux CFS scheduler (since 2.6.23) do not guarantee
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index aa74ea6a83c..637bd033913 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -609,17 +609,15 @@ void os::init_system_properties_values() {
// Base path of extensions installed on the system.
#define SYS_EXT_DIR "/usr/jdk/packages"
#define EXTENSIONS_DIR "/lib/ext"
-#define ENDORSED_DIR "/lib/endorsed"
char cpu_arch[12];
// Buffer that fits several sprintfs.
// Note that the space for the colon and the trailing null are provided
// by the nulls included by the sizeof operator.
const size_t bufsize =
- MAX4((size_t)MAXPATHLEN, // For dll_dir & friends.
+ MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch), // invariant ld_library_path
- (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
- (size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
+ (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
// sysclasspath, java_home, dll_dir
@@ -765,15 +763,10 @@ void os::init_system_properties_values() {
sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
Arguments::set_ext_dirs(buf);
- // Endorsed standards default directory.
- sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
- Arguments::set_endorsed_dirs(buf);
-
FREE_C_HEAP_ARRAY(char, buf);
#undef SYS_EXT_DIR
#undef EXTENSIONS_DIR
-#undef ENDORSED_DIR
}
void os::breakpoint() {
@@ -3167,6 +3160,15 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
return res;
}
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+ size_t res;
+ JavaThread* thread = (JavaThread*)Thread::current();
+ assert(thread->thread_state() == _thread_in_vm, "Assumed _thread_in_vm");
+ ThreadBlockInVM tbiv(thread);
+ RESTARTABLE(::pread(fd, buf, (size_t) nBytes, offset), res);
+ return res;
+}
+
size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
size_t res;
assert(((JavaThread*)Thread::current())->thread_state() == _thread_in_native,
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index 5677e63a058..85a392783f8 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -292,19 +292,6 @@ void os::init_system_properties_values() {
#undef BIN_DIR
#undef PACKAGE_DIR
- // Default endorsed standards directory.
- {
-#define ENDORSED_DIR "\\lib\\endorsed"
- size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR);
- char * buf = NEW_C_HEAP_ARRAY(char, len, mtInternal);
- sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR);
- Arguments::set_endorsed_dirs(buf);
- // (Arguments::set_endorsed_dirs() calls SystemProperty::set_value(), which
- // duplicates the input.)
- FREE_C_HEAP_ARRAY(char, buf);
-#undef ENDORSED_DIR
- }
-
#ifndef _WIN64
// set our UnhandledExceptionFilter and save any previous one
prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception);
@@ -3087,7 +3074,7 @@ char* os::reserve_memory_aligned(size_t size, size_t alignment) {
char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
assert((size_t)addr % os::vm_allocation_granularity() == 0,
"reserve alignment");
- assert(bytes % os::vm_allocation_granularity() == 0, "reserve block size");
+ assert(bytes % os::vm_page_size() == 0, "reserve page size");
char* res;
// note that if UseLargePages is on, all the areas that require interleaving
// will go thru reserve_memory_special rather than thru here.
@@ -4391,6 +4378,23 @@ jlong os::lseek(int fd, jlong offset, int whence) {
return (jlong) ::_lseeki64(fd, offset, whence);
}
+size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
+ OVERLAPPED ov;
+ DWORD nread;
+ BOOL result;
+
+ ZeroMemory(&ov, sizeof(ov));
+ ov.Offset = (DWORD)offset;
+ ov.OffsetHigh = (DWORD)(offset >> 32);
+
+ HANDLE h = (HANDLE)::_get_osfhandle(fd);
+
+ result = ReadFile(h, (LPVOID)buf, nBytes, &nread, &ov);
+
+ return result ? nread : 0;
+}
+
+
// This method is a slightly reworked copy of JDK's sysNativePath
// from src/windows/hpi/src/path_md.c
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index 7d54c6e2ed6..f80d0fcc00e 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -3108,21 +3108,39 @@ void ClassFileParser::apply_parsed_class_attributes(instanceKlassHandle k) {
}
}
-// Transfer ownership of metadata allocated to the InstanceKlass.
-void ClassFileParser::apply_parsed_class_metadata(
- instanceKlassHandle this_klass,
- int java_fields_count, TRAPS) {
- // Assign annotations if needed
- if (_annotations != NULL || _type_annotations != NULL ||
- _fields_annotations != NULL || _fields_type_annotations != NULL) {
+// Create the Annotations object that will
+// hold the annotations array for the Klass.
+void ClassFileParser::create_combined_annotations(TRAPS) {
+ if (_annotations == NULL &&
+ _type_annotations == NULL &&
+ _fields_annotations == NULL &&
+ _fields_type_annotations == NULL) {
+ // Don't create the Annotations object unnecessarily.
+ return;
+ }
+
Annotations* annotations = Annotations::allocate(_loader_data, CHECK);
annotations->set_class_annotations(_annotations);
annotations->set_class_type_annotations(_type_annotations);
annotations->set_fields_annotations(_fields_annotations);
annotations->set_fields_type_annotations(_fields_type_annotations);
- this_klass->set_annotations(annotations);
- }
+ // This is the Annotations object that will be
+ // assigned to InstanceKlass being constructed.
+ _combined_annotations = annotations;
+
+ // The annotations arrays below has been transfered the
+ // _combined_annotations so these fields can now be cleared.
+ _annotations = NULL;
+ _type_annotations = NULL;
+ _fields_annotations = NULL;
+ _fields_type_annotations = NULL;
+}
+
+// Transfer ownership of metadata allocated to the InstanceKlass.
+void ClassFileParser::apply_parsed_class_metadata(
+ instanceKlassHandle this_klass,
+ int java_fields_count, TRAPS) {
_cp->set_pool_holder(this_klass());
this_klass->set_constants(_cp);
this_klass->set_fields(_fields, java_fields_count);
@@ -3130,6 +3148,7 @@ void ClassFileParser::apply_parsed_class_metadata(
this_klass->set_inner_classes(_inner_classes);
this_klass->set_local_interfaces(_local_interfaces);
this_klass->set_transitive_interfaces(_transitive_interfaces);
+ this_klass->set_annotations(_combined_annotations);
// Clear out these fields so they don't get deallocated by the destructor
clear_class_metadata();
@@ -4002,6 +4021,10 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
ClassAnnotationCollector parsed_annotations;
parse_classfile_attributes(&parsed_annotations, CHECK_(nullHandle));
+ // Finalize the Annotations metadata object,
+ // now that all annotation arrays have been created.
+ create_combined_annotations(CHECK_(nullHandle));
+
// Make sure this is the end of class file stream
guarantee_property(cfs->at_eos(), "Extra bytes at the end of class file %s", CHECK_(nullHandle));
@@ -4302,10 +4325,27 @@ ClassFileParser::~ClassFileParser() {
InstanceKlass::deallocate_interfaces(_loader_data, _super_klass(),
_local_interfaces, _transitive_interfaces);
- MetadataFactory::free_array(_loader_data, _annotations);
- MetadataFactory::free_array(_loader_data, _type_annotations);
- Annotations::free_contents(_loader_data, _fields_annotations);
- Annotations::free_contents(_loader_data, _fields_type_annotations);
+ if (_combined_annotations != NULL) {
+ // After all annotations arrays have been created, they are installed into the
+ // Annotations object that will be assigned to the InstanceKlass being created.
+
+ // Deallocate the Annotations object and the installed annotations arrays.
+ _combined_annotations->deallocate_contents(_loader_data);
+
+ // If the _combined_annotations pointer is non-NULL,
+ // then the other annotations fields should have been cleared.
+ assert(_annotations == NULL, "Should have been cleared");
+ assert(_type_annotations == NULL, "Should have been cleared");
+ assert(_fields_annotations == NULL, "Should have been cleared");
+ assert(_fields_type_annotations == NULL, "Should have been cleared");
+ } else {
+ // If the annotations arrays were not installed into the Annotations object,
+ // then they have to be deallocated explicitly.
+ MetadataFactory::free_array(_loader_data, _annotations);
+ MetadataFactory::free_array(_loader_data, _type_annotations);
+ Annotations::free_contents(_loader_data, _fields_annotations);
+ Annotations::free_contents(_loader_data, _fields_type_annotations);
+ }
clear_class_metadata();
diff --git a/hotspot/src/share/vm/classfile/classFileParser.hpp b/hotspot/src/share/vm/classfile/classFileParser.hpp
index b2efa8ceba3..c3d23df881c 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp
@@ -75,6 +75,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
Array* _inner_classes;
Array* _local_interfaces;
Array* _transitive_interfaces;
+ Annotations* _combined_annotations;
AnnotationArray* _annotations;
AnnotationArray* _type_annotations;
Array* _fields_annotations;
@@ -86,6 +87,8 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
void set_class_generic_signature_index(u2 x) { _generic_signature_index = x; }
void set_class_sde_buffer(char* x, int len) { _sde_buffer = x; _sde_length = len; }
+ void create_combined_annotations(TRAPS);
+
void init_parsed_class_attributes(ClassLoaderData* loader_data) {
_loader_data = loader_data;
_synthetic_flag = false;
@@ -110,6 +113,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
_inner_classes = NULL;
_local_interfaces = NULL;
_transitive_interfaces = NULL;
+ _combined_annotations = NULL;
_annotations = _type_annotations = NULL;
_fields_annotations = _fields_type_annotations = NULL;
}
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index 95d8937d1d1..885063288be 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -28,6 +28,7 @@
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/classLoaderData.inline.hpp"
+#include "classfile/imageFile.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
@@ -68,7 +69,7 @@
#endif
-// Entry points in zip.dll for loading zip/jar file entries
+// Entry points in zip.dll for loading zip/jar file entries and image file entries
typedef void * * (JNICALL *ZipOpen_t)(const char *name, char **pmsg);
typedef void (JNICALL *ZipClose_t)(jzfile *zip);
@@ -76,6 +77,7 @@ typedef jzentry* (JNICALL *FindEntry_t)(jzfile *zip, const char *name, jint *siz
typedef jboolean (JNICALL *ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
typedef jboolean (JNICALL *ReadMappedEntry_t)(jzfile *zip, jzentry *entry, unsigned char **buf, char *namebuf);
typedef jzentry* (JNICALL *GetNextEntry_t)(jzfile *zip, jint n);
+typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
typedef jint (JNICALL *Crc32_t)(jint crc, const jbyte *buf, jint len);
static ZipOpen_t ZipOpen = NULL;
@@ -85,6 +87,7 @@ static ReadEntry_t ReadEntry = NULL;
static ReadMappedEntry_t ReadMappedEntry = NULL;
static GetNextEntry_t GetNextEntry = NULL;
static canonicalize_fn_t CanonicalizeEntry = NULL;
+static ZipInflateFully_t ZipInflateFully = NULL;
static Crc32_t Crc32 = NULL;
// Globals
@@ -323,6 +326,8 @@ LazyClassPathEntry::~LazyClassPathEntry() {
}
bool LazyClassPathEntry::is_jar_file() {
+ size_t len = strlen(_path);
+ if (len < 4 || strcmp(_path + len - 4, ".jar") != 0) return false;
return ((_st.st_mode & S_IFREG) == S_IFREG);
}
@@ -386,6 +391,78 @@ u1* LazyClassPathEntry::open_entry(const char* name, jint* filesize, bool nul_te
}
}
+ClassPathImageEntry::ClassPathImageEntry(char* name) : ClassPathEntry(), _image(new ImageFile(name)) {
+ bool opened = _image->open();
+ if (!opened) {
+ _image = NULL;
+ }
+}
+
+ClassPathImageEntry::~ClassPathImageEntry() {
+ if (_image) {
+ _image->close();
+ _image = NULL;
+ }
+}
+
+const char* ClassPathImageEntry::name() {
+ return _image ? _image->name() : "";
+}
+
+ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) {
+ u1* buffer;
+ u8 size;
+ _image->get_resource(name, buffer, size);
+
+ if (buffer) {
+ if (UsePerfData) {
+ ClassLoader::perf_sys_classfile_bytes_read()->inc(size);
+ }
+ return new ClassFileStream(buffer, (int)size, (char*)name); // Resource allocated
+ }
+
+ return NULL;
+}
+
+#ifndef PRODUCT
+void ClassPathImageEntry::compile_the_world(Handle loader, TRAPS) {
+ tty->print_cr("CompileTheWorld : Compiling all classes in %s", name());
+ tty->cr();
+ const ImageStrings strings = _image->get_strings();
+ // Retrieve each path component string.
+ u4 count = _image->get_location_count();
+ for (u4 i = 0; i < count; i++) {
+ u1* location_data = _image->get_location_data(i);
+
+ if (location_data) {
+ ImageLocation location(location_data);
+ const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
+ const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
+ const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
+ assert((strlen(parent) + strlen(base) + strlen(extension)) < JVM_MAXPATHLEN, "path exceeds buffer");
+ char path[JVM_MAXPATHLEN];
+ strcpy(path, parent);
+ strcat(path, base);
+ strcat(path, extension);
+ ClassLoader::compile_the_world_in(path, loader, CHECK);
+ }
+ }
+ if (HAS_PENDING_EXCEPTION) {
+ if (PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
+ CLEAR_PENDING_EXCEPTION;
+ tty->print_cr("\nCompileTheWorld : Ran out of memory\n");
+ tty->print_cr("Increase class metadata storage if a limit was set");
+ } else {
+ tty->print_cr("\nCompileTheWorld : Unexpected exception occurred\n");
+ }
+ }
+}
+
+bool ClassPathImageEntry::is_jrt() {
+ return string_ends_with(name(), "bootmodules.jimage");
+}
+#endif
+
static void print_meta_index(LazyClassPathEntry* entry,
GrowableArray& meta_packages) {
tty->print("[Meta index for %s=", entry->name());
@@ -635,7 +712,7 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
}
ClassPathEntry* new_entry = NULL;
if ((st->st_mode & S_IFREG) == S_IFREG) {
- // Regular file, should be a zip file
+ // Regular file, should be a zip or image file
// Canonicalized filename
char canonical_path[JVM_MAXPATHLEN];
if (!get_canonical_path(path, canonical_path, JVM_MAXPATHLEN)) {
@@ -646,6 +723,11 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
return NULL;
}
}
+ // TODO - add proper criteria for selecting image file
+ ClassPathImageEntry* entry = new ClassPathImageEntry(canonical_path);
+ if (entry->is_open()) {
+ new_entry = entry;
+ } else {
char* error_msg = NULL;
jzfile* zip;
{
@@ -656,9 +738,6 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
}
if (zip != NULL && error_msg == NULL) {
new_entry = new ClassPathZipEntry(zip, path);
- if (TraceClassLoading || TraceClassPaths) {
- tty->print_cr("[Opened %s]", path);
- }
} else {
ResourceMark rm(thread);
char *msg;
@@ -676,10 +755,14 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
return NULL;
}
}
+ }
+ if (TraceClassLoading || TraceClassPaths) {
+ tty->print_cr("[Opened %s]", path);
+ }
} else {
// Directory
new_entry = new ClassPathDirEntry(path);
- if (TraceClassLoading || TraceClassPaths) {
+ if (TraceClassLoading) {
tty->print_cr("[Path %s]", path);
}
}
@@ -802,6 +885,7 @@ void ClassLoader::load_zip_library() {
ReadEntry = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry"));
ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry"));
GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry"));
+ ZipInflateFully = CAST_TO_FN_PTR(ZipInflateFully_t, os::dll_lookup(handle, "ZIP_InflateFully"));
Crc32 = CAST_TO_FN_PTR(Crc32_t, os::dll_lookup(handle, "ZIP_CRC32"));
// ZIP_Close is not exported on Windows in JDK5.0 so don't abort if ZIP_Close is NULL
@@ -810,12 +894,20 @@ void ClassLoader::load_zip_library() {
vm_exit_during_initialization("Corrupted ZIP library", path);
}
+ if (ZipInflateFully == NULL) {
+ vm_exit_during_initialization("Corrupted ZIP library ZIP_InflateFully missing", path);
+ }
+
// Lookup canonicalize entry in libjava.dll
void *javalib_handle = os::native_java_library();
CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, os::dll_lookup(javalib_handle, "Canonicalize"));
// This lookup only works on 1.3. Do not check for non-null here
}
+jboolean ClassLoader::decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg) {
+ return (*ZipInflateFully)(in, inSize, out, outSize, pmsg);
+}
+
int ClassLoader::crc32(int crc, const char* buf, int len) {
assert(Crc32 != NULL, "ZIP_CRC32 is not found");
return (*Crc32)(crc, (const jbyte*)buf, len);
@@ -1368,8 +1460,7 @@ void ClassPathDirEntry::compile_the_world(Handle loader, TRAPS) {
tty->cr();
}
-
-bool ClassPathDirEntry::is_rt_jar() {
+bool ClassPathDirEntry::is_jrt() {
return false;
}
@@ -1394,13 +1485,13 @@ void ClassPathZipEntry::compile_the_world(Handle loader, TRAPS) {
}
}
-bool ClassPathZipEntry::is_rt_jar() {
+bool ClassPathZipEntry::is_jrt() {
real_jzfile* zip = (real_jzfile*) _zip;
int len = (int)strlen(zip->name);
// Check whether zip name ends in "rt.jar"
// This will match other archives named rt.jar as well, but this is
// only used for debugging.
- return (len >= 6) && (strcasecmp(zip->name + len - 6, "rt.jar") == 0);
+ return string_ends_with(zip->name, "rt.jar");
}
void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
@@ -1410,7 +1501,7 @@ void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
}
}
-bool LazyClassPathEntry::is_rt_jar() {
+bool LazyClassPathEntry::is_jrt() {
Thread* THREAD = Thread::current();
ClassPathEntry* cpe = resolve_entry(THREAD);
return (cpe != NULL) ? cpe->is_jar_file() : false;
@@ -1429,7 +1520,7 @@ void ClassLoader::compile_the_world() {
jlong start = os::javaTimeMillis();
while (e != NULL) {
// We stop at rt.jar, unless it is the first bootstrap path entry
- if (e->is_rt_jar() && e != _first_entry) break;
+ if (e->is_jrt() && e != _first_entry) break;
e->compile_the_world(system_class_loader, CATCH);
e = e->next();
}
@@ -1477,9 +1568,9 @@ static bool can_be_compiled(methodHandle m, int comp_level) {
}
void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
- int len = (int)strlen(name);
- if (len > 6 && strcmp(".class", name + len - 6) == 0) {
+ if (string_ends_with(name, ".class")) {
// We have a .class file
+ int len = (int)strlen(name);
char buffer[2048];
strncpy(buffer, name, len - 6);
buffer[len-6] = 0;
diff --git a/hotspot/src/share/vm/classfile/classLoader.hpp b/hotspot/src/share/vm/classfile/classLoader.hpp
index ba9c02acfdc..ef91d3769ce 100644
--- a/hotspot/src/share/vm/classfile/classLoader.hpp
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp
@@ -67,7 +67,7 @@ class ClassPathEntry: public CHeapObj {
virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
// Debugging
NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
- NOT_PRODUCT(virtual bool is_rt_jar() = 0;)
+ NOT_PRODUCT(virtual bool is_jrt() = 0;)
};
@@ -81,7 +81,7 @@ class ClassPathDirEntry: public ClassPathEntry {
ClassFileStream* open_stream(const char* name, TRAPS);
// Debugging
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
- NOT_PRODUCT(bool is_rt_jar();)
+ NOT_PRODUCT(bool is_jrt();)
};
@@ -113,7 +113,7 @@ class ClassPathZipEntry: public ClassPathEntry {
void contents_do(void f(const char* name, void* context), void* context);
// Debugging
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
- NOT_PRODUCT(bool is_rt_jar();)
+ NOT_PRODUCT(bool is_jrt();)
};
@@ -139,7 +139,25 @@ class LazyClassPathEntry: public ClassPathEntry {
virtual bool is_lazy();
// Debugging
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
- NOT_PRODUCT(bool is_rt_jar();)
+ NOT_PRODUCT(bool is_jrt();)
+};
+
+// For java image files
+class ImageFile;
+class ClassPathImageEntry: public ClassPathEntry {
+private:
+ ImageFile *_image;
+public:
+ bool is_jar_file() { return false; }
+ bool is_open() { return _image != NULL; }
+ const char* name();
+ ClassPathImageEntry(char* name);
+ ~ClassPathImageEntry();
+ ClassFileStream* open_stream(const char* name, TRAPS);
+
+ // Debugging
+ NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
+ NOT_PRODUCT(bool is_jrt();)
};
class PackageHashtable;
@@ -227,6 +245,7 @@ class ClassLoader: AllStatic {
// to avoid confusing the zip library
static bool get_canonical_path(const char* orig, char* out, int len);
public:
+ static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg);
static int crc32(int crc, const char* buf, int len);
static bool update_class_path_entry_list(const char *path,
bool check_for_duplicates,
diff --git a/hotspot/src/share/vm/classfile/imageFile.cpp b/hotspot/src/share/vm/classfile/imageFile.cpp
new file mode 100644
index 00000000000..d83f95eb2ff
--- /dev/null
+++ b/hotspot/src/share/vm/classfile/imageFile.cpp
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "classfile/imageFile.hpp"
+#include "runtime/os.inline.hpp"
+#include "utilities/bytes.hpp"
+
+
+// Compute the Perfect Hashing hash code for the supplied string.
+u4 ImageStrings::hash_code(const char* string, u4 seed) {
+ u1* bytes = (u1*)string;
+
+ // Compute hash code.
+ for (u1 byte = *bytes++; byte; byte = *bytes++) {
+ seed = (seed * HASH_MULTIPLIER) ^ byte;
+ }
+
+ // Ensure the result is unsigned.
+ return seed & 0x7FFFFFFF;
+}
+
+// Test to see if string begins with start. If so returns remaining portion
+// of string. Otherwise, NULL.
+const char* ImageStrings::starts_with(const char* string, const char* start) {
+ char ch1, ch2;
+
+ // Match up the strings the best we can.
+ while ((ch1 = *string) && (ch2 = *start)) {
+ if (ch1 != ch2) {
+ // Mismatch, return NULL.
+ return NULL;
+ }
+
+ string++, start++;
+ }
+
+ // Return remainder of string.
+ return string;
+}
+
+ImageLocation::ImageLocation(u1* data) {
+ // Deflate the attribute stream into an array of attributes.
+ memset(_attributes, 0, sizeof(_attributes));
+ u1 byte;
+
+ while ((byte = *data) != ATTRIBUTE_END) {
+ u1 kind = attribute_kind(byte);
+ u1 n = attribute_length(byte);
+ assert(kind < ATTRIBUTE_COUNT, "invalid image location attribute");
+ _attributes[kind] = attribute_value(data + 1, n);
+ data += n + 1;
+ }
+}
+
+ImageFile::ImageFile(const char* name) {
+ // Copy the image file name.
+ _name = NEW_C_HEAP_ARRAY(char, strlen(name)+1, mtClass);
+ strcpy(_name, name);
+
+ // Initialize for a closed file.
+ _fd = -1;
+ _memory_mapped = true;
+ _index_data = NULL;
+}
+
+ImageFile::~ImageFile() {
+ // Ensure file is closed.
+ close();
+
+ // Free up name.
+ FREE_C_HEAP_ARRAY(char, _name);
+}
+
+bool ImageFile::open() {
+ // If file exists open for reading.
+ struct stat st;
+ if (os::stat(_name, &st) != 0 ||
+ (st.st_mode & S_IFREG) != S_IFREG ||
+ (_fd = os::open(_name, 0, O_RDONLY)) == -1) {
+ return false;
+ }
+
+ // Read image file header and verify.
+ u8 header_size = sizeof(ImageHeader);
+ if (os::read(_fd, &_header, header_size) != header_size ||
+ _header._magic != IMAGE_MAGIC ||
+ _header._major_version != MAJOR_VERSION ||
+ _header._minor_version != MINOR_VERSION) {
+ close();
+ return false;
+ }
+
+ // Memory map index.
+ _index_size = index_size();
+ _index_data = (u1*)os::map_memory(_fd, _name, 0, NULL, _index_size, true, false);
+
+ // Failing that, read index into C memory.
+ if (_index_data == NULL) {
+ _memory_mapped = false;
+ _index_data = NEW_RESOURCE_ARRAY(u1, _index_size);
+
+ if (os::seek_to_file_offset(_fd, 0) == -1) {
+ close();
+ return false;
+ }
+
+ if (os::read(_fd, _index_data, _index_size) != _index_size) {
+ close();
+ return false;
+ }
+
+ return true;
+ }
+
+// Used to advance a pointer, unstructured.
+#undef nextPtr
+#define nextPtr(base, fromType, count, toType) (toType*)((fromType*)(base) + (count))
+ // Pull tables out from the index.
+ _redirect_table = nextPtr(_index_data, u1, header_size, s4);
+ _offsets_table = nextPtr(_redirect_table, s4, _header._location_count, u4);
+ _location_bytes = nextPtr(_offsets_table, u4, _header._location_count, u1);
+ _string_bytes = nextPtr(_location_bytes, u1, _header._locations_size, u1);
+#undef nextPtr
+
+ // Successful open.
+ return true;
+}
+
+void ImageFile::close() {
+ // Dealllocate the index.
+ if (_index_data) {
+ if (_memory_mapped) {
+ os::unmap_memory((char*)_index_data, _index_size);
+ } else {
+ FREE_RESOURCE_ARRAY(u1, _index_data, _index_size);
+ }
+
+ _index_data = NULL;
+ }
+
+ // close file.
+ if (_fd != -1) {
+ os::close(_fd);
+ _fd = -1;
+ }
+
+}
+
+// Return the attribute stream for a named resourced.
+u1* ImageFile::find_location_data(const char* path) const {
+ // Compute hash.
+ u4 hash = ImageStrings::hash_code(path) % _header._location_count;
+ s4 redirect = _redirect_table[hash];
+
+ if (!redirect) {
+ return NULL;
+ }
+
+ u4 index;
+
+ if (redirect < 0) {
+ // If no collision.
+ index = -redirect - 1;
+ } else {
+ // If collision, recompute hash code.
+ index = ImageStrings::hash_code(path, redirect) % _header._location_count;
+ }
+
+ assert(index < _header._location_count, "index exceeds location count");
+ u4 offset = _offsets_table[index];
+ assert(offset < _header._locations_size, "offset exceeds location attributes size");
+
+ if (offset == 0) {
+ return NULL;
+ }
+
+ return _location_bytes + offset;
+}
+
+// Verify that a found location matches the supplied path.
+bool ImageFile::verify_location(ImageLocation& location, const char* path) const {
+ // Retrieve each path component string.
+ ImageStrings strings(_string_bytes, _header._strings_size);
+ // Match a path with each subcomponent without concatenation (copy).
+ // Match up path parent.
+ const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
+ const char* next = ImageStrings::starts_with(path, parent);
+ // Continue only if a complete match.
+ if (!next) return false;
+ // Match up path base.
+ const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
+ next = ImageStrings::starts_with(next, base);
+ // Continue only if a complete match.
+ if (!next) return false;
+ // Match up path extension.
+ const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
+ next = ImageStrings::starts_with(next, extension);
+
+ // True only if complete match and no more characters.
+ return next && *next == '\0';
+}
+
+// Return the resource for the supplied location.
+u1* ImageFile::get_resource(ImageLocation& location) const {
+ // Retrieve the byte offset and size of the resource.
+ u8 offset = _index_size + location.get_attribute(ImageLocation::ATTRIBUTE_OFFSET);
+ u8 size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+ u8 compressed_size = location.get_attribute(ImageLocation::ATTRIBUTE_COMPRESSED);
+ u8 read_size = compressed_size ? compressed_size : size;
+
+ // Allocate space for the resource.
+ u1* data = NEW_RESOURCE_ARRAY(u1, read_size);
+
+ bool is_read = os::read_at(_fd, data, read_size, offset) == read_size;
+ guarantee(is_read, "error reading from image or short read");
+
+ // If not compressed, just return the data.
+ if (!compressed_size) {
+ return data;
+ }
+
+ u1* uncompressed = NEW_RESOURCE_ARRAY(u1, size);
+ char* msg = NULL;
+ jboolean res = ClassLoader::decompress(data, compressed_size, uncompressed, size, &msg);
+ if (!res) warning("decompression failed due to %s\n", msg);
+ guarantee(res, "decompression failed");
+
+ return uncompressed;
+}
+
+void ImageFile::get_resource(const char* path, u1*& buffer, u8& size) const {
+ buffer = NULL;
+ size = 0;
+ u1* data = find_location_data(path);
+ if (data) {
+ ImageLocation location(data);
+ if (verify_location(location, path)) {
+ size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
+ buffer = get_resource(location);
+ }
+ }
+}
+
+GrowableArray* ImageFile::packages(const char* name) {
+ char entry[JVM_MAXPATHLEN];
+ bool overflow = jio_snprintf(entry, sizeof(entry), "%s/packages.offsets", name) == -1;
+ guarantee(!overflow, "package name overflow");
+
+ u1* buffer;
+ u8 size;
+
+ get_resource(entry, buffer, size);
+ guarantee(buffer, "missing module packages reource");
+ ImageStrings strings(_string_bytes, _header._strings_size);
+ GrowableArray* pkgs = new GrowableArray();
+ int count = size / 4;
+ for (int i = 0; i < count; i++) {
+ u4 offset = Bytes::get_Java_u4(buffer + (i*4));
+ const char* p = strings.get(offset);
+ pkgs->append(p);
+ }
+
+ return pkgs;
+}
diff --git a/hotspot/src/share/vm/classfile/imageFile.hpp b/hotspot/src/share/vm/classfile/imageFile.hpp
new file mode 100644
index 00000000000..d5ae6d597af
--- /dev/null
+++ b/hotspot/src/share/vm/classfile/imageFile.hpp
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_IMAGEFILE_HPP
+#define SHARE_VM_CLASSFILE_IMAGEFILE_HPP
+
+#include "classfile/classLoader.hpp"
+#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+// Image files are an alternate file format for storing classes and resources. The
+// goal is to supply file access which is faster and smaller that the jar format.
+// It should be noted that unlike jars information stored in an image is in native
+// endian format. This allows the image to be memory mapped into memory without
+// endian translation. This also means that images are platform dependent.
+//
+// Image files are structured as three sections;
+//
+// +-----------+
+// | Header |
+// +-----------+
+// | |
+// | Directory |
+// | |
+// +-----------+
+// | |
+// | |
+// | Resources |
+// | |
+// | |
+// +-----------+
+//
+// The header contains information related to identification and description of
+// contents.
+//
+// +-------------------------+
+// | Magic (0xCAFEDADA) |
+// +------------+------------+
+// | Major Vers | Minor Vers |
+// +------------+------------+
+// | Location Count |
+// +-------------------------+
+// | Attributes Size |
+// +-------------------------+
+// | Strings Size |
+// +-------------------------+
+//
+// Magic - means of identifying validity of the file. This avoids requiring a
+// special file extension.
+// Major vers, minor vers - differences in version numbers indicate structural
+// changes in the image.
+// Location count - number of locations/resources in the file. This count is also
+// the length of lookup tables used in the directory.
+// Attributes size - number of bytes in the region used to store location attribute
+// streams.
+// Strings size - the size of the region used to store strings used by the
+// directory and meta data.
+//
+// The directory contains information related to resource lookup. The algorithm
+// used for lookup is "A Practical Minimal Perfect Hashing Method"
+// (http://homepages.dcc.ufmg.br/~nivio/papers/wea05.pdf). Given a path string
+// in the form /. return the resource location
+// information;
+//
+// redirectIndex = hash(path, DEFAULT_SEED) % count;
+// redirect = redirectTable[redirectIndex];
+// if (redirect == 0) return not found;
+// locationIndex = redirect < 0 ? -1 - redirect : hash(path, redirect) % count;
+// location = locationTable[locationIndex];
+// if (!verify(location, path)) return not found;
+// return location;
+//
+// Note: The hash function takes an initial seed value. A different seed value
+// usually returns a different result for strings that would otherwise collide with
+// other seeds. The verify function guarantees the found resource location is
+// indeed the resource we are looking for.
+//
+// The following is the format of the directory;
+//
+// +-------------------+
+// | Redirect Table |
+// +-------------------+
+// | Attribute Offsets |
+// +-------------------+
+// | Attribute Data |
+// +-------------------+
+// | Strings |
+// +-------------------+
+//
+// Redirect Table - Array of 32-bit signed values representing actions that
+// should take place for hashed strings that map to that
+// value. Negative values indicate no hash collision and can be
+// quickly converted to indices into attribute offsets. Positive
+// values represent a new seed for hashing an index into attribute
+// offsets. Zero indicates not found.
+// Attribute Offsets - Array of 32-bit unsigned values representing offsets into
+// attribute data. Attribute offsets can be iterated to do a
+// full survey of resources in the image.
+// Attribute Data - Bytes representing compact attribute data for locations. (See
+// comments in ImageLocation.)
+// Strings - Collection of zero terminated UTF-8 strings used by the directory and
+// image meta data. Each string is accessed by offset. Each string is
+// unique. Offset zero is reserved for the empty string.
+//
+// Note that the memory mapped directory assumes 32 bit alignment of the image
+// header, the redirect table and the attribute offsets.
+//
+
+
+// Manage image file string table.
+class ImageStrings {
+private:
+ // Data bytes for strings.
+ u1* _data;
+ // Number of bytes in the string table.
+ u4 _size;
+
+public:
+ // Prime used to generate hash for Perfect Hashing.
+ static const u4 HASH_MULTIPLIER = 0x01000193;
+
+ ImageStrings(u1* data, u4 size) : _data(data), _size(size) {}
+
+ // Return the UTF-8 string beginning at offset.
+ inline const char* get(u4 offset) const {
+ assert(offset < _size, "offset exceeds string table size");
+ return (const char*)(_data + offset);
+ }
+
+ // Compute the Perfect Hashing hash code for the supplied string.
+ inline static u4 hash_code(const char* string) {
+ return hash_code(string, HASH_MULTIPLIER);
+ }
+
+ // Compute the Perfect Hashing hash code for the supplied string, starting at seed.
+ static u4 hash_code(const char* string, u4 seed);
+
+ // Test to see if string begins with start. If so returns remaining portion
+ // of string. Otherwise, NULL. Used to test sections of a path without
+ // copying.
+ static const char* starts_with(const char* string, const char* start);
+
+};
+
+// Manage image file location attribute streams. Within an image, a location's
+// attributes are compressed into a stream of bytes. An attribute stream is
+// composed of individual attribute sequences. Each attribute sequence begins with
+// a header byte containing the attribute 'kind' (upper 5 bits of header) and the
+// 'length' less 1 (lower 3 bits of header) of bytes that follow containing the
+// attribute value. Attribute values present as most significant byte first.
+//
+// Ex. Container offset (ATTRIBUTE_OFFSET) 0x33562 would be represented as 0x22
+// (kind = 4, length = 3), 0x03, 0x35, 0x62.
+//
+// An attribute stream is terminated with a header kind of ATTRIBUTE_END (header
+// byte of zero.)
+//
+// ImageLocation inflates the stream into individual values stored in the long
+// array _attributes. This allows an attribute value can be quickly accessed by
+// direct indexing. Unspecified values default to zero.
+//
+// Notes:
+// - Even though ATTRIBUTE_END is used to mark the end of the attribute stream,
+// streams will contain zero byte values to represent lesser significant bits.
+// Thus, detecting a zero byte is not sufficient to detect the end of an attribute
+// stream.
+// - ATTRIBUTE_OFFSET represents the number of bytes from the beginning of the region
+// storing the resources. Thus, in an image this represents the number of bytes
+// after the directory.
+// - Currently, compressed resources are represented by having a non-zero
+// ATTRIBUTE_COMPRESSED value. This represents the number of bytes stored in the
+// image, and the value of ATTRIBUTE_UNCOMPRESSED represents number of bytes of the
+// inflated resource in memory. If the ATTRIBUTE_COMPRESSED is zero then the value
+// of ATTRIBUTE_UNCOMPRESSED represents both the number of bytes in the image and
+// in memory. In the future, additional compression techniques will be used and
+// represented differently.
+// - Package strings include trailing slash and extensions include prefix period.
+//
+class ImageLocation {
+public:
+ // Attribute kind enumeration.
+ static const u1 ATTRIBUTE_END = 0; // End of attribute stream marker
+ static const u1 ATTRIBUTE_BASE = 1; // String table offset of resource path base
+ static const u1 ATTRIBUTE_PARENT = 2; // String table offset of resource path parent
+ static const u1 ATTRIBUTE_EXTENSION = 3; // String table offset of resource path extension
+ static const u1 ATTRIBUTE_OFFSET = 4; // Container byte offset of resource
+ static const u1 ATTRIBUTE_COMPRESSED = 5; // In image byte size of the compressed resource
+ static const u1 ATTRIBUTE_UNCOMPRESSED = 6; // In memory byte size of the uncompressed resource
+ static const u1 ATTRIBUTE_COUNT = 7; // Number of attribute kinds
+
+private:
+ // Values of inflated attributes.
+ u8 _attributes[ATTRIBUTE_COUNT];
+
+ // Return the attribute value number of bytes.
+ inline static u1 attribute_length(u1 data) {
+ return (data & 0x7) + 1;
+ }
+
+ // Return the attribute kind.
+ inline static u1 attribute_kind(u1 data) {
+ u1 kind = data >> 3;
+ assert(kind < ATTRIBUTE_COUNT, "invalid attribute kind");
+ return kind;
+ }
+
+ // Return the attribute length.
+ inline static u8 attribute_value(u1* data, u1 n) {
+ assert(0 < n && n <= 8, "invalid attribute value length");
+ u8 value = 0;
+
+ // Most significant bytes first.
+ for (u1 i = 0; i < n; i++) {
+ value <<= 8;
+ value |= data[i];
+ }
+
+ return value;
+ }
+
+public:
+ ImageLocation(u1* data);
+
+ // Retrieve an attribute value from the inflated array.
+ inline u8 get_attribute(u1 kind) const {
+ assert(ATTRIBUTE_END < kind && kind < ATTRIBUTE_COUNT, "invalid attribute kind");
+ return _attributes[kind];
+ }
+
+ // Retrieve an attribute string value from the inflated array.
+ inline const char* get_attribute(u4 kind, const ImageStrings& strings) const {
+ return strings.get((u4)get_attribute(kind));
+ }
+};
+
+// Manage the image file.
+class ImageFile: public CHeapObj {
+private:
+ // Image file marker.
+ static const u4 IMAGE_MAGIC = 0xCAFEDADA;
+ // Image file major version number.
+ static const u2 MAJOR_VERSION = 0;
+ // Image file minor version number.
+ static const u2 MINOR_VERSION = 1;
+
+ struct ImageHeader {
+ u4 _magic; // Image file marker
+ u2 _major_version; // Image file major version number
+ u2 _minor_version; // Image file minor version number
+ u4 _location_count; // Number of locations managed in index.
+ u4 _locations_size; // Number of bytes in attribute table.
+ u4 _strings_size; // Number of bytes in string table.
+ };
+
+ char* _name; // Name of image
+ int _fd; // File descriptor
+ bool _memory_mapped; // Is file memory mapped
+ ImageHeader _header; // Image header
+ u8 _index_size; // Total size of index
+ u1* _index_data; // Raw index data
+ s4* _redirect_table; // Perfect hash redirect table
+ u4* _offsets_table; // Location offset table
+ u1* _location_bytes; // Location attributes
+ u1* _string_bytes; // String table
+
+ // Compute number of bytes in image file index.
+ inline u8 index_size() {
+ return sizeof(ImageHeader) +
+ _header._location_count * sizeof(u4) * 2 +
+ _header._locations_size +
+ _header._strings_size;
+ }
+
+public:
+ ImageFile(const char* name);
+ ~ImageFile();
+
+ // Open image file for access.
+ bool open();
+ // Close image file.
+ void close();
+
+ // Retrieve name of image file.
+ inline const char* name() const {
+ return _name;
+ }
+
+ // Return a string table accessor.
+ inline const ImageStrings get_strings() const {
+ return ImageStrings(_string_bytes, _header._strings_size);
+ }
+
+ // Return number of locations in image file index.
+ inline u4 get_location_count() const {
+ return _header._location_count;
+ }
+
+ // Return location attribute stream for location i.
+ inline u1* get_location_data(u4 i) const {
+ u4 offset = _offsets_table[i];
+
+ return offset != 0 ? _location_bytes + offset : NULL;
+ }
+
+ // Return the attribute stream for a named resourced.
+ u1* find_location_data(const char* path) const;
+
+ // Verify that a found location matches the supplied path.
+ bool verify_location(ImageLocation& location, const char* path) const;
+
+ // Return the resource for the supplied location info.
+ u1* get_resource(ImageLocation& location) const;
+
+ // Return the resource associated with the path else NULL if not found.
+ void get_resource(const char* path, u1*& buffer, u8& size) const;
+
+ // Return an array of packages for a given module
+ GrowableArray* packages(const char* name);
+};
+
+#endif // SHARE_VM_CLASSFILE_IMAGEFILE_HPP
diff --git a/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp b/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp
index 79457a0e5e2..9bb82f7fd19 100644
--- a/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp
+++ b/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp
@@ -110,7 +110,7 @@ bool SharedPathsMiscInfo::check() {
bool SharedPathsMiscInfo::check(jint type, const char* path) {
switch (type) {
case BOOT:
- if (strcmp(path, Arguments::get_sysclasspath()) != 0) {
+ if (os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) {
return fail("[BOOT classpath mismatch, actual: -Dsun.boot.class.path=", Arguments::get_sysclasspath());
}
break;
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index d6d054d184e..b687ab40096 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -793,11 +793,6 @@ void ConcurrentMarkSweepGeneration::promotion_failure_occurred() {
}
}
-CompactibleSpace*
-ConcurrentMarkSweepGeneration::first_compaction_space() const {
- return _cmsSpace;
-}
-
void ConcurrentMarkSweepGeneration::reset_after_compaction() {
// Clear the promotion information. These pointers can be adjusted
// along with all the other pointers into the heap but
@@ -808,10 +803,6 @@ void ConcurrentMarkSweepGeneration::reset_after_compaction() {
}
}
-void ConcurrentMarkSweepGeneration::space_iterate(SpaceClosure* blk, bool usedOnly) {
- blk->do_space(_cmsSpace);
-}
-
void ConcurrentMarkSweepGeneration::compute_new_size() {
assert_locked_or_safepoint(Heap_lock);
@@ -882,7 +873,7 @@ void ConcurrentMarkSweepGeneration::compute_new_size_free_list() {
expand_bytes);
}
// safe if expansion fails
- expand(expand_bytes, 0, CMSExpansionCause::_satisfy_free_ratio);
+ expand_for_gc_cause(expand_bytes, 0, CMSExpansionCause::_satisfy_free_ratio);
if (PrintGCDetails && Verbose) {
gclog_or_tty->print_cr(" Expanded free fraction %f",
((double) free()) / capacity());
@@ -1048,8 +1039,7 @@ oop ConcurrentMarkSweepGeneration::promote(oop obj, size_t obj_size) {
if (res == NULL) {
// expand and retry
size_t s = _cmsSpace->expansionSpaceRequired(obj_size); // HeapWords
- expand(s*HeapWordSize, MinHeapDeltaBytes,
- CMSExpansionCause::_satisfy_promotion);
+ expand_for_gc_cause(s*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_promotion);
// Since there's currently no next generation, we don't try to promote
// into a more senior generation.
assert(next_gen() == NULL, "assumption, based upon which no attempt "
@@ -2624,13 +2614,6 @@ oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl) { \
ALL_SINCE_SAVE_MARKS_CLOSURES(CMS_SINCE_SAVE_MARKS_DEFN)
-void
-ConcurrentMarkSweepGeneration::younger_refs_iterate(OopsInGenClosure* cl) {
- cl->set_generation(this);
- younger_refs_in_space_iterate(_cmsSpace, cl);
- cl->reset_generation();
-}
-
void
ConcurrentMarkSweepGeneration::oop_iterate(ExtendedOopClosure* cl) {
if (freelistLock()->owned_by_self()) {
@@ -2803,23 +2786,17 @@ ConcurrentMarkSweepGeneration::expand_and_allocate(size_t word_size,
CMSSynchronousYieldRequest yr;
assert(!tlab, "Can't deal with TLAB allocation");
MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag);
- expand(word_size*HeapWordSize, MinHeapDeltaBytes,
- CMSExpansionCause::_satisfy_allocation);
+ expand_for_gc_cause(word_size*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_allocation);
if (GCExpandToAllocateDelayMillis > 0) {
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
}
return have_lock_and_allocate(word_size, tlab);
}
-// YSR: All of this generation expansion/shrinking stuff is an exact copy of
-// TenuredGeneration, which makes me wonder if we should move this
-// to CardGeneration and share it...
-bool ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes) {
- return CardGeneration::expand(bytes, expand_bytes);
-}
-
-void ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes,
- CMSExpansionCause::Cause cause)
+void ConcurrentMarkSweepGeneration::expand_for_gc_cause(
+ size_t bytes,
+ size_t expand_bytes,
+ CMSExpansionCause::Cause cause)
{
bool success = expand(bytes, expand_bytes);
@@ -2848,8 +2825,7 @@ HeapWord* ConcurrentMarkSweepGeneration::expand_and_par_lab_allocate(CMSParGCThr
return NULL;
}
// Otherwise, we try expansion.
- expand(word_sz*HeapWordSize, MinHeapDeltaBytes,
- CMSExpansionCause::_allocate_par_lab);
+ expand_for_gc_cause(word_sz*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_allocate_par_lab);
// Now go around the loop and try alloc again;
// A competing par_promote might beat us to the expansion space,
// so we may go around the loop again if promotion fails again.
@@ -2876,8 +2852,7 @@ bool ConcurrentMarkSweepGeneration::expand_and_ensure_spooling_space(
return false;
}
// Otherwise, we try expansion.
- expand(refill_size_bytes, MinHeapDeltaBytes,
- CMSExpansionCause::_allocate_par_spooling_space);
+ expand_for_gc_cause(refill_size_bytes, MinHeapDeltaBytes, CMSExpansionCause::_allocate_par_spooling_space);
// Now go around the loop and try alloc again;
// A competing allocation might beat us to the expansion space,
// so we may go around the loop again if allocation fails again.
@@ -2887,77 +2862,16 @@ bool ConcurrentMarkSweepGeneration::expand_and_ensure_spooling_space(
}
}
-
-void ConcurrentMarkSweepGeneration::shrink_by(size_t bytes) {
- assert_locked_or_safepoint(ExpandHeap_lock);
- // Shrink committed space
- _virtual_space.shrink_by(bytes);
- // Shrink space; this also shrinks the space's BOT
- _cmsSpace->set_end((HeapWord*) _virtual_space.high());
- size_t new_word_size = heap_word_size(_cmsSpace->capacity());
- // Shrink the shared block offset array
- _bts->resize(new_word_size);
- MemRegion mr(_cmsSpace->bottom(), new_word_size);
- // Shrink the card table
- Universe::heap()->barrier_set()->resize_covered_region(mr);
-
- if (Verbose && PrintGC) {
- size_t new_mem_size = _virtual_space.committed_size();
- size_t old_mem_size = new_mem_size + bytes;
- gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
- name(), old_mem_size/K, new_mem_size/K);
- }
-}
-
void ConcurrentMarkSweepGeneration::shrink(size_t bytes) {
- assert_locked_or_safepoint(Heap_lock);
- size_t size = ReservedSpace::page_align_size_down(bytes);
// Only shrink if a compaction was done so that all the free space
// in the generation is in a contiguous block at the end.
- if (size > 0 && did_compact()) {
- shrink_by(size);
+ if (did_compact()) {
+ CardGeneration::shrink(bytes);
}
}
-bool ConcurrentMarkSweepGeneration::grow_by(size_t bytes) {
+void ConcurrentMarkSweepGeneration::assert_correct_size_change_locking() {
assert_locked_or_safepoint(Heap_lock);
- bool result = _virtual_space.expand_by(bytes);
- if (result) {
- size_t new_word_size =
- heap_word_size(_virtual_space.committed_size());
- MemRegion mr(_cmsSpace->bottom(), new_word_size);
- _bts->resize(new_word_size); // resize the block offset shared array
- Universe::heap()->barrier_set()->resize_covered_region(mr);
- // Hmmmm... why doesn't CFLS::set_end verify locking?
- // This is quite ugly; FIX ME XXX
- _cmsSpace->assert_locked(freelistLock());
- _cmsSpace->set_end((HeapWord*)_virtual_space.high());
-
- // update the space and generation capacity counters
- if (UsePerfData) {
- _space_counters->update_capacity();
- _gen_counters->update_all();
- }
-
- if (Verbose && PrintGC) {
- size_t new_mem_size = _virtual_space.committed_size();
- size_t old_mem_size = new_mem_size - bytes;
- gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
- name(), old_mem_size/K, bytes/K, new_mem_size/K);
- }
- }
- return result;
-}
-
-bool ConcurrentMarkSweepGeneration::grow_to_reserved() {
- assert_locked_or_safepoint(Heap_lock);
- bool success = true;
- const size_t remaining_bytes = _virtual_space.uncommitted_size();
- if (remaining_bytes > 0) {
- success = grow_by(remaining_bytes);
- DEBUG_ONLY(if (!success) warning("grow to reserved failed");)
- }
- return success;
}
void ConcurrentMarkSweepGeneration::shrink_free_list_by(size_t bytes) {
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index 826cfd5def2..57402455a82 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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,9 +30,10 @@
#include "gc_implementation/shared/gcStats.hpp"
#include "gc_implementation/shared/gcWhen.hpp"
#include "gc_implementation/shared/generationCounters.hpp"
+#include "memory/cardGeneration.hpp"
#include "memory/freeBlockDictionary.hpp"
-#include "memory/generation.hpp"
#include "memory/iterator.hpp"
+#include "memory/space.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/virtualspace.hpp"
#include "services/memoryService.hpp"
@@ -171,9 +172,7 @@ class CMSBitMap VALUE_OBJ_CLASS_SPEC {
// Represents a marking stack used by the CMS collector.
// Ideally this should be GrowableArray<> just like MSC's marking stack(s).
class CMSMarkStack: public CHeapObj {
- //
friend class CMSCollector; // To get at expansion stats further below.
- //
VirtualSpace _virtual_space; // Space for the stack
oop* _base; // Bottom of stack
@@ -1031,6 +1030,9 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
void set_expansion_cause(CMSExpansionCause::Cause v) { _expansion_cause = v;}
CMSExpansionCause::Cause expansion_cause() const { return _expansion_cause; }
+ // Accessing spaces
+ CompactibleSpace* space() const { return (CompactibleSpace*)_cmsSpace; }
+
private:
// For parallel young-gen GC support.
CMSParGCThreadState** _par_gc_thread_states;
@@ -1064,6 +1066,10 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
double initiating_occupancy() const { return _initiating_occupancy; }
void init_initiating_occupancy(intx io, uintx tr);
+ void expand_for_gc_cause(size_t bytes, size_t expand_bytes, CMSExpansionCause::Cause cause);
+
+ void assert_correct_size_change_locking();
+
public:
ConcurrentMarkSweepGeneration(ReservedSpace rs, size_t initial_byte_size,
int level, CardTableRS* ct,
@@ -1100,23 +1106,14 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
// Override
virtual void ref_processor_init();
- // Grow generation by specified size (returns false if unable to grow)
- bool grow_by(size_t bytes);
- // Grow generation to reserved size.
- bool grow_to_reserved();
-
void clear_expansion_cause() { _expansion_cause = CMSExpansionCause::_no_expansion; }
// Space enquiries
- size_t capacity() const;
- size_t used() const;
- size_t free() const;
double occupancy() const { return ((double)used())/((double)capacity()); }
size_t contiguous_available() const;
size_t unsafe_max_alloc_nogc() const;
// over-rides
- MemRegion used_region() const;
MemRegion used_region_at_save_marks() const;
// Does a "full" (forced) collection invoked on this generation collect
@@ -1127,10 +1124,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
return !ScavengeBeforeFullGC;
}
- void space_iterate(SpaceClosure* blk, bool usedOnly = false);
-
- // Support for compaction
- CompactibleSpace* first_compaction_space() const;
// Adjust quantities in the generation affected by
// the compaction.
void reset_after_compaction();
@@ -1190,18 +1183,13 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
}
// Allocation failure
- void expand(size_t bytes, size_t expand_bytes,
- CMSExpansionCause::Cause cause);
- virtual bool expand(size_t bytes, size_t expand_bytes);
void shrink(size_t bytes);
- void shrink_by(size_t bytes);
HeapWord* expand_and_par_lab_allocate(CMSParGCThreadState* ps, size_t word_sz);
bool expand_and_ensure_spooling_space(PromotionInfo* promo);
// Iteration support and related enquiries
void save_marks();
bool no_allocs_since_save_marks();
- void younger_refs_iterate(OopsInGenClosure* cl);
// Iteration support specific to CMS generations
void save_sweep_limit();
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp
index dc76d1bc884..bc552f78420 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -369,22 +369,6 @@ inline void ConcurrentMarkSweepGeneration::save_sweep_limit() {
cmsSpace()->save_sweep_limit();
}
-inline size_t ConcurrentMarkSweepGeneration::capacity() const {
- return _cmsSpace->capacity();
-}
-
-inline size_t ConcurrentMarkSweepGeneration::used() const {
- return _cmsSpace->used();
-}
-
-inline size_t ConcurrentMarkSweepGeneration::free() const {
- return _cmsSpace->free();
-}
-
-inline MemRegion ConcurrentMarkSweepGeneration::used_region() const {
- return _cmsSpace->used_region();
-}
-
inline MemRegion ConcurrentMarkSweepGeneration::used_region_at_save_marks() const {
return _cmsSpace->used_region_at_save_marks();
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 875ffdbc311..d50c456c3fc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -352,7 +352,7 @@ void YoungList::print() {
}
void G1RegionMappingChangedListener::reset_from_card_cache(uint start_idx, size_t num_regions) {
- OtherRegionsTable::invalidate(start_idx, num_regions);
+ HeapRegionRemSet::invalidate_from_card_cache(start_idx, num_regions);
}
void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
index 058426f4603..e04cc8ead7b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
@@ -407,20 +407,8 @@ void FromCardCache::clear(uint region_idx) {
}
}
-void OtherRegionsTable::initialize(uint max_regions) {
- FromCardCache::initialize(HeapRegionRemSet::num_par_rem_sets(), max_regions);
-}
-
-void OtherRegionsTable::invalidate(uint start_idx, size_t num_regions) {
- FromCardCache::invalidate(start_idx, num_regions);
-}
-
-void OtherRegionsTable::print_from_card_cache() {
- FromCardCache::print();
-}
-
void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
- uint cur_hrm_ind = hr()->hrm_index();
+ uint cur_hrm_ind = _hr->hrm_index();
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr("ORT::add_reference_work(" PTR_FORMAT "->" PTR_FORMAT ").",
@@ -434,7 +422,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr("Table for [" PTR_FORMAT "...): card %d (cache = %d)",
- hr()->bottom(), from_card,
+ _hr->bottom(), from_card,
FromCardCache::at(tid, cur_hrm_ind));
}
@@ -477,13 +465,13 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
if (G1HRRSUseSparseTable &&
_sparse_table.add_card(from_hrm_ind, card_index)) {
if (G1RecordHRRSOops) {
- HeapRegionRemSet::record(hr(), from);
+ HeapRegionRemSet::record(_hr, from);
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print(" Added card " PTR_FORMAT " to region "
"[" PTR_FORMAT "...) for ref " PTR_FORMAT ".\n",
align_size_down(uintptr_t(from),
CardTableModRefBS::card_size),
- hr()->bottom(), from);
+ _hr->bottom(), from);
}
}
if (G1TraceHeapRegionRememberedSet) {
@@ -539,13 +527,13 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
prt->add_reference(from);
if (G1RecordHRRSOops) {
- HeapRegionRemSet::record(hr(), from);
+ HeapRegionRemSet::record(_hr, from);
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print("Added card " PTR_FORMAT " to region "
"[" PTR_FORMAT "...) for ref " PTR_FORMAT ".\n",
align_size_down(uintptr_t(from),
CardTableModRefBS::card_size),
- hr()->bottom(), from);
+ _hr->bottom(), from);
}
}
assert(contains_reference(from), "We just added it!");
@@ -614,7 +602,7 @@ PerRegionTable* OtherRegionsTable::delete_region_table() {
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print("Coarsened entry in region [" PTR_FORMAT "...] "
"for region [" PTR_FORMAT "...] (" SIZE_FORMAT " coarse entries).\n",
- hr()->bottom(),
+ _hr->bottom(),
max->hr()->bottom(),
_n_coarse_entries);
}
@@ -627,13 +615,11 @@ PerRegionTable* OtherRegionsTable::delete_region_table() {
return max;
}
-
-// At present, this must be called stop-world single-threaded.
void OtherRegionsTable::scrub(CardTableModRefBS* ctbs,
BitMap* region_bm, BitMap* card_bm) {
// First eliminated garbage regions from the coarse map.
if (G1RSScrubVerbose) {
- gclog_or_tty->print_cr("Scrubbing region %u:", hr()->hrm_index());
+ gclog_or_tty->print_cr("Scrubbing region %u:", _hr->hrm_index());
}
assert(_coarse_map.size() == region_bm->size(), "Precondition");
@@ -752,7 +738,7 @@ size_t OtherRegionsTable::fl_mem_size() {
}
void OtherRegionsTable::clear_fcc() {
- FromCardCache::clear(hr()->hrm_index());
+ FromCardCache::clear(_hr->hrm_index());
}
void OtherRegionsTable::clear() {
@@ -774,27 +760,6 @@ void OtherRegionsTable::clear() {
clear_fcc();
}
-bool OtherRegionsTable::del_single_region_table(size_t ind,
- HeapRegion* hr) {
- assert(0 <= ind && ind < _max_fine_entries, "Preconditions.");
- PerRegionTable** prev_addr = &_fine_grain_regions[ind];
- PerRegionTable* prt = *prev_addr;
- while (prt != NULL && prt->hr() != hr) {
- prev_addr = prt->collision_list_next_addr();
- prt = prt->collision_list_next();
- }
- if (prt != NULL) {
- assert(prt->hr() == hr, "Loop postcondition.");
- *prev_addr = prt->collision_list_next();
- unlink_from_all(prt);
- PerRegionTable::free(prt);
- _n_fine_entries--;
- return true;
- } else {
- return false;
- }
-}
-
bool OtherRegionsTable::contains_reference(OopOrNarrowOopStar from) const {
// Cast away const in this case.
MutexLockerEx x((Mutex*)_m, Mutex::_no_safepoint_check_flag);
@@ -975,7 +940,7 @@ HeapRegionRemSetIterator:: HeapRegionRemSetIterator(HeapRegionRemSet* hrrs) :
_hrrs(hrrs),
_g1h(G1CollectedHeap::heap()),
_coarse_map(&hrrs->_other_regions._coarse_map),
- _bosa(hrrs->bosa()),
+ _bosa(hrrs->_bosa),
_is(Sparse),
// Set these values so that we increment to the first region.
_coarse_cur_region_index(-1),
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
index d55fe1858df..bfff90abaef 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
@@ -162,32 +162,36 @@ class OtherRegionsTable VALUE_OBJ_CLASS_SPEC {
// to hold _m, and the fine-grain table to be full.
PerRegionTable* delete_region_table();
- // If a PRT for "hr" is in the bucket list indicated by "ind" (which must
- // be the correct index for "hr"), delete it and return true; else return
- // false.
- bool del_single_region_table(size_t ind, HeapRegion* hr);
-
// link/add the given fine grain remembered set into the "all" list
void link_to_all(PerRegionTable * prt);
// unlink/remove the given fine grain remembered set into the "all" list
void unlink_from_all(PerRegionTable * prt);
-public:
- OtherRegionsTable(HeapRegion* hr, Mutex* m);
+ bool contains_reference_locked(OopOrNarrowOopStar from) const;
- HeapRegion* hr() const { return _hr; }
+ // Clear the from_card_cache entries for this region.
+ void clear_fcc();
+public:
+ // Create a new remembered set for the given heap region. The given mutex should
+ // be used to ensure consistency.
+ OtherRegionsTable(HeapRegion* hr, Mutex* m);
// For now. Could "expand" some tables in the future, so that this made
// sense.
void add_reference(OopOrNarrowOopStar from, uint tid);
+ // Returns whether the remembered set contains the given reference.
+ bool contains_reference(OopOrNarrowOopStar from) const;
+
// Removes any entries shown by the given bitmaps to contain only dead
- // objects.
+ // objects. Not thread safe.
+ // Set bits in the bitmaps indicate that the given region or card is live.
void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
- // Returns whether this remembered set (and all sub-sets) contain no entries.
+ // Returns whether this remembered set (and all sub-sets) does not contain any entry.
bool is_empty() const;
+ // Returns the number of cards contained in this remembered set.
size_t occupied() const;
size_t occ_fine() const;
size_t occ_coarse() const;
@@ -195,31 +199,17 @@ public:
static jint n_coarsenings() { return _n_coarsenings; }
- // Returns size in bytes.
- // Not const because it takes a lock.
+ // Returns size of the actual remembered set containers in bytes.
size_t mem_size() const;
+ // Returns the size of static data in bytes.
static size_t static_mem_size();
+ // Returns the size of the free list content in bytes.
static size_t fl_mem_size();
- bool contains_reference(OopOrNarrowOopStar from) const;
- bool contains_reference_locked(OopOrNarrowOopStar from) const;
-
+ // Clear the entire contents of this remembered set.
void clear();
- // Specifically clear the from_card_cache.
- void clear_fcc();
-
void do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task);
-
- // Declare the heap size (in # of regions) to the OtherRegionsTable.
- // (Uses it to initialize from_card_cache).
- static void initialize(uint max_regions);
-
- // Declares that regions between start_idx <= i < start_idx + num_regions are
- // not in use. Make sure that any entries for these regions are invalid.
- static void invalidate(uint start_idx, size_t num_regions);
-
- static void print_from_card_cache();
};
class HeapRegionRemSet : public CHeapObj {
@@ -233,7 +223,6 @@ public:
private:
G1BlockOffsetSharedArray* _bosa;
- G1BlockOffsetSharedArray* bosa() const { return _bosa; }
// A set of code blobs (nmethods) whose code contains pointers into
// the region that owns this RSet.
@@ -268,10 +257,6 @@ public:
static uint num_par_rem_sets();
static void setup_remset_size();
- HeapRegion* hr() const {
- return _other_regions.hr();
- }
-
bool is_empty() const {
return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();
}
@@ -305,8 +290,9 @@ public:
_other_regions.add_reference(from, tid);
}
- // Removes any entries shown by the given bitmaps to contain only dead
- // objects.
+ // Removes any entries in the remembered set shown by the given bitmaps to
+ // contain only dead objects. Not thread safe.
+ // One bits in the bitmaps indicate that the given region or card is live.
void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
// The region is being reclaimed; clear its remset, and any mention of
@@ -397,16 +383,16 @@ public:
// Declare the heap size (in # of regions) to the HeapRegionRemSet(s).
// (Uses it to initialize from_card_cache).
static void init_heap(uint max_regions) {
- OtherRegionsTable::initialize(max_regions);
+ FromCardCache::initialize(num_par_rem_sets(), max_regions);
}
- static void invalidate(uint start_idx, uint num_regions) {
- OtherRegionsTable::invalidate(start_idx, num_regions);
+ static void invalidate_from_card_cache(uint start_idx, size_t num_regions) {
+ FromCardCache::invalidate(start_idx, num_regions);
}
#ifndef PRODUCT
static void print_from_card_cache() {
- OtherRegionsTable::print_from_card_cache();
+ FromCardCache::print();
}
#endif
diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp
index dba0c5f709b..79af8d24eb4 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp
@@ -172,6 +172,27 @@ void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
_tenuring_threshold = tenuring_threshold;
}
+bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
+ return should_send_promotion_in_new_plab_event();
+}
+
+bool YoungGCTracer::should_report_promotion_outside_plab_event() const {
+ return should_send_promotion_outside_plab_event();
+}
+
+void YoungGCTracer::report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured,
+ size_t plab_size) const {
+ assert_set_gc_id();
+ send_promotion_in_new_plab_event(klass, obj_size, age, tenured, plab_size);
+}
+
+void YoungGCTracer::report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured) const {
+ assert_set_gc_id();
+ send_promotion_outside_plab_event(klass, obj_size, age, tenured);
+}
+
void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp
index 20342ebc244..9774dcb9537 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp
@@ -156,9 +156,38 @@ class YoungGCTracer : public GCTracer {
void report_promotion_failed(const PromotionFailedInfo& pf_info);
void report_tenuring_threshold(const uint tenuring_threshold);
+ /*
+ * Methods for reporting Promotion in new or outside PLAB Events.
+ *
+ * The object age is always required as it is not certain that the mark word
+ * of the oop can be trusted at this stage.
+ *
+ * obj_size is the size of the promoted object in bytes.
+ *
+ * tenured should be true if the object has been promoted to the old
+ * space during this GC, if the object is copied to survivor space
+ * from young space or survivor space (aging) tenured should be false.
+ *
+ * plab_size is the size of the newly allocated PLAB in bytes.
+ */
+ bool should_report_promotion_in_new_plab_event() const;
+ bool should_report_promotion_outside_plab_event() const;
+ void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured,
+ size_t plab_size) const;
+ void report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured) const;
+
private:
void send_young_gc_event() const;
void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;
+ bool should_send_promotion_in_new_plab_event() const;
+ bool should_send_promotion_outside_plab_event() const;
+ void send_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured,
+ size_t plab_size) const;
+ void send_promotion_outside_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured) const;
};
class OldGCTracer : public GCTracer {
diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp
index 97055694fae..326625bf1a8 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp
@@ -111,6 +111,44 @@ void YoungGCTracer::send_young_gc_event() const {
}
}
+bool YoungGCTracer::should_send_promotion_in_new_plab_event() const {
+ return EventPromoteObjectInNewPLAB::is_enabled();
+}
+
+bool YoungGCTracer::should_send_promotion_outside_plab_event() const {
+ return EventPromoteObjectOutsidePLAB::is_enabled();
+}
+
+void YoungGCTracer::send_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured,
+ size_t plab_size) const {
+
+ EventPromoteObjectInNewPLAB event;
+ if (event.should_commit()) {
+ event.set_gcId(_shared_gc_info.gc_id().id());
+ event.set_class(klass);
+ event.set_objectSize(obj_size);
+ event.set_tenured(tenured);
+ event.set_tenuringAge(age);
+ event.set_plabSize(plab_size);
+ event.commit();
+ }
+}
+
+void YoungGCTracer::send_promotion_outside_plab_event(Klass* klass, size_t obj_size,
+ uint age, bool tenured) const {
+
+ EventPromoteObjectOutsidePLAB event;
+ if (event.should_commit()) {
+ event.set_gcId(_shared_gc_info.gc_id().id());
+ event.set_class(klass);
+ event.set_objectSize(obj_size);
+ event.set_tenured(tenured);
+ event.set_tenuringAge(age);
+ event.commit();
+ }
+}
+
void OldGCTracer::send_old_gc_event() const {
EventGCOldGarbageCollection e(UNTIMED);
if (e.should_commit()) {
diff --git a/hotspot/src/share/vm/memory/cardGeneration.cpp b/hotspot/src/share/vm/memory/cardGeneration.cpp
new file mode 100644
index 00000000000..21e8d9e51a7
--- /dev/null
+++ b/hotspot/src/share/vm/memory/cardGeneration.cpp
@@ -0,0 +1,360 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#include "memory/blockOffsetTable.inline.hpp"
+#include "memory/cardGeneration.inline.hpp"
+#include "memory/gcLocker.hpp"
+#include "memory/generationSpec.hpp"
+#include "memory/genOopClosures.inline.hpp"
+#include "memory/genRemSet.hpp"
+#include "memory/iterator.hpp"
+#include "memory/memRegion.hpp"
+#include "memory/space.inline.hpp"
+#include "runtime/java.hpp"
+
+CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size,
+ int level,
+ GenRemSet* remset) :
+ Generation(rs, initial_byte_size, level), _rs(remset),
+ _shrink_factor(0), _min_heap_delta_bytes(), _capacity_at_prologue(),
+ _used_at_prologue()
+{
+ HeapWord* start = (HeapWord*)rs.base();
+ size_t reserved_byte_size = rs.size();
+ assert((uintptr_t(start) & 3) == 0, "bad alignment");
+ assert((reserved_byte_size & 3) == 0, "bad alignment");
+ MemRegion reserved_mr(start, heap_word_size(reserved_byte_size));
+ _bts = new BlockOffsetSharedArray(reserved_mr,
+ heap_word_size(initial_byte_size));
+ MemRegion committed_mr(start, heap_word_size(initial_byte_size));
+ _rs->resize_covered_region(committed_mr);
+ if (_bts == NULL) {
+ vm_exit_during_initialization("Could not allocate a BlockOffsetArray");
+ }
+
+ // Verify that the start and end of this generation is the start of a card.
+ // If this wasn't true, a single card could span more than on generation,
+ // which would cause problems when we commit/uncommit memory, and when we
+ // clear and dirty cards.
+ guarantee(_rs->is_aligned(reserved_mr.start()), "generation must be card aligned");
+ if (reserved_mr.end() != Universe::heap()->reserved_region().end()) {
+ // Don't check at the very end of the heap as we'll assert that we're probing off
+ // the end if we try.
+ guarantee(_rs->is_aligned(reserved_mr.end()), "generation must be card aligned");
+ }
+ _min_heap_delta_bytes = MinHeapDeltaBytes;
+ _capacity_at_prologue = initial_byte_size;
+ _used_at_prologue = 0;
+}
+
+bool CardGeneration::grow_by(size_t bytes) {
+ assert_correct_size_change_locking();
+ bool result = _virtual_space.expand_by(bytes);
+ if (result) {
+ size_t new_word_size =
+ heap_word_size(_virtual_space.committed_size());
+ MemRegion mr(space()->bottom(), new_word_size);
+ // Expand card table
+ Universe::heap()->barrier_set()->resize_covered_region(mr);
+ // Expand shared block offset array
+ _bts->resize(new_word_size);
+
+ // Fix for bug #4668531
+ if (ZapUnusedHeapArea) {
+ MemRegion mangle_region(space()->end(),
+ (HeapWord*)_virtual_space.high());
+ SpaceMangler::mangle_region(mangle_region);
+ }
+
+ // Expand space -- also expands space's BOT
+ // (which uses (part of) shared array above)
+ space()->set_end((HeapWord*)_virtual_space.high());
+
+ // update the space and generation capacity counters
+ update_counters();
+
+ if (Verbose && PrintGC) {
+ size_t new_mem_size = _virtual_space.committed_size();
+ size_t old_mem_size = new_mem_size - bytes;
+ gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by "
+ SIZE_FORMAT "K to " SIZE_FORMAT "K",
+ name(), old_mem_size/K, bytes/K, new_mem_size/K);
+ }
+ }
+ return result;
+}
+
+bool CardGeneration::expand(size_t bytes, size_t expand_bytes) {
+ assert_locked_or_safepoint(Heap_lock);
+ if (bytes == 0) {
+ return true; // That's what grow_by(0) would return
+ }
+ size_t aligned_bytes = ReservedSpace::page_align_size_up(bytes);
+ if (aligned_bytes == 0){
+ // The alignment caused the number of bytes to wrap. An expand_by(0) will
+ // return true with the implication that an expansion was done when it
+ // was not. A call to expand implies a best effort to expand by "bytes"
+ // but not a guarantee. Align down to give a best effort. This is likely
+ // the most that the generation can expand since it has some capacity to
+ // start with.
+ aligned_bytes = ReservedSpace::page_align_size_down(bytes);
+ }
+ size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes);
+ bool success = false;
+ if (aligned_expand_bytes > aligned_bytes) {
+ success = grow_by(aligned_expand_bytes);
+ }
+ if (!success) {
+ success = grow_by(aligned_bytes);
+ }
+ if (!success) {
+ success = grow_to_reserved();
+ }
+ if (PrintGC && Verbose) {
+ if (success && GC_locker::is_active_and_needs_gc()) {
+ gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead");
+ }
+ }
+
+ return success;
+}
+
+bool CardGeneration::grow_to_reserved() {
+ assert_correct_size_change_locking();
+ bool success = true;
+ const size_t remaining_bytes = _virtual_space.uncommitted_size();
+ if (remaining_bytes > 0) {
+ success = grow_by(remaining_bytes);
+ DEBUG_ONLY(if (!success) warning("grow to reserved failed");)
+ }
+ return success;
+}
+
+void CardGeneration::shrink(size_t bytes) {
+ assert_correct_size_change_locking();
+
+ size_t size = ReservedSpace::page_align_size_down(bytes);
+ if (size == 0) {
+ return;
+ }
+
+ // Shrink committed space
+ _virtual_space.shrink_by(size);
+ // Shrink space; this also shrinks the space's BOT
+ space()->set_end((HeapWord*) _virtual_space.high());
+ size_t new_word_size = heap_word_size(space()->capacity());
+ // Shrink the shared block offset array
+ _bts->resize(new_word_size);
+ MemRegion mr(space()->bottom(), new_word_size);
+ // Shrink the card table
+ Universe::heap()->barrier_set()->resize_covered_region(mr);
+
+ if (Verbose && PrintGC) {
+ size_t new_mem_size = _virtual_space.committed_size();
+ size_t old_mem_size = new_mem_size + size;
+ gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
+ name(), old_mem_size/K, new_mem_size/K);
+ }
+}
+
+// No young generation references, clear this generation's cards.
+void CardGeneration::clear_remembered_set() {
+ _rs->clear(reserved());
+}
+
+// Objects in this generation may have moved, invalidate this
+// generation's cards.
+void CardGeneration::invalidate_remembered_set() {
+ _rs->invalidate(used_region());
+}
+
+void CardGeneration::compute_new_size() {
+ assert(_shrink_factor <= 100, "invalid shrink factor");
+ size_t current_shrink_factor = _shrink_factor;
+ _shrink_factor = 0;
+
+ // We don't have floating point command-line arguments
+ // Note: argument processing ensures that MinHeapFreeRatio < 100.
+ const double minimum_free_percentage = MinHeapFreeRatio / 100.0;
+ const double maximum_used_percentage = 1.0 - minimum_free_percentage;
+
+ // Compute some numbers about the state of the heap.
+ const size_t used_after_gc = used();
+ const size_t capacity_after_gc = capacity();
+
+ const double min_tmp = used_after_gc / maximum_used_percentage;
+ size_t minimum_desired_capacity = (size_t)MIN2(min_tmp, double(max_uintx));
+ // Don't shrink less than the initial generation size
+ minimum_desired_capacity = MAX2(minimum_desired_capacity,
+ spec()->init_size());
+ assert(used_after_gc <= minimum_desired_capacity, "sanity check");
+
+ if (PrintGC && Verbose) {
+ const size_t free_after_gc = free();
+ const double free_percentage = ((double)free_after_gc) / capacity_after_gc;
+ gclog_or_tty->print_cr("TenuredGeneration::compute_new_size: ");
+ gclog_or_tty->print_cr(" "
+ " minimum_free_percentage: %6.2f"
+ " maximum_used_percentage: %6.2f",
+ minimum_free_percentage,
+ maximum_used_percentage);
+ gclog_or_tty->print_cr(" "
+ " free_after_gc : %6.1fK"
+ " used_after_gc : %6.1fK"
+ " capacity_after_gc : %6.1fK",
+ free_after_gc / (double) K,
+ used_after_gc / (double) K,
+ capacity_after_gc / (double) K);
+ gclog_or_tty->print_cr(" "
+ " free_percentage: %6.2f",
+ free_percentage);
+ }
+
+ if (capacity_after_gc < minimum_desired_capacity) {
+ // If we have less free space than we want then expand
+ size_t expand_bytes = minimum_desired_capacity - capacity_after_gc;
+ // Don't expand unless it's significant
+ if (expand_bytes >= _min_heap_delta_bytes) {
+ expand(expand_bytes, 0); // safe if expansion fails
+ }
+ if (PrintGC && Verbose) {
+ gclog_or_tty->print_cr(" expanding:"
+ " minimum_desired_capacity: %6.1fK"
+ " expand_bytes: %6.1fK"
+ " _min_heap_delta_bytes: %6.1fK",
+ minimum_desired_capacity / (double) K,
+ expand_bytes / (double) K,
+ _min_heap_delta_bytes / (double) K);
+ }
+ return;
+ }
+
+ // No expansion, now see if we want to shrink
+ size_t shrink_bytes = 0;
+ // We would never want to shrink more than this
+ size_t max_shrink_bytes = capacity_after_gc - minimum_desired_capacity;
+
+ if (MaxHeapFreeRatio < 100) {
+ const double maximum_free_percentage = MaxHeapFreeRatio / 100.0;
+ const double minimum_used_percentage = 1.0 - maximum_free_percentage;
+ const double max_tmp = used_after_gc / minimum_used_percentage;
+ size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx));
+ maximum_desired_capacity = MAX2(maximum_desired_capacity,
+ spec()->init_size());
+ if (PrintGC && Verbose) {
+ gclog_or_tty->print_cr(" "
+ " maximum_free_percentage: %6.2f"
+ " minimum_used_percentage: %6.2f",
+ maximum_free_percentage,
+ minimum_used_percentage);
+ gclog_or_tty->print_cr(" "
+ " _capacity_at_prologue: %6.1fK"
+ " minimum_desired_capacity: %6.1fK"
+ " maximum_desired_capacity: %6.1fK",
+ _capacity_at_prologue / (double) K,
+ minimum_desired_capacity / (double) K,
+ maximum_desired_capacity / (double) K);
+ }
+ assert(minimum_desired_capacity <= maximum_desired_capacity,
+ "sanity check");
+
+ if (capacity_after_gc > maximum_desired_capacity) {
+ // Capacity too large, compute shrinking size
+ shrink_bytes = capacity_after_gc - maximum_desired_capacity;
+ // We don't want shrink all the way back to initSize if people call
+ // System.gc(), because some programs do that between "phases" and then
+ // we'd just have to grow the heap up again for the next phase. So we
+ // damp the shrinking: 0% on the first call, 10% on the second call, 40%
+ // on the third call, and 100% by the fourth call. But if we recompute
+ // size without shrinking, it goes back to 0%.
+ shrink_bytes = shrink_bytes / 100 * current_shrink_factor;
+ assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size");
+ if (current_shrink_factor == 0) {
+ _shrink_factor = 10;
+ } else {
+ _shrink_factor = MIN2(current_shrink_factor * 4, (size_t) 100);
+ }
+ if (PrintGC && Verbose) {
+ gclog_or_tty->print_cr(" "
+ " shrinking:"
+ " initSize: %.1fK"
+ " maximum_desired_capacity: %.1fK",
+ spec()->init_size() / (double) K,
+ maximum_desired_capacity / (double) K);
+ gclog_or_tty->print_cr(" "
+ " shrink_bytes: %.1fK"
+ " current_shrink_factor: " SIZE_FORMAT
+ " new shrink factor: " SIZE_FORMAT
+ " _min_heap_delta_bytes: %.1fK",
+ shrink_bytes / (double) K,
+ current_shrink_factor,
+ _shrink_factor,
+ _min_heap_delta_bytes / (double) K);
+ }
+ }
+ }
+
+ if (capacity_after_gc > _capacity_at_prologue) {
+ // We might have expanded for promotions, in which case we might want to
+ // take back that expansion if there's room after GC. That keeps us from
+ // stretching the heap with promotions when there's plenty of room.
+ size_t expansion_for_promotion = capacity_after_gc - _capacity_at_prologue;
+ expansion_for_promotion = MIN2(expansion_for_promotion, max_shrink_bytes);
+ // We have two shrinking computations, take the largest
+ shrink_bytes = MAX2(shrink_bytes, expansion_for_promotion);
+ assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size");
+ if (PrintGC && Verbose) {
+ gclog_or_tty->print_cr(" "
+ " aggressive shrinking:"
+ " _capacity_at_prologue: %.1fK"
+ " capacity_after_gc: %.1fK"
+ " expansion_for_promotion: %.1fK"
+ " shrink_bytes: %.1fK",
+ capacity_after_gc / (double) K,
+ _capacity_at_prologue / (double) K,
+ expansion_for_promotion / (double) K,
+ shrink_bytes / (double) K);
+ }
+ }
+ // Don't shrink unless it's significant
+ if (shrink_bytes >= _min_heap_delta_bytes) {
+ shrink(shrink_bytes);
+ }
+}
+
+// Currently nothing to do.
+void CardGeneration::prepare_for_verify() {}
+
+void CardGeneration::space_iterate(SpaceClosure* blk,
+ bool usedOnly) {
+ blk->do_space(space());
+}
+
+void CardGeneration::younger_refs_iterate(OopsInGenClosure* blk) {
+ blk->set_generation(this);
+ younger_refs_in_space_iterate(space(), blk);
+ blk->reset_generation();
+}
diff --git a/hotspot/src/share/vm/memory/cardGeneration.hpp b/hotspot/src/share/vm/memory/cardGeneration.hpp
new file mode 100644
index 00000000000..24d0fa0f2c2
--- /dev/null
+++ b/hotspot/src/share/vm/memory/cardGeneration.hpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_MEMORY_CARDGENERATION_HPP
+#define SHARE_VM_MEMORY_CARDGENERATION_HPP
+
+// Class CardGeneration is a generation that is covered by a card table,
+// and uses a card-size block-offset array to implement block_start.
+
+#include "memory/generation.hpp"
+
+class BlockOffsetSharedArray;
+class CompactibleSpace;
+
+class CardGeneration: public Generation {
+ friend class VMStructs;
+ protected:
+ // This is shared with other generations.
+ GenRemSet* _rs;
+ // This is local to this generation.
+ BlockOffsetSharedArray* _bts;
+
+ // Current shrinking effect: this damps shrinking when the heap gets empty.
+ size_t _shrink_factor;
+
+ size_t _min_heap_delta_bytes; // Minimum amount to expand.
+
+ // Some statistics from before gc started.
+ // These are gathered in the gc_prologue (and should_collect)
+ // to control growing/shrinking policy in spite of promotions.
+ size_t _capacity_at_prologue;
+ size_t _used_at_prologue;
+
+ CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level,
+ GenRemSet* remset);
+
+ virtual void assert_correct_size_change_locking() = 0;
+
+ virtual CompactibleSpace* space() const = 0;
+
+ public:
+
+ // Attempt to expand the generation by "bytes". Expand by at a
+ // minimum "expand_bytes". Return true if some amount (not
+ // necessarily the full "bytes") was done.
+ virtual bool expand(size_t bytes, size_t expand_bytes);
+
+ // Shrink generation with specified size
+ virtual void shrink(size_t bytes);
+
+ virtual void compute_new_size();
+
+ virtual void clear_remembered_set();
+
+ virtual void invalidate_remembered_set();
+
+ virtual void prepare_for_verify();
+
+ // Grow generation with specified size (returns false if unable to grow)
+ bool grow_by(size_t bytes);
+ // Grow generation to reserved size.
+ bool grow_to_reserved();
+
+ size_t capacity() const;
+ size_t used() const;
+ size_t free() const;
+ MemRegion used_region() const;
+
+ void space_iterate(SpaceClosure* blk, bool usedOnly = false);
+
+ void younger_refs_iterate(OopsInGenClosure* blk);
+
+ bool is_in(const void* p) const;
+
+ CompactibleSpace* first_compaction_space() const;
+};
+
+#endif // SHARE_VM_MEMORY_CARDGENERATION_HPP
diff --git a/hotspot/src/share/vm/memory/cardGeneration.inline.hpp b/hotspot/src/share/vm/memory/cardGeneration.inline.hpp
new file mode 100644
index 00000000000..fb49d0d0718
--- /dev/null
+++ b/hotspot/src/share/vm/memory/cardGeneration.inline.hpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_MEMORY_CARDGENERATION_INLINE_HPP
+#define SHARE_VM_MEMORY_CARDGENERATION_INLINE_HPP
+
+#include "memory/cardGeneration.hpp"
+#include "memory/space.hpp"
+
+inline size_t CardGeneration::capacity() const {
+ return space()->capacity();
+}
+
+inline size_t CardGeneration::used() const {
+ return space()->used();
+}
+
+inline size_t CardGeneration::free() const {
+ return space()->free();
+}
+
+inline MemRegion CardGeneration::used_region() const {
+ return space()->used_region();
+}
+
+inline bool CardGeneration::is_in(const void* p) const {
+ return space()->is_in(p);
+}
+
+inline CompactibleSpace* CardGeneration::first_compaction_space() const {
+ return space();
+}
+
+#endif // SHARE_VM_MEMORY_CARDGENERATION_INLINE_HPP
diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
index d9460308ac7..d3586332b2f 100644
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
@@ -275,29 +275,26 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) {
// the new_end_aligned does not intrude onto the committed
// space of another region.
int ri = 0;
- for (ri = 0; ri < _cur_covered_regions; ri++) {
- if (ri != ind) {
- if (_committed[ri].contains(new_end_aligned)) {
- // The prior check included in the assert
- // (new_end_aligned >= _committed[ri].start())
- // is redundant with the "contains" test.
- // Any region containing the new end
- // should start at or beyond the region found (ind)
- // for the new end (committed regions are not expected to
- // be proper subsets of other committed regions).
- assert(_committed[ri].start() >= _committed[ind].start(),
- "New end of committed region is inconsistent");
- new_end_aligned = _committed[ri].start();
- // new_end_aligned can be equal to the start of its
- // committed region (i.e., of "ind") if a second
- // region following "ind" also start at the same location
- // as "ind".
- assert(new_end_aligned >= _committed[ind].start(),
- "New end of committed region is before start");
- debug_only(collided = true;)
- // Should only collide with 1 region
- break;
- }
+ for (ri = ind + 1; ri < _cur_covered_regions; ri++) {
+ if (new_end_aligned > _committed[ri].start()) {
+ assert(new_end_aligned <= _committed[ri].end(),
+ "An earlier committed region can't cover a later committed region");
+ // Any region containing the new end
+ // should start at or beyond the region found (ind)
+ // for the new end (committed regions are not expected to
+ // be proper subsets of other committed regions).
+ assert(_committed[ri].start() >= _committed[ind].start(),
+ "New end of committed region is inconsistent");
+ new_end_aligned = _committed[ri].start();
+ // new_end_aligned can be equal to the start of its
+ // committed region (i.e., of "ind") if a second
+ // region following "ind" also start at the same location
+ // as "ind".
+ assert(new_end_aligned >= _committed[ind].start(),
+ "New end of committed region is before start");
+ debug_only(collided = true;)
+ // Should only collide with 1 region
+ break;
}
}
#ifdef ASSERT
diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp
index bac26f1b802..cbe369f327e 100644
--- a/hotspot/src/share/vm/memory/filemap.cpp
+++ b/hotspot/src/share/vm/memory/filemap.cpp
@@ -98,11 +98,11 @@ void FileMapInfo::fail_continue(const char *msg, ...) {
tty->print_cr("UseSharedSpaces: %s", msg);
}
}
+ UseSharedSpaces = false;
+ assert(current_info() != NULL, "singleton must be registered");
+ current_info()->close();
}
va_end(ap);
- UseSharedSpaces = false;
- assert(current_info() != NULL, "singleton must be registered");
- current_info()->close();
}
// Fill in the fileMapInfo structure with data about this VM instance.
@@ -217,9 +217,14 @@ void FileMapInfo::allocate_classpath_entry_table() {
EXCEPTION_MARK; // The following call should never throw, but would exit VM on error.
SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD);
} else {
- ent->_filesize = -1;
- if (!os::dir_is_empty(name)) {
- ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name);
+ struct stat st;
+ if ((os::stat(name, &st) == 0) && ((st.st_mode & S_IFDIR) == S_IFDIR)) {
+ if (!os::dir_is_empty(name)) {
+ ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name);
+ }
+ ent->_filesize = -1;
+ } else {
+ ent->_filesize = -2;
}
}
ent->_name = strptr;
@@ -271,7 +276,7 @@ bool FileMapInfo::validate_classpath_entry_table() {
fail_continue("directory is not empty: %s", name);
ok = false;
}
- } else {
+ } else if (ent->is_jar()) {
if (ent->_timestamp != st.st_mtime ||
ent->_filesize != st.st_size) {
ok = false;
diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp
index a84aa17457f..fe1627ef9a6 100644
--- a/hotspot/src/share/vm/memory/filemap.hpp
+++ b/hotspot/src/share/vm/memory/filemap.hpp
@@ -44,8 +44,11 @@ class Metaspace;
class SharedClassPathEntry VALUE_OBJ_CLASS_SPEC {
public:
const char *_name;
- time_t _timestamp; // jar timestamp, 0 if is directory
- long _filesize; // jar file size, -1 if is directory
+ time_t _timestamp; // jar timestamp, 0 if is directory or other
+ long _filesize; // jar file size, -1 if is directory, -2 if other
+ bool is_jar() {
+ return _timestamp != 0;
+ }
bool is_dir() {
return _filesize == -1;
}
diff --git a/hotspot/src/share/vm/memory/generation.cpp b/hotspot/src/share/vm/memory/generation.cpp
index 87880cf0e31..617ed682cfc 100644
--- a/hotspot/src/share/vm/memory/generation.cpp
+++ b/hotspot/src/share/vm/memory/generation.cpp
@@ -361,244 +361,3 @@ void Generation::compact() {
sp = sp->next_compaction_space();
}
}
-
-CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size,
- int level,
- GenRemSet* remset) :
- Generation(rs, initial_byte_size, level), _rs(remset),
- _shrink_factor(0), _min_heap_delta_bytes(), _capacity_at_prologue(),
- _used_at_prologue()
-{
- HeapWord* start = (HeapWord*)rs.base();
- size_t reserved_byte_size = rs.size();
- assert((uintptr_t(start) & 3) == 0, "bad alignment");
- assert((reserved_byte_size & 3) == 0, "bad alignment");
- MemRegion reserved_mr(start, heap_word_size(reserved_byte_size));
- _bts = new BlockOffsetSharedArray(reserved_mr,
- heap_word_size(initial_byte_size));
- MemRegion committed_mr(start, heap_word_size(initial_byte_size));
- _rs->resize_covered_region(committed_mr);
- if (_bts == NULL)
- vm_exit_during_initialization("Could not allocate a BlockOffsetArray");
-
- // Verify that the start and end of this generation is the start of a card.
- // If this wasn't true, a single card could span more than on generation,
- // which would cause problems when we commit/uncommit memory, and when we
- // clear and dirty cards.
- guarantee(_rs->is_aligned(reserved_mr.start()), "generation must be card aligned");
- if (reserved_mr.end() != Universe::heap()->reserved_region().end()) {
- // Don't check at the very end of the heap as we'll assert that we're probing off
- // the end if we try.
- guarantee(_rs->is_aligned(reserved_mr.end()), "generation must be card aligned");
- }
- _min_heap_delta_bytes = MinHeapDeltaBytes;
- _capacity_at_prologue = initial_byte_size;
- _used_at_prologue = 0;
-}
-
-bool CardGeneration::expand(size_t bytes, size_t expand_bytes) {
- assert_locked_or_safepoint(Heap_lock);
- if (bytes == 0) {
- return true; // That's what grow_by(0) would return
- }
- size_t aligned_bytes = ReservedSpace::page_align_size_up(bytes);
- if (aligned_bytes == 0){
- // The alignment caused the number of bytes to wrap. An expand_by(0) will
- // return true with the implication that an expansion was done when it
- // was not. A call to expand implies a best effort to expand by "bytes"
- // but not a guarantee. Align down to give a best effort. This is likely
- // the most that the generation can expand since it has some capacity to
- // start with.
- aligned_bytes = ReservedSpace::page_align_size_down(bytes);
- }
- size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes);
- bool success = false;
- if (aligned_expand_bytes > aligned_bytes) {
- success = grow_by(aligned_expand_bytes);
- }
- if (!success) {
- success = grow_by(aligned_bytes);
- }
- if (!success) {
- success = grow_to_reserved();
- }
- if (PrintGC && Verbose) {
- if (success && GC_locker::is_active_and_needs_gc()) {
- gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead");
- }
- }
-
- return success;
-}
-
-
-// No young generation references, clear this generation's cards.
-void CardGeneration::clear_remembered_set() {
- _rs->clear(reserved());
-}
-
-
-// Objects in this generation may have moved, invalidate this
-// generation's cards.
-void CardGeneration::invalidate_remembered_set() {
- _rs->invalidate(used_region());
-}
-
-
-void CardGeneration::compute_new_size() {
- assert(_shrink_factor <= 100, "invalid shrink factor");
- size_t current_shrink_factor = _shrink_factor;
- _shrink_factor = 0;
-
- // We don't have floating point command-line arguments
- // Note: argument processing ensures that MinHeapFreeRatio < 100.
- const double minimum_free_percentage = MinHeapFreeRatio / 100.0;
- const double maximum_used_percentage = 1.0 - minimum_free_percentage;
-
- // Compute some numbers about the state of the heap.
- const size_t used_after_gc = used();
- const size_t capacity_after_gc = capacity();
-
- const double min_tmp = used_after_gc / maximum_used_percentage;
- size_t minimum_desired_capacity = (size_t)MIN2(min_tmp, double(max_uintx));
- // Don't shrink less than the initial generation size
- minimum_desired_capacity = MAX2(minimum_desired_capacity,
- spec()->init_size());
- assert(used_after_gc <= minimum_desired_capacity, "sanity check");
-
- if (PrintGC && Verbose) {
- const size_t free_after_gc = free();
- const double free_percentage = ((double)free_after_gc) / capacity_after_gc;
- gclog_or_tty->print_cr("TenuredGeneration::compute_new_size: ");
- gclog_or_tty->print_cr(" "
- " minimum_free_percentage: %6.2f"
- " maximum_used_percentage: %6.2f",
- minimum_free_percentage,
- maximum_used_percentage);
- gclog_or_tty->print_cr(" "
- " free_after_gc : %6.1fK"
- " used_after_gc : %6.1fK"
- " capacity_after_gc : %6.1fK",
- free_after_gc / (double) K,
- used_after_gc / (double) K,
- capacity_after_gc / (double) K);
- gclog_or_tty->print_cr(" "
- " free_percentage: %6.2f",
- free_percentage);
- }
-
- if (capacity_after_gc < minimum_desired_capacity) {
- // If we have less free space than we want then expand
- size_t expand_bytes = minimum_desired_capacity - capacity_after_gc;
- // Don't expand unless it's significant
- if (expand_bytes >= _min_heap_delta_bytes) {
- expand(expand_bytes, 0); // safe if expansion fails
- }
- if (PrintGC && Verbose) {
- gclog_or_tty->print_cr(" expanding:"
- " minimum_desired_capacity: %6.1fK"
- " expand_bytes: %6.1fK"
- " _min_heap_delta_bytes: %6.1fK",
- minimum_desired_capacity / (double) K,
- expand_bytes / (double) K,
- _min_heap_delta_bytes / (double) K);
- }
- return;
- }
-
- // No expansion, now see if we want to shrink
- size_t shrink_bytes = 0;
- // We would never want to shrink more than this
- size_t max_shrink_bytes = capacity_after_gc - minimum_desired_capacity;
-
- if (MaxHeapFreeRatio < 100) {
- const double maximum_free_percentage = MaxHeapFreeRatio / 100.0;
- const double minimum_used_percentage = 1.0 - maximum_free_percentage;
- const double max_tmp = used_after_gc / minimum_used_percentage;
- size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx));
- maximum_desired_capacity = MAX2(maximum_desired_capacity,
- spec()->init_size());
- if (PrintGC && Verbose) {
- gclog_or_tty->print_cr(" "
- " maximum_free_percentage: %6.2f"
- " minimum_used_percentage: %6.2f",
- maximum_free_percentage,
- minimum_used_percentage);
- gclog_or_tty->print_cr(" "
- " _capacity_at_prologue: %6.1fK"
- " minimum_desired_capacity: %6.1fK"
- " maximum_desired_capacity: %6.1fK",
- _capacity_at_prologue / (double) K,
- minimum_desired_capacity / (double) K,
- maximum_desired_capacity / (double) K);
- }
- assert(minimum_desired_capacity <= maximum_desired_capacity,
- "sanity check");
-
- if (capacity_after_gc > maximum_desired_capacity) {
- // Capacity too large, compute shrinking size
- shrink_bytes = capacity_after_gc - maximum_desired_capacity;
- // We don't want shrink all the way back to initSize if people call
- // System.gc(), because some programs do that between "phases" and then
- // we'd just have to grow the heap up again for the next phase. So we
- // damp the shrinking: 0% on the first call, 10% on the second call, 40%
- // on the third call, and 100% by the fourth call. But if we recompute
- // size without shrinking, it goes back to 0%.
- shrink_bytes = shrink_bytes / 100 * current_shrink_factor;
- assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size");
- if (current_shrink_factor == 0) {
- _shrink_factor = 10;
- } else {
- _shrink_factor = MIN2(current_shrink_factor * 4, (size_t) 100);
- }
- if (PrintGC && Verbose) {
- gclog_or_tty->print_cr(" "
- " shrinking:"
- " initSize: %.1fK"
- " maximum_desired_capacity: %.1fK",
- spec()->init_size() / (double) K,
- maximum_desired_capacity / (double) K);
- gclog_or_tty->print_cr(" "
- " shrink_bytes: %.1fK"
- " current_shrink_factor: " SIZE_FORMAT
- " new shrink factor: " SIZE_FORMAT
- " _min_heap_delta_bytes: %.1fK",
- shrink_bytes / (double) K,
- current_shrink_factor,
- _shrink_factor,
- _min_heap_delta_bytes / (double) K);
- }
- }
- }
-
- if (capacity_after_gc > _capacity_at_prologue) {
- // We might have expanded for promotions, in which case we might want to
- // take back that expansion if there's room after GC. That keeps us from
- // stretching the heap with promotions when there's plenty of room.
- size_t expansion_for_promotion = capacity_after_gc - _capacity_at_prologue;
- expansion_for_promotion = MIN2(expansion_for_promotion, max_shrink_bytes);
- // We have two shrinking computations, take the largest
- shrink_bytes = MAX2(shrink_bytes, expansion_for_promotion);
- assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size");
- if (PrintGC && Verbose) {
- gclog_or_tty->print_cr(" "
- " aggressive shrinking:"
- " _capacity_at_prologue: %.1fK"
- " capacity_after_gc: %.1fK"
- " expansion_for_promotion: %.1fK"
- " shrink_bytes: %.1fK",
- capacity_after_gc / (double) K,
- _capacity_at_prologue / (double) K,
- expansion_for_promotion / (double) K,
- shrink_bytes / (double) K);
- }
- }
- // Don't shrink unless it's significant
- if (shrink_bytes >= _min_heap_delta_bytes) {
- shrink(shrink_bytes);
- }
-}
-
-// Currently nothing to do.
-void CardGeneration::prepare_for_verify() {}
-
diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp
index e9c352e10b4..058f757de01 100644
--- a/hotspot/src/share/vm/memory/generation.hpp
+++ b/hotspot/src/share/vm/memory/generation.hpp
@@ -584,57 +584,4 @@ public:
virtual CollectorCounters* counters() { return _gc_counters; }
};
-// Class CardGeneration is a generation that is covered by a card table,
-// and uses a card-size block-offset array to implement block_start.
-
-// class BlockOffsetArray;
-// class BlockOffsetArrayContigSpace;
-class BlockOffsetSharedArray;
-
-class CardGeneration: public Generation {
- friend class VMStructs;
- protected:
- // This is shared with other generations.
- GenRemSet* _rs;
- // This is local to this generation.
- BlockOffsetSharedArray* _bts;
-
- // current shrinking effect: this damps shrinking when the heap gets empty.
- size_t _shrink_factor;
-
- size_t _min_heap_delta_bytes; // Minimum amount to expand.
-
- // Some statistics from before gc started.
- // These are gathered in the gc_prologue (and should_collect)
- // to control growing/shrinking policy in spite of promotions.
- size_t _capacity_at_prologue;
- size_t _used_at_prologue;
-
- CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level,
- GenRemSet* remset);
-
- public:
-
- // Attempt to expand the generation by "bytes". Expand by at a
- // minimum "expand_bytes". Return true if some amount (not
- // necessarily the full "bytes") was done.
- virtual bool expand(size_t bytes, size_t expand_bytes);
-
- // Shrink generation with specified size (returns false if unable to shrink)
- virtual void shrink(size_t bytes) = 0;
-
- virtual void compute_new_size();
-
- virtual void clear_remembered_set();
-
- virtual void invalidate_remembered_set();
-
- virtual void prepare_for_verify();
-
- // Grow generation with specified size (returns false if unable to grow)
- virtual bool grow_by(size_t bytes) = 0;
- // Grow generation to reserved size.
- virtual bool grow_to_reserved() = 0;
-};
-
#endif // SHARE_VM_MEMORY_GENERATION_HPP
diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index 0b4d69efb83..0a922ca67e5 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -3158,7 +3158,25 @@ void Metaspace::global_initialize() {
SharedMiscDataSize = align_size_up(SharedMiscDataSize, max_alignment);
SharedMiscCodeSize = align_size_up(SharedMiscCodeSize, max_alignment);
- // the min_misc_code_size estimate is based on MetaspaceShared::generate_vtable_methods()
+ // make sure SharedReadOnlySize and SharedReadWriteSize are not less than
+ // the minimum values.
+ if (SharedReadOnlySize < MetaspaceShared::min_ro_size){
+ report_out_of_shared_space(SharedReadOnly);
+ }
+
+ if (SharedReadWriteSize < MetaspaceShared::min_rw_size){
+ report_out_of_shared_space(SharedReadWrite);
+ }
+
+ // the min_misc_data_size and min_misc_code_size estimates are based on
+ // MetaspaceShared::generate_vtable_methods()
+ uint min_misc_data_size = align_size_up(
+ MetaspaceShared::num_virtuals * MetaspaceShared::vtbl_list_size * sizeof(void*), max_alignment);
+
+ if (SharedMiscDataSize < min_misc_data_size) {
+ report_out_of_shared_space(SharedMiscData);
+ }
+
uintx min_misc_code_size = align_size_up(
(MetaspaceShared::num_virtuals * MetaspaceShared::vtbl_list_size) *
(sizeof(void*) + MetaspaceShared::vtbl_method_size) + MetaspaceShared::vtbl_common_code_size,
diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp
index b6edbae988a..26729be6efd 100644
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp
@@ -969,7 +969,7 @@ bool MetaspaceShared::map_shared_spaces(FileMapInfo* mapinfo) {
#endif
// If -Xshare:on is specified, print out the error message and exit VM,
// otherwise, set UseSharedSpaces to false and continue.
- if (RequireSharedSpaces) {
+ if (RequireSharedSpaces || PrintSharedArchiveAndExit) {
vm_exit_during_initialization("Unable to use shared archive.", "Failed map_region for using -Xshare:on.");
} else {
FLAG_SET_DEFAULT(UseSharedSpaces, false);
diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp
index cb34465ec69..e6e2c9a353e 100644
--- a/hotspot/src/share/vm/memory/metaspaceShared.hpp
+++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp
@@ -69,6 +69,11 @@ class MetaspaceShared : AllStatic {
vtbl_common_code_size = (1*K) // conservative size of the "common_code" for the x64 platform
};
+ enum {
+ min_ro_size = NOT_LP64(8*M) LP64_ONLY(9*M), // minimum ro and rw regions sizes based on dumping
+ min_rw_size = NOT_LP64(7*M) LP64_ONLY(12*M) // of a shared archive using the default classlist
+ };
+
enum {
ro = 0, // read-only shared space in the heap
rw = 1, // read-write shared space in the heap
diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.cpp b/hotspot/src/share/vm/memory/tenuredGeneration.cpp
index 37cd32c8585..aa1c51237ed 100644
--- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp
+++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -235,34 +235,6 @@ bool TenuredGeneration::expand(size_t bytes, size_t expand_bytes) {
return CardGeneration::expand(bytes, expand_bytes);
}
-
-void TenuredGeneration::shrink(size_t bytes) {
- assert_locked_or_safepoint(ExpandHeap_lock);
- size_t size = ReservedSpace::page_align_size_down(bytes);
- if (size > 0) {
- shrink_by(size);
- }
-}
-
-
-size_t TenuredGeneration::capacity() const {
- return _the_space->capacity();
-}
-
-
-size_t TenuredGeneration::used() const {
- return _the_space->used();
-}
-
-
-size_t TenuredGeneration::free() const {
- return _the_space->free();
-}
-
-MemRegion TenuredGeneration::used_region() const {
- return the_space()->used_region();
-}
-
size_t TenuredGeneration::unsafe_max_alloc_nogc() const {
return _the_space->free();
}
@@ -271,74 +243,8 @@ size_t TenuredGeneration::contiguous_available() const {
return _the_space->free() + _virtual_space.uncommitted_size();
}
-bool TenuredGeneration::grow_by(size_t bytes) {
+void TenuredGeneration::assert_correct_size_change_locking() {
assert_locked_or_safepoint(ExpandHeap_lock);
- bool result = _virtual_space.expand_by(bytes);
- if (result) {
- size_t new_word_size =
- heap_word_size(_virtual_space.committed_size());
- MemRegion mr(_the_space->bottom(), new_word_size);
- // Expand card table
- Universe::heap()->barrier_set()->resize_covered_region(mr);
- // Expand shared block offset array
- _bts->resize(new_word_size);
-
- // Fix for bug #4668531
- if (ZapUnusedHeapArea) {
- MemRegion mangle_region(_the_space->end(),
- (HeapWord*)_virtual_space.high());
- SpaceMangler::mangle_region(mangle_region);
- }
-
- // Expand space -- also expands space's BOT
- // (which uses (part of) shared array above)
- _the_space->set_end((HeapWord*)_virtual_space.high());
-
- // update the space and generation capacity counters
- update_counters();
-
- if (Verbose && PrintGC) {
- size_t new_mem_size = _virtual_space.committed_size();
- size_t old_mem_size = new_mem_size - bytes;
- gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by "
- SIZE_FORMAT "K to " SIZE_FORMAT "K",
- name(), old_mem_size/K, bytes/K, new_mem_size/K);
- }
- }
- return result;
-}
-
-
-bool TenuredGeneration::grow_to_reserved() {
- assert_locked_or_safepoint(ExpandHeap_lock);
- bool success = true;
- const size_t remaining_bytes = _virtual_space.uncommitted_size();
- if (remaining_bytes > 0) {
- success = grow_by(remaining_bytes);
- DEBUG_ONLY(if (!success) warning("grow to reserved failed");)
- }
- return success;
-}
-
-void TenuredGeneration::shrink_by(size_t bytes) {
- assert_locked_or_safepoint(ExpandHeap_lock);
- // Shrink committed space
- _virtual_space.shrink_by(bytes);
- // Shrink space; this also shrinks the space's BOT
- _the_space->set_end((HeapWord*) _virtual_space.high());
- size_t new_word_size = heap_word_size(_the_space->capacity());
- // Shrink the shared block offset array
- _bts->resize(new_word_size);
- MemRegion mr(_the_space->bottom(), new_word_size);
- // Shrink the card table
- Universe::heap()->barrier_set()->resize_covered_region(mr);
-
- if (Verbose && PrintGC) {
- size_t new_mem_size = _virtual_space.committed_size();
- size_t old_mem_size = new_mem_size + bytes;
- gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
- name(), old_mem_size/K, new_mem_size/K);
- }
}
// Currently nothing to do.
@@ -348,27 +254,14 @@ void TenuredGeneration::object_iterate(ObjectClosure* blk) {
_the_space->object_iterate(blk);
}
-void TenuredGeneration::space_iterate(SpaceClosure* blk,
- bool usedOnly) {
- blk->do_space(_the_space);
-}
-
-void TenuredGeneration::younger_refs_iterate(OopsInGenClosure* blk) {
- blk->set_generation(this);
- younger_refs_in_space_iterate(_the_space, blk);
- blk->reset_generation();
-}
-
void TenuredGeneration::save_marks() {
_the_space->set_saved_mark();
}
-
void TenuredGeneration::reset_saved_marks() {
_the_space->reset_saved_mark();
}
-
bool TenuredGeneration::no_allocs_since_save_marks() {
return _the_space->saved_mark_at_top();
}
@@ -387,28 +280,25 @@ ALL_SINCE_SAVE_MARKS_CLOSURES(TenuredGen_SINCE_SAVE_MARKS_ITERATE_DEFN)
#undef TenuredGen_SINCE_SAVE_MARKS_ITERATE_DEFN
-
void TenuredGeneration::gc_epilogue(bool full) {
- _last_gc = WaterMark(the_space(), the_space()->top());
-
// update the generation and space performance counters
update_counters();
if (ZapUnusedHeapArea) {
- the_space()->check_mangled_unused_area_complete();
+ _the_space->check_mangled_unused_area_complete();
}
}
void TenuredGeneration::record_spaces_top() {
assert(ZapUnusedHeapArea, "Not mangling unused space");
- the_space()->set_top_for_allocations();
+ _the_space->set_top_for_allocations();
}
void TenuredGeneration::verify() {
- the_space()->verify();
+ _the_space->verify();
}
void TenuredGeneration::print_on(outputStream* st) const {
Generation::print_on(st);
st->print(" the");
- the_space()->print_on(st);
+ _the_space->print_on(st);
}
diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.hpp b/hotspot/src/share/vm/memory/tenuredGeneration.hpp
index 0ecd54dd55f..5417e69cb7f 100644
--- a/hotspot/src/share/vm/memory/tenuredGeneration.hpp
+++ b/hotspot/src/share/vm/memory/tenuredGeneration.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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,7 +28,7 @@
#include "gc_implementation/shared/cSpaceCounters.hpp"
#include "gc_implementation/shared/gcStats.hpp"
#include "gc_implementation/shared/generationCounters.hpp"
-#include "memory/generation.hpp"
+#include "memory/cardGeneration.hpp"
#include "utilities/macros.hpp"
// TenuredGeneration models the heap containing old (promoted/tenured) objects
@@ -42,27 +42,18 @@ class TenuredGeneration: public CardGeneration {
friend class VM_PopulateDumpSharedSpace;
protected:
- ContiguousSpace* _the_space; // actual space holding objects
- WaterMark _last_gc; // watermark between objects allocated before
- // and after last GC.
+ ContiguousSpace* _the_space; // Actual space holding objects
GenerationCounters* _gen_counters;
CSpaceCounters* _space_counters;
- // Grow generation with specified size (returns false if unable to grow)
- virtual bool grow_by(size_t bytes);
- // Grow generation to reserved size.
- virtual bool grow_to_reserved();
- // Shrink generation with specified size (returns false if unable to shrink)
- void shrink_by(size_t bytes);
-
// Allocation failure
virtual bool expand(size_t bytes, size_t expand_bytes);
- void shrink(size_t bytes);
// Accessing spaces
- ContiguousSpace* the_space() const { return _the_space; }
+ ContiguousSpace* space() const { return _the_space; }
+ void assert_correct_size_change_locking();
public:
TenuredGeneration(ReservedSpace rs, size_t initial_byte_size,
int level, GenRemSet* remset);
@@ -81,33 +72,15 @@ class TenuredGeneration: public CardGeneration {
return !ScavengeBeforeFullGC;
}
- inline bool is_in(const void* p) const;
-
- // Space enquiries
- size_t capacity() const;
- size_t used() const;
- size_t free() const;
-
- MemRegion used_region() const;
-
size_t unsafe_max_alloc_nogc() const;
size_t contiguous_available() const;
// Iteration
void object_iterate(ObjectClosure* blk);
- void space_iterate(SpaceClosure* blk, bool usedOnly = false);
-
- void younger_refs_iterate(OopsInGenClosure* blk);
-
- inline CompactibleSpace* first_compaction_space() const;
virtual inline HeapWord* allocate(size_t word_size, bool is_tlab);
virtual inline HeapWord* par_allocate(size_t word_size, bool is_tlab);
- // Accessing marks
- inline WaterMark top_mark();
- inline WaterMark bottom_mark();
-
#define TenuredGen_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix) \
void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl);
TenuredGen_SINCE_SAVE_MARKS_DECL(OopsInGenClosure,_v)
diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.inline.hpp b/hotspot/src/share/vm/memory/tenuredGeneration.inline.hpp
index 0aa4c6d2d3b..aea97ea317a 100644
--- a/hotspot/src/share/vm/memory/tenuredGeneration.inline.hpp
+++ b/hotspot/src/share/vm/memory/tenuredGeneration.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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,53 +22,35 @@
*
*/
-#ifndef SHARE_VM_MEMORY_GENERATION_INLINE_HPP
-#define SHARE_VM_MEMORY_GENERATION_INLINE_HPP
+#ifndef SHARE_VM_MEMORY_TENUREDGENERATION_INLINE_HPP
+#define SHARE_VM_MEMORY_TENUREDGENERATION_INLINE_HPP
-#include "memory/genCollectedHeap.hpp"
#include "memory/space.hpp"
#include "memory/tenuredGeneration.hpp"
-bool TenuredGeneration::is_in(const void* p) const {
- return the_space()->is_in(p);
-}
-
-
-WaterMark TenuredGeneration::top_mark() {
- return the_space()->top_mark();
-}
-
-CompactibleSpace*
-TenuredGeneration::first_compaction_space() const {
- return the_space();
-}
-
HeapWord* TenuredGeneration::allocate(size_t word_size,
bool is_tlab) {
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
- return the_space()->allocate(word_size);
+ return _the_space->allocate(word_size);
}
HeapWord* TenuredGeneration::par_allocate(size_t word_size,
bool is_tlab) {
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
- return the_space()->par_allocate(word_size);
-}
-
-WaterMark TenuredGeneration::bottom_mark() {
- return the_space()->bottom_mark();
+ return _the_space->par_allocate(word_size);
}
size_t TenuredGeneration::block_size(const HeapWord* addr) const {
- if (addr < the_space()->top()) return oop(addr)->size();
- else {
- assert(addr == the_space()->top(), "non-block head arg to block_size");
- return the_space()->end() - the_space()->top();
+ if (addr < _the_space->top()) {
+ return oop(addr)->size();
+ } else {
+ assert(addr == _the_space->top(), "non-block head arg to block_size");
+ return _the_space->end() - _the_space->top();
}
}
bool TenuredGeneration::block_is_obj(const HeapWord* addr) const {
- return addr < the_space()->top();
+ return addr < _the_space ->top();
}
-#endif // SHARE_VM_MEMORY_GENERATION_INLINE_HPP
+#endif // SHARE_VM_MEMORY_TENUREDGENERATION_INLINE_HPP
diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp
index 64f16f78467..02c642f13a4 100644
--- a/hotspot/src/share/vm/oops/cpCache.cpp
+++ b/hotspot/src/share/vm/oops/cpCache.cpp
@@ -287,9 +287,13 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
// the lock, so that when the losing writer returns, he can use the linked
// cache entry.
- // Use the lock from the metaspace for this, which cannot stop for safepoint.
- Mutex* metaspace_lock = cpool->pool_holder()->class_loader_data()->metaspace_lock();
- MutexLockerEx ml(metaspace_lock, Mutex::_no_safepoint_check_flag);
+ objArrayHandle resolved_references = cpool->resolved_references();
+ // Use the resolved_references() lock for this cpCache entry.
+ // resolved_references are created for all classes with Invokedynamic, MethodHandle
+ // or MethodType constant pool cache entries.
+ assert(resolved_references() != NULL,
+ "a resolved_references array should have been created for this class");
+ ObjectLocker ol(resolved_references, Thread::current());
if (!is_f1_null()) {
return;
}
@@ -336,7 +340,6 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
// This allows us to create fewer Methods, while keeping type safety.
//
- objArrayHandle resolved_references = cpool->resolved_references();
// Store appendix, if any.
if (has_appendix) {
const int appendix_index = f2_as_index() + _indy_resolved_references_appendix_offset;
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index ce0d25badd0..c94770f9195 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -115,8 +115,6 @@ exit_hook_t Arguments::_exit_hook = NULL;
vfprintf_hook_t Arguments::_vfprintf_hook = NULL;
-SystemProperty *Arguments::_java_ext_dirs = NULL;
-SystemProperty *Arguments::_java_endorsed_dirs = NULL;
SystemProperty *Arguments::_sun_boot_library_path = NULL;
SystemProperty *Arguments::_java_library_path = NULL;
SystemProperty *Arguments::_java_home = NULL;
@@ -125,9 +123,10 @@ SystemProperty *Arguments::_sun_boot_class_path = NULL;
char* Arguments::_meta_index_path = NULL;
char* Arguments::_meta_index_dir = NULL;
+char* Arguments::_ext_dirs = NULL;
-// Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
-
+// Check if head of 'option' matches 'name', and sets 'tail' to the remaining
+// part of the option string.
static bool match_option(const JavaVMOption *option, const char* name,
const char** tail) {
int len = (int)strlen(name);
@@ -139,6 +138,32 @@ static bool match_option(const JavaVMOption *option, const char* name,
}
}
+// Check if 'option' matches 'name'. No "tail" is allowed.
+static bool match_option(const JavaVMOption *option, const char* name) {
+ const char* tail = NULL;
+ bool result = match_option(option, name, &tail);
+ if (tail != NULL && *tail == '\0') {
+ return result;
+ } else {
+ return false;
+ }
+}
+
+// Return true if any of the strings in null-terminated array 'names' matches.
+// If tail_allowed is true, then the tail must begin with a colon; otherwise,
+// the option must match exactly.
+static bool match_option(const JavaVMOption* option, const char** names, const char** tail,
+ bool tail_allowed) {
+ for (/* empty */; *names != NULL; ++names) {
+ if (match_option(option, *names, tail)) {
+ if (**tail == '\0' || tail_allowed && **tail == ':') {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
static void logOption(const char* opt) {
if (PrintVMOptions) {
jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt);
@@ -184,8 +209,6 @@ void Arguments::init_system_properties() {
// Following are JVMTI agent writable properties.
// Properties values are set to NULL and they are
// os specific they are initialized in os::init_system_properties_values().
- _java_ext_dirs = new SystemProperty("java.ext.dirs", NULL, true);
- _java_endorsed_dirs = new SystemProperty("java.endorsed.dirs", NULL, true);
_sun_boot_library_path = new SystemProperty("sun.boot.library.path", NULL, true);
_java_library_path = new SystemProperty("java.library.path", NULL, true);
_java_home = new SystemProperty("java.home", NULL, true);
@@ -194,8 +217,6 @@ void Arguments::init_system_properties() {
_java_class_path = new SystemProperty("java.class.path", "", true);
// Add to System Property list.
- PropertyList_add(&_system_properties, _java_ext_dirs);
- PropertyList_add(&_system_properties, _java_endorsed_dirs);
PropertyList_add(&_system_properties, _sun_boot_library_path);
PropertyList_add(&_system_properties, _java_library_path);
PropertyList_add(&_system_properties, _java_home);
@@ -348,13 +369,9 @@ bool Arguments::is_newly_obsolete(const char *s, JDK_Version* version) {
// components, in order:
//
// prefix // from -Xbootclasspath/p:...
-// endorsed // the expansion of -Djava.endorsed.dirs=...
// base // from os::get_system_properties() or -Xbootclasspath=
// suffix // from -Xbootclasspath/a:...
//
-// java.endorsed.dirs is a list of directories; any jar or zip files in the
-// directories are added to the sysclasspath just before the base.
-//
// This could be AllStatic, but it isn't needed after argument processing is
// complete.
class SysClassPath: public StackObj {
@@ -368,16 +385,9 @@ public:
inline void add_suffix(const char* suffix);
inline void reset_path(const char* base);
- // Expand the jar/zip files in each directory listed by the java.endorsed.dirs
- // property. Must be called after all command-line arguments have been
- // processed (in particular, -Djava.endorsed.dirs=...) and before calling
- // combined_path().
- void expand_endorsed();
-
inline const char* get_base() const { return _items[_scp_base]; }
inline const char* get_prefix() const { return _items[_scp_prefix]; }
inline const char* get_suffix() const { return _items[_scp_suffix]; }
- inline const char* get_endorsed() const { return _items[_scp_endorsed]; }
// Combine all the components into a single c-heap-allocated string; caller
// must free the string if/when no longer needed.
@@ -394,20 +404,17 @@ private:
// base are allocated in the C heap and freed by this class.
enum {
_scp_prefix, // from -Xbootclasspath/p:...
- _scp_endorsed, // the expansion of -Djava.endorsed.dirs=...
_scp_base, // the default sysclasspath
_scp_suffix, // from -Xbootclasspath/a:...
_scp_nitems // the number of items, must be last.
};
const char* _items[_scp_nitems];
- DEBUG_ONLY(bool _expansion_done;)
};
SysClassPath::SysClassPath(const char* base) {
memset(_items, 0, sizeof(_items));
_items[_scp_base] = base;
- DEBUG_ONLY(_expansion_done = false;)
}
SysClassPath::~SysClassPath() {
@@ -415,7 +422,6 @@ SysClassPath::~SysClassPath() {
for (int i = 0; i < _scp_nitems; ++i) {
if (i != _scp_base) reset_item_at(i);
}
- DEBUG_ONLY(_expansion_done = false;)
}
inline void SysClassPath::set_base(const char* base) {
@@ -451,41 +457,11 @@ inline void SysClassPath::reset_path(const char* base) {
//------------------------------------------------------------------------------
-void SysClassPath::expand_endorsed() {
- assert(_items[_scp_endorsed] == NULL, "can only be called once.");
-
- const char* path = Arguments::get_property("java.endorsed.dirs");
- if (path == NULL) {
- path = Arguments::get_endorsed_dir();
- assert(path != NULL, "no default for java.endorsed.dirs");
- }
-
- char* expanded_path = NULL;
- const char separator = *os::path_separator();
- const char* const end = path + strlen(path);
- while (path < end) {
- const char* tmp_end = strchr(path, separator);
- if (tmp_end == NULL) {
- expanded_path = add_jars_to_path(expanded_path, path);
- path = end;
- } else {
- char* dirpath = NEW_C_HEAP_ARRAY(char, tmp_end - path + 1, mtInternal);
- memcpy(dirpath, path, tmp_end - path);
- dirpath[tmp_end - path] = '\0';
- expanded_path = add_jars_to_path(expanded_path, dirpath);
- FREE_C_HEAP_ARRAY(char, dirpath);
- path = tmp_end + 1;
- }
- }
- _items[_scp_endorsed] = expanded_path;
- DEBUG_ONLY(_expansion_done = true;)
-}
// Combine the bootclasspath elements, some of which may be null, into a single
// c-heap-allocated string.
char* SysClassPath::combined_path() {
assert(_items[_scp_base] != NULL, "empty default sysclasspath");
- assert(_expansion_done, "must call expand_endorsed() first.");
size_t lengths[_scp_nitems];
size_t total_len = 0;
@@ -2576,21 +2552,6 @@ static const char* system_assertion_options[] = {
"-dsa", "-esa", "-disablesystemassertions", "-enablesystemassertions", 0
};
-// Return true if any of the strings in null-terminated array 'names' matches.
-// If tail_allowed is true, then the tail must begin with a colon; otherwise,
-// the option must match exactly.
-static bool match_option(const JavaVMOption* option, const char** names, const char** tail,
- bool tail_allowed) {
- for (/* empty */; *names != NULL; ++names) {
- if (match_option(option, *names, tail)) {
- if (**tail == '\0' || tail_allowed && **tail == ':') {
- return true;
- }
- }
- }
- return false;
-}
-
bool Arguments::parse_uintx(const char* value,
uintx* uintx_arg,
uintx min_size) {
@@ -2832,16 +2793,16 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
}
#endif // !INCLUDE_JVMTI
// -Xnoclassgc
- } else if (match_option(option, "-Xnoclassgc", &tail)) {
+ } else if (match_option(option, "-Xnoclassgc")) {
FLAG_SET_CMDLINE(bool, ClassUnloading, false);
// -Xconcgc
- } else if (match_option(option, "-Xconcgc", &tail)) {
+ } else if (match_option(option, "-Xconcgc")) {
FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
// -Xnoconcgc
- } else if (match_option(option, "-Xnoconcgc", &tail)) {
+ } else if (match_option(option, "-Xnoconcgc")) {
FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
// -Xbatch
- } else if (match_option(option, "-Xbatch", &tail)) {
+ } else if (match_option(option, "-Xbatch")) {
FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
// -Xmn for compatibility with other JVM vendors
} else if (match_option(option, "-Xmn", &tail)) {
@@ -2986,28 +2947,28 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
}
FLAG_SET_CMDLINE(uintx, IncreaseFirstTierCompileThresholdAt, (uintx)uint_IncreaseFirstTierCompileThresholdAt);
// -green
- } else if (match_option(option, "-green", &tail)) {
+ } else if (match_option(option, "-green")) {
jio_fprintf(defaultStream::error_stream(),
"Green threads support not available\n");
return JNI_EINVAL;
// -native
- } else if (match_option(option, "-native", &tail)) {
+ } else if (match_option(option, "-native")) {
// HotSpot always uses native threads, ignore silently for compatibility
// -Xsqnopause
- } else if (match_option(option, "-Xsqnopause", &tail)) {
+ } else if (match_option(option, "-Xsqnopause")) {
// EVM option, ignore silently for compatibility
// -Xrs
- } else if (match_option(option, "-Xrs", &tail)) {
+ } else if (match_option(option, "-Xrs")) {
// Classic/EVM option, new functionality
FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true);
- } else if (match_option(option, "-Xusealtsigs", &tail)) {
+ } else if (match_option(option, "-Xusealtsigs")) {
// change default internal VM signals used - lower case for back compat
FLAG_SET_CMDLINE(bool, UseAltSigs, true);
// -Xoptimize
- } else if (match_option(option, "-Xoptimize", &tail)) {
+ } else if (match_option(option, "-Xoptimize")) {
// EVM option, ignore silently for compatibility
// -Xprof
- } else if (match_option(option, "-Xprof", &tail)) {
+ } else if (match_option(option, "-Xprof")) {
#if INCLUDE_FPROF
_has_profile = true;
#else // INCLUDE_FPROF
@@ -3016,7 +2977,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
return JNI_ERR;
#endif // INCLUDE_FPROF
// -Xconcurrentio
- } else if (match_option(option, "-Xconcurrentio", &tail)) {
+ } else if (match_option(option, "-Xconcurrentio")) {
FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true);
FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1);
@@ -3024,18 +2985,32 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
FLAG_SET_CMDLINE(uintx, NewSizeThreadIncrease, 16 * K); // 20Kb per thread added to new generation
// -Xinternalversion
- } else if (match_option(option, "-Xinternalversion", &tail)) {
+ } else if (match_option(option, "-Xinternalversion")) {
jio_fprintf(defaultStream::output_stream(), "%s\n",
VM_Version::internal_vm_info_string());
vm_exit(0);
#ifndef PRODUCT
// -Xprintflags
- } else if (match_option(option, "-Xprintflags", &tail)) {
+ } else if (match_option(option, "-Xprintflags")) {
CommandLineFlags::printFlags(tty, false);
vm_exit(0);
#endif
// -D
} else if (match_option(option, "-D", &tail)) {
+ if (match_option(option, "-Djava.endorsed.dirs=", &tail)) {
+ // abort if -Djava.endorsed.dirs is set
+ jio_fprintf(defaultStream::output_stream(),
+ "-Djava.endorsed.dirs is not supported. Endorsed standards and standalone APIs\n"
+ "in modular form will be supported via the concept of upgradeable modules.\n");
+ return JNI_EINVAL;
+ }
+ if (match_option(option, "-Djava.ext.dirs=", &tail)) {
+ // abort if -Djava.ext.dirs is set
+ jio_fprintf(defaultStream::output_stream(),
+ "-Djava.ext.dirs is not supported. Use -classpath instead.\n");
+ return JNI_EINVAL;
+ }
+
if (!add_property(tail)) {
return JNI_ENOMEM;
}
@@ -3050,29 +3025,29 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
#endif
}
// -Xint
- } else if (match_option(option, "-Xint", &tail)) {
+ } else if (match_option(option, "-Xint")) {
set_mode_flags(_int);
// -Xmixed
- } else if (match_option(option, "-Xmixed", &tail)) {
+ } else if (match_option(option, "-Xmixed")) {
set_mode_flags(_mixed);
// -Xcomp
- } else if (match_option(option, "-Xcomp", &tail)) {
+ } else if (match_option(option, "-Xcomp")) {
// for testing the compiler; turn off all flags that inhibit compilation
set_mode_flags(_comp);
// -Xshare:dump
- } else if (match_option(option, "-Xshare:dump", &tail)) {
+ } else if (match_option(option, "-Xshare:dump")) {
FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
set_mode_flags(_int); // Prevent compilation, which creates objects
// -Xshare:on
- } else if (match_option(option, "-Xshare:on", &tail)) {
+ } else if (match_option(option, "-Xshare:on")) {
FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true);
// -Xshare:auto
- } else if (match_option(option, "-Xshare:auto", &tail)) {
+ } else if (match_option(option, "-Xshare:auto")) {
FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false);
// -Xshare:off
- } else if (match_option(option, "-Xshare:off", &tail)) {
+ } else if (match_option(option, "-Xshare:off")) {
FLAG_SET_CMDLINE(bool, UseSharedSpaces, false);
FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false);
// -Xverify
@@ -3090,13 +3065,13 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
return JNI_EINVAL;
}
// -Xdebug
- } else if (match_option(option, "-Xdebug", &tail)) {
+ } else if (match_option(option, "-Xdebug")) {
// note this flag has been used, then ignore
set_xdebug_mode(true);
// -Xnoagent
- } else if (match_option(option, "-Xnoagent", &tail)) {
+ } else if (match_option(option, "-Xnoagent")) {
// For compatibility with classic. HotSpot refuses to load the old style agent.dll.
- } else if (match_option(option, "-Xboundthreads", &tail)) {
+ } else if (match_option(option, "-Xboundthreads")) {
// Bind user level threads to kernel threads (Solaris only)
FLAG_SET_CMDLINE(bool, UseBoundThreads, true);
} else if (match_option(option, "-Xloggc:", &tail)) {
@@ -3126,14 +3101,14 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
"check")) {
return JNI_EINVAL;
}
- } else if (match_option(option, "vfprintf", &tail)) {
+ } else if (match_option(option, "vfprintf")) {
_vfprintf_hook = CAST_TO_FN_PTR(vfprintf_hook_t, option->extraInfo);
- } else if (match_option(option, "exit", &tail)) {
+ } else if (match_option(option, "exit")) {
_exit_hook = CAST_TO_FN_PTR(exit_hook_t, option->extraInfo);
- } else if (match_option(option, "abort", &tail)) {
+ } else if (match_option(option, "abort")) {
_abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
// -XX:+AggressiveHeap
- } else if (match_option(option, "-XX:+AggressiveHeap", &tail)) {
+ } else if (match_option(option, "-XX:+AggressiveHeap")) {
// This option inspects the machine and attempts to set various
// parameters to be optimal for long-running, memory allocation
@@ -3224,11 +3199,11 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
// Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
// and the last option wins.
- } else if (match_option(option, "-XX:+NeverTenure", &tail)) {
+ } else if (match_option(option, "-XX:+NeverTenure")) {
FLAG_SET_CMDLINE(bool, NeverTenure, true);
FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1);
- } else if (match_option(option, "-XX:+AlwaysTenure", &tail)) {
+ } else if (match_option(option, "-XX:+AlwaysTenure")) {
FLAG_SET_CMDLINE(bool, NeverTenure, false);
FLAG_SET_CMDLINE(bool, AlwaysTenure, true);
FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
@@ -3247,17 +3222,17 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
FLAG_SET_CMDLINE(bool, NeverTenure, false);
FLAG_SET_CMDLINE(bool, AlwaysTenure, false);
}
- } else if (match_option(option, "-XX:+CMSPermGenSweepingEnabled", &tail) ||
- match_option(option, "-XX:-CMSPermGenSweepingEnabled", &tail)) {
+ } else if (match_option(option, "-XX:+CMSPermGenSweepingEnabled") ||
+ match_option(option, "-XX:-CMSPermGenSweepingEnabled")) {
jio_fprintf(defaultStream::error_stream(),
"Please use CMSClassUnloadingEnabled in place of "
"CMSPermGenSweepingEnabled in the future\n");
- } else if (match_option(option, "-XX:+UseGCTimeLimit", &tail)) {
+ } else if (match_option(option, "-XX:+UseGCTimeLimit")) {
FLAG_SET_CMDLINE(bool, UseGCOverheadLimit, true);
jio_fprintf(defaultStream::error_stream(),
"Please use -XX:+UseGCOverheadLimit in place of "
"-XX:+UseGCTimeLimit in the future\n");
- } else if (match_option(option, "-XX:-UseGCTimeLimit", &tail)) {
+ } else if (match_option(option, "-XX:-UseGCTimeLimit")) {
FLAG_SET_CMDLINE(bool, UseGCOverheadLimit, false);
jio_fprintf(defaultStream::error_stream(),
"Please use -XX:-UseGCOverheadLimit in place of "
@@ -3267,13 +3242,13 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
// are not to be documented.
} else if (match_option(option, "-XX:MaxTLERatio=", &tail)) {
// No longer used.
- } else if (match_option(option, "-XX:+ResizeTLE", &tail)) {
+ } else if (match_option(option, "-XX:+ResizeTLE")) {
FLAG_SET_CMDLINE(bool, ResizeTLAB, true);
- } else if (match_option(option, "-XX:-ResizeTLE", &tail)) {
+ } else if (match_option(option, "-XX:-ResizeTLE")) {
FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
- } else if (match_option(option, "-XX:+PrintTLE", &tail)) {
+ } else if (match_option(option, "-XX:+PrintTLE")) {
FLAG_SET_CMDLINE(bool, PrintTLAB, true);
- } else if (match_option(option, "-XX:-PrintTLE", &tail)) {
+ } else if (match_option(option, "-XX:-PrintTLE")) {
FLAG_SET_CMDLINE(bool, PrintTLAB, false);
} else if (match_option(option, "-XX:TLEFragmentationRatio=", &tail)) {
// No longer used.
@@ -3289,17 +3264,17 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
FLAG_SET_CMDLINE(uintx, TLABSize, long_tlab_size);
} else if (match_option(option, "-XX:TLEThreadRatio=", &tail)) {
// No longer used.
- } else if (match_option(option, "-XX:+UseTLE", &tail)) {
+ } else if (match_option(option, "-XX:+UseTLE")) {
FLAG_SET_CMDLINE(bool, UseTLAB, true);
- } else if (match_option(option, "-XX:-UseTLE", &tail)) {
+ } else if (match_option(option, "-XX:-UseTLE")) {
FLAG_SET_CMDLINE(bool, UseTLAB, false);
- } else if (match_option(option, "-XX:+DisplayVMOutputToStderr", &tail)) {
+ } else if (match_option(option, "-XX:+DisplayVMOutputToStderr")) {
FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false);
FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true);
- } else if (match_option(option, "-XX:+DisplayVMOutputToStdout", &tail)) {
+ } else if (match_option(option, "-XX:+DisplayVMOutputToStdout")) {
FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false);
FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true);
- } else if (match_option(option, "-XX:+ExtendedDTraceProbes", &tail)) {
+ } else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
#if defined(DTRACE_ENABLED)
FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true);
FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true);
@@ -3311,7 +3286,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
return JNI_EINVAL;
#endif // defined(DTRACE_ENABLED)
#ifdef ASSERT
- } else if (match_option(option, "-XX:+FullGCALot", &tail)) {
+ } else if (match_option(option, "-XX:+FullGCALot")) {
FLAG_SET_CMDLINE(bool, FullGCALot, true);
// disable scavenge before parallel mark-compact
FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false);
@@ -3397,7 +3372,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
}
FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
#if !INCLUDE_MANAGEMENT
- } else if (match_option(option, "-XX:+ManagementServer", &tail)) {
+ } else if (match_option(option, "-XX:+ManagementServer")) {
jio_fprintf(defaultStream::error_stream(),
"ManagementServer is not supported in this VM.\n");
return JNI_ERR;
@@ -3481,11 +3456,89 @@ void Arguments::fix_appclasspath() {
}
}
-jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) {
- // This must be done after all -D arguments have been processed.
- scp_p->expand_endorsed();
+static bool has_jar_files(const char* directory) {
+ DIR* dir = os::opendir(directory);
+ if (dir == NULL) return false;
- if (scp_assembly_required || scp_p->get_endorsed() != NULL) {
+ struct dirent *entry;
+ char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal);
+ bool hasJarFile = false;
+ while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
+ const char* name = entry->d_name;
+ const char* ext = name + strlen(name) - 4;
+ hasJarFile = ext > name && (os::file_name_strcmp(ext, ".jar") == 0);
+ }
+ FREE_C_HEAP_ARRAY(char, dbuf);
+ os::closedir(dir);
+ return hasJarFile ;
+}
+
+static int check_non_empty_dirs(const char* path) {
+ const char separator = *os::path_separator();
+ const char* const end = path + strlen(path);
+ int nonEmptyDirs = 0;
+ while (path < end) {
+ const char* tmp_end = strchr(path, separator);
+ if (tmp_end == NULL) {
+ if (has_jar_files(path)) {
+ nonEmptyDirs++;
+ jio_fprintf(defaultStream::output_stream(),
+ "Non-empty directory: %s\n", path);
+ }
+ path = end;
+ } else {
+ char* dirpath = NEW_C_HEAP_ARRAY(char, tmp_end - path + 1, mtInternal);
+ memcpy(dirpath, path, tmp_end - path);
+ dirpath[tmp_end - path] = '\0';
+ if (has_jar_files(dirpath)) {
+ nonEmptyDirs++;
+ jio_fprintf(defaultStream::output_stream(),
+ "Non-empty directory: %s\n", dirpath);
+ }
+ FREE_C_HEAP_ARRAY(char, dirpath);
+ path = tmp_end + 1;
+ }
+ }
+ return nonEmptyDirs;
+}
+
+jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) {
+ // check if the default lib/endorsed directory exists; if so, error
+ char path[JVM_MAXPATHLEN];
+ const char* fileSep = os::file_separator();
+ sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
+
+ if (CheckEndorsedAndExtDirs) {
+ int nonEmptyDirs = 0;
+ // check endorsed directory
+ nonEmptyDirs += check_non_empty_dirs(path);
+ // check the extension directories
+ nonEmptyDirs += check_non_empty_dirs(Arguments::get_ext_dirs());
+ if (nonEmptyDirs > 0) {
+ return JNI_ERR;
+ }
+ }
+
+ DIR* dir = os::opendir(path);
+ if (dir != NULL) {
+ jio_fprintf(defaultStream::output_stream(),
+ "/lib/endorsed is not supported. Endorsed standards and standalone APIs\n"
+ "in modular form will be supported via the concept of upgradeable modules.\n");
+ os::closedir(dir);
+ return JNI_ERR;
+ }
+
+ sprintf(path, "%s%slib%sext", Arguments::get_java_home(), fileSep, fileSep);
+ dir = os::opendir(path);
+ if (dir != NULL) {
+ jio_fprintf(defaultStream::output_stream(),
+ "/lib/ext exists, extensions mechanism no longer supported; "
+ "Use -classpath instead.\n.");
+ os::closedir(dir);
+ return JNI_ERR;
+ }
+
+ if (scp_assembly_required) {
// Assemble the bootclasspath elements into the final path.
Arguments::set_sysclasspath(scp_p->combined_path());
}
@@ -3754,23 +3807,23 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
settings_file_specified = true;
continue;
}
- if (match_option(option, "-XX:+PrintVMOptions", &tail)) {
+ if (match_option(option, "-XX:+PrintVMOptions")) {
PrintVMOptions = true;
continue;
}
- if (match_option(option, "-XX:-PrintVMOptions", &tail)) {
+ if (match_option(option, "-XX:-PrintVMOptions")) {
PrintVMOptions = false;
continue;
}
- if (match_option(option, "-XX:+IgnoreUnrecognizedVMOptions", &tail)) {
+ if (match_option(option, "-XX:+IgnoreUnrecognizedVMOptions")) {
IgnoreUnrecognizedVMOptions = true;
continue;
}
- if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) {
+ if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions")) {
IgnoreUnrecognizedVMOptions = false;
continue;
}
- if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
+ if (match_option(option, "-XX:+PrintFlagsInitial")) {
CommandLineFlags::printFlags(tty, false);
vm_exit(0);
}
@@ -3796,7 +3849,7 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
#ifndef PRODUCT
- if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) {
+ if (match_option(option, "-XX:+PrintFlagsWithComments")) {
CommandLineFlags::printFlags(tty, true);
vm_exit(0);
}
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
index b6709530d00..9601aba690b 100644
--- a/hotspot/src/share/vm/runtime/arguments.hpp
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
@@ -254,8 +254,6 @@ class Arguments : AllStatic {
static SystemProperty* _system_properties;
// Quick accessor to System properties in the list:
- static SystemProperty *_java_ext_dirs;
- static SystemProperty *_java_endorsed_dirs;
static SystemProperty *_sun_boot_library_path;
static SystemProperty *_java_library_path;
static SystemProperty *_java_home;
@@ -266,6 +264,10 @@ class Arguments : AllStatic {
static char* _meta_index_path;
static char* _meta_index_dir;
+ // temporary: to emit warning if the default ext dirs are not empty.
+ // remove this variable when the warning is no longer needed.
+ static char* _ext_dirs;
+
// java.vendor.url.bug, bug reporting URL for fatal errors.
static const char* _java_vendor_url_bug;
@@ -585,8 +587,7 @@ class Arguments : AllStatic {
static void set_dll_dir(char *value) { _sun_boot_library_path->set_value(value); }
static void set_java_home(char *value) { _java_home->set_value(value); }
static void set_library_path(char *value) { _java_library_path->set_value(value); }
- static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); }
- static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); }
+ static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); }
static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
@@ -596,14 +597,14 @@ class Arguments : AllStatic {
static char* get_java_home() { return _java_home->value(); }
static char* get_dll_dir() { return _sun_boot_library_path->value(); }
- static char* get_endorsed_dir() { return _java_endorsed_dirs->value(); }
static char* get_sysclasspath() { return _sun_boot_class_path->value(); }
static char* get_meta_index_path() { return _meta_index_path; }
static char* get_meta_index_dir() { return _meta_index_dir; }
- static char* get_ext_dirs() { return _java_ext_dirs->value(); }
+ static char* get_ext_dirs() { return _ext_dirs; }
static char* get_appclasspath() { return _java_class_path->value(); }
static void fix_appclasspath();
+
// Operation modi
static Mode mode() { return _mode; }
static bool is_interpreter_only() { return mode() == _int; }
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index eac57f0271d..25bd4c7a215 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -1230,6 +1230,9 @@ class CommandLineFlags {
product(bool, CheckJNICalls, false, \
"Verify all arguments to JNI calls") \
\
+ product(bool, CheckEndorsedAndExtDirs, false, \
+ "Verify the endorsed and extension directories are not used") \
+ \
product(bool, UseFastJNIAccessors, true, \
"Use optimized versions of GetField") \
\
diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp
index ed43b3fb2b6..b97651a2949 100644
--- a/hotspot/src/share/vm/runtime/os.cpp
+++ b/hotspot/src/share/vm/runtime/os.cpp
@@ -1230,11 +1230,21 @@ bool os::set_boot_path(char fileSep, char pathSep) {
Arguments::set_meta_index_path(meta_index, meta_index_dir);
char* sysclasspath = NULL;
+ struct stat st;
+
+ // modular image if bootmodules.jimage exists
+ char* jimage = format_boot_path("%/lib/modules/bootmodules.jimage", home, home_len, fileSep, pathSep);
+ if (jimage == NULL) return false;
+ bool has_jimage = (os::stat(jimage, &st) == 0);
+ if (has_jimage) {
+ Arguments::set_sysclasspath(jimage);
+ return true;
+ }
+ FREE_C_HEAP_ARRAY(char, jimage);
// images build if rt.jar exists
char* rt_jar = format_boot_path("%/lib/rt.jar", home, home_len, fileSep, pathSep);
if (rt_jar == NULL) return false;
- struct stat st;
bool has_rt_jar = (os::stat(rt_jar, &st) == 0);
FREE_C_HEAP_ARRAY(char, rt_jar);
diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp
index 8d657afc640..d3650d5431d 100644
--- a/hotspot/src/share/vm/runtime/os.hpp
+++ b/hotspot/src/share/vm/runtime/os.hpp
@@ -500,6 +500,7 @@ class os: AllStatic {
//File i/o operations
static size_t read(int fd, void *buf, unsigned int nBytes);
+ static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
static size_t write(int fd, const void *buf, unsigned int nBytes);
diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp
index 55fda6fb3f9..1e91e8fdecf 100644
--- a/hotspot/src/share/vm/runtime/statSampler.cpp
+++ b/hotspot/src/share/vm/runtime/statSampler.cpp
@@ -225,8 +225,6 @@ static const char* property_counters_ss[] = {
"java.vm.info",
"java.library.path",
"java.class.path",
- "java.endorsed.dirs",
- "java.ext.dirs",
"java.version",
"java.home",
NULL
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index 4df238925dd..327e0f0009c 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -556,9 +556,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
\
nonstatic_field(TenuredGeneration, _min_heap_delta_bytes, size_t) \
nonstatic_field(TenuredGeneration, _the_space, ContiguousSpace*) \
- nonstatic_field(TenuredGeneration, _last_gc, WaterMark) \
- \
- \
\
nonstatic_field(Space, _bottom, HeapWord*) \
nonstatic_field(Space, _end, HeapWord*) \
diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml
index 120d27f4d4d..fc7acd38e95 100644
--- a/hotspot/src/share/vm/trace/trace.xml
+++ b/hotspot/src/share/vm/trace/trace.xml
@@ -314,6 +314,28 @@ Declares a structure type that can be used in other events.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile
index e0526fcf35c..657501a7622 100644
--- a/hotspot/test/Makefile
+++ b/hotspot/test/Makefile
@@ -275,6 +275,9 @@ JTREG_BASIC_OPTIONS += -retain:fail,error
# Ignore tests are not run and completely silent about it
JTREG_IGNORE_OPTION = -ignore:quiet
JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
+# Multiply by 4 the timeout factor
+JTREG_TIMEOUT_OPTION = -timeoutFactor:4
+JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
# Add any extra options
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
# Set other vm and test options
diff --git a/hotspot/test/gc/TestCardTablePageCommits.java b/hotspot/test/gc/TestCardTablePageCommits.java
new file mode 100644
index 00000000000..0dec3d83b93
--- /dev/null
+++ b/hotspot/test/gc/TestCardTablePageCommits.java
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2014, 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
+* under the terms of the GNU General Public License version 2 only, as
+* published by the Free Software Foundation.
+*
+* This code is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+* version 2 for more details (a copy is included in the LICENSE file that
+* accompanied this code).
+*
+* You should have received a copy of the GNU General Public License version
+* 2 along with this work; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+* or visit www.oracle.com if you need additional information or have any
+* questions.
+*/
+
+import com.oracle.java.testlibrary.JDKToolFinder;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+import com.oracle.java.testlibrary.Platform;
+
+/*
+ * @test TestCardTablePageCommits
+ * @key gc
+ * @bug 8059066
+ * @summary Tests that the card table does not commit the same page twice
+ * @library /testlibrary
+ * @run driver TestCardTablePageCommits
+ */
+public class TestCardTablePageCommits {
+ public static void main(String args[]) throws Exception {
+ // The test is run with a small heap to make sure all pages in the card
+ // table gets committed. Need 8 MB heap to trigger the bug on SPARC
+ // because of 8kB pages, assume 4 KB pages for all other CPUs.
+ String Xmx = Platform.isSparc() ? "-Xmx8m" : "-Xmx4m";
+
+ String[] opts = {Xmx, "-XX:NativeMemoryTracking=detail", "-XX:+UseParallelGC", "-version"};
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(opts);
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ output.shouldHaveExitValue(0);
+ }
+}
diff --git a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
index b2505be0d7d..f38b85ad9af 100644
--- a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
+++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
@@ -30,40 +30,96 @@
import com.oracle.java.testlibrary.*;
public class LimitSharedSizes {
+ static enum Region {
+ RO, RW, MD, MC
+ }
+
private static class SharedSizeTestData {
public String optionName;
public String optionValue;
public String expectedErrorMsg;
- public SharedSizeTestData(String name, String value, String msg) {
- optionName = name;
+ public SharedSizeTestData(Region region, String value, String msg) {
+ optionName = getName(region);
optionValue = value;
expectedErrorMsg = msg;
}
+
+ public SharedSizeTestData(Region region, String msg) {
+ optionName = getName(region);
+ optionValue = getValue(region);
+ expectedErrorMsg = msg;
+ }
+
+ private String getName(Region region) {
+ String name;
+ switch (region) {
+ case RO:
+ name = "-XX:SharedReadOnlySize";
+ break;
+ case RW:
+ name = "-XX:SharedReadWriteSize";
+ break;
+ case MD:
+ name = "-XX:SharedMiscDataSize";
+ break;
+ case MC:
+ name = "-XX:SharedMiscCodeSize";
+ break;
+ default:
+ name = "Unknown";
+ break;
+ }
+ return name;
+ }
+
+ private String getValue(Region region) {
+ String value;
+ switch (region) {
+ case RO:
+ value = Platform.is64bit() ? "9M" : "8M";
+ break;
+ case RW:
+ value = Platform.is64bit() ? "12M" : "7M";
+ break;
+ case MD:
+ value = Platform.is64bit() ? "4M" : "2M";
+ break;
+ case MC:
+ value = "120k";
+ break;
+ default:
+ value = "0M";
+ break;
+ }
+ return value;
+ }
}
private static final SharedSizeTestData[] testTable = {
- // values in this part of the test table should cause failure
- // (shared space sizes are deliberately too small)
- new SharedSizeTestData("-XX:SharedReadOnlySize", "4M", "read only"),
- new SharedSizeTestData("-XX:SharedReadWriteSize","4M", "read write"),
-
- // Known issue, JDK-8038422 (assert() on Windows)
- // new SharedSizeTestData("-XX:SharedMiscDataSize", "500k", "miscellaneous data"),
-
- // Too small of a misc code size should not cause a vm crash.
- // It should result in the following error message:
+ // Too small of a region size should not cause a vm crash.
+ // It should result in an error message like the following:
// The shared miscellaneous code space is not large enough
// to preload requested classes. Use -XX:SharedMiscCodeSize=
// to increase the initial size of shared miscellaneous code space.
- new SharedSizeTestData("-XX:SharedMiscCodeSize", "20k", "miscellaneous code"),
+ new SharedSizeTestData(Region.RO, "4M", "read only"),
+ new SharedSizeTestData(Region.RW, "4M", "read write"),
+ new SharedSizeTestData(Region.MD, "50k", "miscellaneous data"),
+ new SharedSizeTestData(Region.MC, "20k", "miscellaneous code"),
// these values are larger than default ones, but should
// be acceptable and not cause failure
- new SharedSizeTestData("-XX:SharedReadOnlySize", "20M", null),
- new SharedSizeTestData("-XX:SharedReadWriteSize", "20M", null),
- new SharedSizeTestData("-XX:SharedMiscDataSize", "20M", null),
- new SharedSizeTestData("-XX:SharedMiscCodeSize", "20M", null)
+ new SharedSizeTestData(Region.RO, "20M", null),
+ new SharedSizeTestData(Region.RW, "20M", null),
+ new SharedSizeTestData(Region.MD, "20M", null),
+ new SharedSizeTestData(Region.MC, "20M", null),
+
+ // test with sizes which just meet the minimum required sizes
+ // the following tests also attempt to use the shared archive
+ new SharedSizeTestData(Region.RO, "UseArchive"),
+ new SharedSizeTestData(Region.RW, "UseArchive"),
+ new SharedSizeTestData(Region.MD, "UseArchive"),
+ new SharedSizeTestData(Region.MC, "UseArchive")
};
public static void main(String[] args) throws Exception {
@@ -82,10 +138,39 @@ public class LimitSharedSizes {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
if (td.expectedErrorMsg != null) {
- output.shouldContain("The shared " + td.expectedErrorMsg
- + " space is not large enough");
+ if (!td.expectedErrorMsg.equals("UseArchive")) {
+ output.shouldContain("The shared " + td.expectedErrorMsg
+ + " space is not large enough");
- output.shouldHaveExitValue(2);
+ output.shouldHaveExitValue(2);
+ } else {
+ output.shouldNotContain("space is not large enough");
+ output.shouldHaveExitValue(0);
+
+ // try to use the archive
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+UnlockDiagnosticVMOptions",
+ "-XX:SharedArchiveFile=./" + fileName,
+ "-XX:+PrintSharedArchiveAndExit",
+ "-version");
+
+ try {
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("archive is valid");
+ } catch (RuntimeException e) {
+ // if sharing failed due to ASLR or similar reasons,
+ // check whether sharing was attempted at all (UseSharedSpaces)
+ if ((output.getOutput().contains("Unable to use shared archive") ||
+ output.getOutput().contains("Unable to map ReadOnly shared space at required address.") ||
+ output.getOutput().contains("Unable to map ReadWrite shared space at required address.") ||
+ output.getOutput().contains("Unable to reserve shared space at required address")) &&
+ output.getExitValue() == 1) {
+ System.out.println("Unable to use shared archive: test not executed; assumed passed");
+ return;
+ }
+ }
+ output.shouldHaveExitValue(0);
+ }
} else {
output.shouldNotContain("space is not large enough");
output.shouldHaveExitValue(0);
diff --git a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java
new file mode 100644
index 00000000000..e3e81ca9d43
--- /dev/null
+++ b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8066670
+ * @summary Testing -XX:+PrintSharedArchiveAndExit option
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class PrintSharedArchiveAndExit {
+ public static void main(String[] args) throws Exception {
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ try {
+ output.shouldContain("Loading classes to share");
+ output.shouldHaveExitValue(0);
+
+ // (1) With a valid archive
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa",
+ "-XX:+PrintSharedArchiveAndExit", "-version");
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("archive is valid");
+ output.shouldNotContain("java version"); // Should not print JVM version
+ output.shouldHaveExitValue(0); // Should report success in error code.
+
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa",
+ "-XX:+PrintSharedArchiveAndExit");
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("archive is valid");
+ output.shouldNotContain("Usage:"); // Should not print JVM help message
+ output.shouldHaveExitValue(0); // Should report success in error code.
+
+ // (2) With an invalid archive (boot class path has been prepended)
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-Xbootclasspath/p:foo.jar",
+ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa",
+ "-XX:+PrintSharedArchiveAndExit", "-version");
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("archive is invalid");
+ output.shouldNotContain("java version"); // Should not print JVM version
+ output.shouldHaveExitValue(1); // Should report failure in error code.
+
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-Xbootclasspath/p:foo.jar",
+ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa",
+ "-XX:+PrintSharedArchiveAndExit");
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("archive is invalid");
+ output.shouldNotContain("Usage:"); // Should not print JVM help message
+ output.shouldHaveExitValue(1); // Should report failure in error code.
+ } catch (RuntimeException e) {
+ e.printStackTrace();
+ output.shouldContain("Unable to use shared archive");
+ output.shouldHaveExitValue(1);
+ }
+ }
+}
diff --git a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
index 10877ba86d9..169c0432999 100644
--- a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
+++ b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
@@ -41,12 +41,12 @@ import java.io.File;
public class Test8028623 {
- public static int à = 1;
+ public static int \u00CB = 1;
public static String dumpFile = "heap.out";
public static void main (String[] args) {
- System.out.println(Ã);
+ System.out.println(\u00CB);
try {
if (!Platform.shouldSAAttach()) {
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 6ec4929ca1b..87019760616 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -282,3 +282,6 @@ b9370464572fc663a38956047aa612d6e7854c3d jdk9-b35
48e4ec70cc1c8651e4a0324d91f193c4edd83af9 jdk9-b37
6c6b34477e93e6fb350035f73ed7c02266b78380 jdk9-b38
a12d347f84176200593999f4da91ae2bb86865b2 jdk9-b39
+3f46e2196498de33e7c65efa7b372e46f1faba01 jdk9-b40
+71dd8f7649428efd3a56ca5fefc80e59d37b8434 jdk9-b41
+47b0d3fa4118b9d56870cf4004987438c501f5c0 jdk9-b42
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ClassPath.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ClassPath.java
index ac4745ea97f..1c89a1049c9 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ClassPath.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ClassPath.java
@@ -151,18 +151,17 @@ public class ClassPath implements Serializable {
}
/** Checks for class path components in the following properties:
- * "java.class.path", "sun.boot.class.path", "java.ext.dirs"
+ * "java.class.path", "sun.boot.class.path"
*
* @return class path as used by default by BCEL
*/
public static final String getClassPath() {
- String class_path, boot_path, ext_path;
+ String class_path, boot_path;
try {
class_path = SecuritySupport.getSystemProperty("java.class.path");
boot_path = SecuritySupport.getSystemProperty("sun.boot.class.path");
- ext_path = SecuritySupport.getSystemProperty("java.ext.dirs");
}
catch (SecurityException e) {
return "";
@@ -173,23 +172,6 @@ public class ClassPath implements Serializable {
getPathComponents(class_path, list);
getPathComponents(boot_path, list);
- ArrayList dirs = new ArrayList();
- getPathComponents(ext_path, dirs);
-
- for(Iterator e = dirs.iterator(); e.hasNext(); ) {
- File ext_dir = new File((String)e.next());
- String[] extensions = SecuritySupport.getFileList(ext_dir, new FilenameFilter() {
- public boolean accept(File dir, String name) {
- name = name.toLowerCase();
- return name.endsWith(".zip") || name.endsWith(".jar");
- }
- });
-
- if(extensions != null)
- for(int i=0; i < extensions.length; i++)
- list.add(ext_path + File.separatorChar + extensions[i]);
- }
-
StringBuffer buf = new StringBuffer();
for(Iterator e = list.iterator(); e.hasNext(); ) {
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java
index e581f9a5b40..71570d68d08 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java
@@ -243,6 +243,9 @@ public final class SecuritySupport {
if (protocol.equalsIgnoreCase("jar")) {
String path = url.getPath();
protocol = path.substring(0, path.indexOf(":"));
+ } else if (protocol.equalsIgnoreCase("jrt")) {
+ // if the systemId is "jrt" then allow access if "file" allowed
+ protocol = "file";
}
}
@@ -278,7 +281,7 @@ public final class SecuritySupport {
/**
* Read JAXP system property in this order: system property,
- * $java.home/lib/jaxp.properties if the system property is not specified
+ * $java.home/conf/jaxp.properties if the system property is not specified
*
* @param propertyId the Id of the property
* @return the value of the property
@@ -292,7 +295,7 @@ public final class SecuritySupport {
}
/**
- * Read from $java.home/lib/jaxp.properties for the specified property
+ * Read from $java.home/conf/jaxp.properties for the specified property
* The program
*
* @param propertyId the Id of the property
@@ -306,7 +309,7 @@ public final class SecuritySupport {
synchronized (cacheProps) {
if (firstTime) {
String configFile = getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
File f = new File(configFile);
if (getFileExists(f)) {
is = getFileInputStream(f);
@@ -332,12 +335,12 @@ public final class SecuritySupport {
}
/**
- * Cache for properties in java.home/lib/jaxp.properties
+ * Cache for properties in java.home/conf/jaxp.properties
*/
static final Properties cacheProps = new Properties();
/**
- * Flag indicating if the program has tried reading java.home/lib/jaxp.properties
+ * Flag indicating if the program has tried reading java.home/conf/jaxp.properties
*/
static volatile boolean firstTime = true;
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
index a6b99891be4..6696d64447c 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
@@ -558,9 +558,6 @@ public class EnvironmentCheck
* Logs java.class.path and other likely paths; then attempts
* to search those paths for .jar files with Xalan-related classes.
*
- * //@todo NOTE: We don't actually search java.ext.dirs for
- * // *.jar files therein! This should be updated
- *
* @param h Hashtable to put information in
* @see #jarNames
* @see #checkPathForJars(String, String[])
@@ -615,20 +612,6 @@ public class EnvironmentCheck
h.put(FOUNDCLASSES + "sun.boot.class.path", classpathJars);
}
- //@todo NOTE: We don't actually search java.ext.dirs for
- // *.jar files therein! This should be updated
- othercp = SecuritySupport.getSystemProperty("java.ext.dirs");
-
- if (null != othercp)
- {
- h.put("java.ext.dirs", othercp);
-
- classpathJars = checkPathForJars(othercp, jarNames);
-
- if (null != classpathJars)
- h.put(FOUNDCLASSES + "java.ext.dirs", classpathJars);
- }
-
//@todo also check other System properties' paths?
// v2 = checkPathForJars(System.getProperty("sun.boot.library.path"), jarNames); // ?? may not be needed
// v3 = checkPathForJars(System.getProperty("java.library.path"), jarNames); // ?? may not be needed
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
index aa993a299c5..a9baeac29ef 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
@@ -41,7 +41,7 @@ import javax.xml.datatype.XMLGregorianCalendar;
* Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
*
*
- * If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a {@link java.util.Properties} Object.
+ * If the file ${JAVA_HOME}/conf/jaxp.properties exists, it is loaded in a {@link java.util.Properties} Object.
* The PropertiesObject is then queried for the property as documented in the prior step
* and processed as documented in the prior step.
*
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java
index 613d651594f..c25e552c4ff 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java
@@ -237,6 +237,9 @@ public final class SecuritySupport {
if (protocol.equalsIgnoreCase("jar")) {
String path = url.getPath();
protocol = path.substring(0, path.indexOf(":"));
+ } else if (protocol.equalsIgnoreCase("jrt")) {
+ // if the systemId is "jrt" then allow access if "file" allowed
+ protocol = "file";
}
}
@@ -272,7 +275,7 @@ public final class SecuritySupport {
/**
* Read JAXP system property in this order: system property,
- * $java.home/lib/jaxp.properties if the system property is not specified
+ * $java.home/conf/jaxp.properties if the system property is not specified
*
* @param propertyId the Id of the property
* @return the value of the property
@@ -286,7 +289,7 @@ public final class SecuritySupport {
}
/**
- * Read from $java.home/lib/jaxp.properties for the specified property
+ * Read from $java.home/conf/jaxp.properties for the specified property
* The program
*
* @param propertyId the Id of the property
@@ -300,7 +303,7 @@ public final class SecuritySupport {
synchronized (cacheProps) {
if (firstTime) {
String configFile = getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
File f = new File(configFile);
if (getFileExists(f)) {
is = getFileInputStream(f);
@@ -326,12 +329,12 @@ public final class SecuritySupport {
}
/**
- * Cache for properties in java.home/lib/jaxp.properties
+ * Cache for properties in java.home/conf/jaxp.properties
*/
static final Properties cacheProps = new Properties();
/**
- * Flag indicating if the program has tried reading java.home/lib/jaxp.properties
+ * Flag indicating if the program has tried reading java.home/conf/jaxp.properties
*/
static volatile boolean firstTime = true;
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java b/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java
index 70b8bdfa812..4cb5800200d 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/XMLConstants.java
@@ -247,7 +247,7 @@ public final class XMLConstants {
*
*
*
- * ${JAVA_HOME}/lib/jaxp.properties: This configuration file is in standard
+ * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard
* {@link java.util.Properties} format. If the file exists and the system property is specified,
* its value will be used to override the default of the property.
*
@@ -314,7 +314,7 @@ public final class XMLConstants {
*
*
*
- * ${JAVA_HOME}/lib/jaxp.properties: This configuration file is in standard
+ * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard
* java.util.Properties format. If the file exists and the system property is specified,
* its value will be used to override the default of the property.
*
@@ -380,7 +380,7 @@ public final class XMLConstants {
*
*
*
- * ${JAVA_HOME}/lib/jaxp.properties: This configuration file is in standard
+ * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard
* java.util.Properties format. If the file exists and the system property is specified,
* its value will be used to override the default of the property.
*
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java
index 0a96c5760ef..de6050ac4e8 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java
@@ -43,7 +43,7 @@ import java.util.regex.Pattern;
* Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
*
*
- * If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a {@link java.util.Properties} Object.
+ * If the file ${JAVA_HOME}/conf/jaxp.properties exists, it is loaded in a {@link java.util.Properties} Object.
* The PropertiesObject is then queried for the property as documented in the prior step
* and processed as documented in the prior step.
*
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java
index ce982157240..72ee2e55c77 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/FactoryFinder.java
@@ -50,12 +50,12 @@ class FactoryFinder {
private static boolean debug = false;
/**
- * Cache for properties in java.home/lib/jaxp.properties
+ * Cache for properties in java.home/conf/jaxp.properties
*/
private final static Properties cacheProps = new Properties();
/**
- * Flag indicating if properties from java.home/lib/jaxp.properties
+ * Flag indicating if properties from java.home/conf/jaxp.properties
* have been cached.
*/
private static volatile boolean firstTime = true;
@@ -237,13 +237,13 @@ class FactoryFinder {
if (debug) se.printStackTrace();
}
- // try to read from $java.home/lib/jaxp.properties
+ // try to read from $java.home/conf/jaxp.properties
try {
if (firstTime) {
synchronized (cacheProps) {
if (firstTime) {
String configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
File f = new File(configFile);
firstTime = false;
if (ss.doesFileExist(f)) {
@@ -256,7 +256,7 @@ class FactoryFinder {
final String factoryClassName = cacheProps.getProperty(factoryId);
if (factoryClassName != null) {
- dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
+ dPrint("found in ${java.home}/conf/jaxp.properties, value=" + factoryClassName);
return newInstance(type, factoryClassName, null, true);
}
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
index 0625b850986..62bd3bd27c0 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
@@ -66,7 +66,7 @@ public abstract class DocumentBuilderFactory {
* property.
*
*
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
+ * Use the properties file "conf/jaxp.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties
* format and contains the fully qualified name of the
* implementation class with the key being the system property defined
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java
index 9e186f512ef..e17b4dd147c 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/FactoryFinder.java
@@ -50,12 +50,12 @@ class FactoryFinder {
private static boolean debug = false;
/**
- * Cache for properties in java.home/lib/jaxp.properties
+ * Cache for properties in java.home/conf/jaxp.properties
*/
private static final Properties cacheProps = new Properties();
/**
- * Flag indicating if properties from java.home/lib/jaxp.properties
+ * Flag indicating if properties from java.home/conf/jaxp.properties
* have been cached.
*/
static volatile boolean firstTime = true;
@@ -236,13 +236,13 @@ class FactoryFinder {
if (debug) se.printStackTrace();
}
- // try to read from $java.home/lib/jaxp.properties
+ // try to read from $java.home/conf/jaxp.properties
try {
if (firstTime) {
synchronized (cacheProps) {
if (firstTime) {
String configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
File f = new File(configFile);
firstTime = false;
if (ss.doesFileExist(f)) {
@@ -255,7 +255,7 @@ class FactoryFinder {
final String factoryClassName = cacheProps.getProperty(factoryId);
if (factoryClassName != null) {
- dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
+ dPrint("found in ${java.home}/conf/jaxp.properties, value=" + factoryClassName);
return newInstance(type, factoryClassName, null, true);
}
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java
index 7de367e702e..f2e9120a02f 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java
@@ -70,7 +70,7 @@ public abstract class SAXParserFactory {
* property.
*
*
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
+ * Use the properties file "conf/jaxp.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties
* format and contains the fully qualified name of the
* implementation class with the key being the system property defined
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java
index f34d0f8bda1..c9c4a08dc43 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/FactoryFinder.java
@@ -51,12 +51,12 @@ class FactoryFinder {
private static boolean debug = false;
/**
- * Cache for properties in java.home/lib/jaxp.properties
+ * Cache for properties in java.home/conf/jaxp.properties
*/
final private static Properties cacheProps = new Properties();
/**
- * Flag indicating if properties from java.home/lib/jaxp.properties
+ * Flag indicating if properties from java.home/conf/jaxp.properties
* have been cached.
*/
private static volatile boolean firstTime = true;
@@ -271,7 +271,7 @@ class FactoryFinder {
}
// Try read $java.home/lib/stax.properties followed by
- // $java.home/lib/jaxp.properties if former not present
+ // $java.home/conf/jaxp.properties if former not present
String configFile = null;
try {
if (firstTime) {
@@ -287,7 +287,7 @@ class FactoryFinder {
}
else {
configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
f = new File(configFile);
if (ss.doesFileExist(f)) {
dPrint("Read properties file "+f);
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java
index 4ae6568aa57..25772307027 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java
@@ -53,12 +53,12 @@ class FactoryFinder {
private static boolean debug = false;
/**
- * Cache for properties in java.home/lib/jaxp.properties
+ * Cache for properties in java.home/conf/jaxp.properties
*/
private final static Properties cacheProps = new Properties();
/**
- * Flag indicating if properties from java.home/lib/jaxp.properties
+ * Flag indicating if properties from java.home/conf/jaxp.properties
* have been cached.
*/
static volatile boolean firstTime = true;
@@ -268,13 +268,13 @@ class FactoryFinder {
if (debug) se.printStackTrace();
}
- // try to read from $java.home/lib/jaxp.properties
+ // try to read from $java.home/conf/jaxp.properties
try {
if (firstTime) {
synchronized (cacheProps) {
if (firstTime) {
String configFile = ss.getSystemProperty("java.home") + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
File f = new File(configFile);
firstTime = false;
if (ss.doesFileExist(f)) {
@@ -287,7 +287,7 @@ class FactoryFinder {
final String factoryClassName = cacheProps.getProperty(factoryId);
if (factoryClassName != null) {
- dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
+ dPrint("found in ${java.home}/conf/jaxp.properties, value=" + factoryClassName);
return newInstance(type, factoryClassName, null, true, true);
}
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java
index cde66def0ea..846cda11048 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/TransformerFactory.java
@@ -62,7 +62,7 @@ public abstract class TransformerFactory {
* property.
*
*
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
+ * Use the properties file "conf/jaxp.properties" in the JRE directory.
* This configuration file is in standard java.util.Properties
* format and contains the fully qualified name of the
* implementation class with the key being the system property defined
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java
index 2701b1908f4..527c6c73a02 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactory.java
@@ -141,7 +141,7 @@ public abstract class SchemaFactory {
* and returns it if it is successfully created.
*
*
- * $java.home/lib/jaxp.properties is read and
+ * $java.home/conf/jaxp.properties is read and
* the value associated with the key being the system property above
* is looked for. If present, the value is processed just like above.
*
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java
index 16b84f636bd..91737274f18 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java
@@ -181,10 +181,10 @@ class SchemaFactoryFinder {
String javah = ss.getSystemProperty( "java.home" );
String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
- // try to read from $java.home/lib/jaxp.properties
+ // try to read from $java.home/conf/jaxp.properties
try {
if(firstTime){
synchronized(cacheProps){
@@ -199,7 +199,7 @@ class SchemaFactoryFinder {
}
}
final String factoryClassName = cacheProps.getProperty(propertyName);
- debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
+ debugPrintln("found " + factoryClassName + " in $java.home/conf/jaxp.properties");
if (factoryClassName != null) {
sf = createInstance(factoryClassName, true);
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java
index ea7370e06e7..ce2074b19a3 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java
@@ -117,7 +117,7 @@ public abstract class XPathFactory {
* and returns it if it is successfully created.
*
*
- * ${java.home}/lib/jaxp.properties is read and the value associated with the key being the system property above is looked for.
+ * ${java.home}/conf/jaxp.properties is read and the value associated with the key being the system property above is looked for.
* If present, the value is processed just like above.
*
*
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java
index bceeda854e8..282f0b05d61 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java
@@ -176,9 +176,9 @@ class XPathFactoryFinder {
String javah = ss.getSystemProperty( "java.home" );
String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
+ "conf" + File.separator + "jaxp.properties";
- // try to read from $java.home/lib/jaxp.properties
+ // try to read from $java.home/conf/jaxp.properties
try {
if(firstTime){
synchronized(cacheProps){
@@ -193,7 +193,7 @@ class XPathFactoryFinder {
}
}
final String factoryClassName = cacheProps.getProperty(propertyName);
- debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
+ debugPrintln("found " + factoryClassName + " in $java.home/conf/jaxp.properties");
if (factoryClassName != null) {
xpathFactory = createInstance(factoryClassName, true);
diff --git a/jaxp/test/TEST.ROOT b/jaxp/test/TEST.ROOT
index 7775538c362..cc03bd9063d 100644
--- a/jaxp/test/TEST.ROOT
+++ b/jaxp/test/TEST.ROOT
@@ -1,3 +1,6 @@
# This file identifies the root of the test-suite hierarchy.
# It also contains test-suite configuration information.
+# Tests that must run in othervm mode
+othervm.dirs=javax/xml/jaxp/unittest
+
diff --git a/jaxp/test/javax/xml/jaxp/TEST.properties b/jaxp/test/javax/xml/jaxp/TEST.properties
new file mode 100644
index 00000000000..8ba6cb12a72
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/TEST.properties
@@ -0,0 +1,3 @@
+# jaxp test uses TestNG
+TestNG.dirs = unittest
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DBFNamespaceTest.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DBFNamespaceTest.java
new file mode 100644
index 00000000000..930ef818341
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DBFNamespaceTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * This tests DocumentBuilderFactory for namespace processing and no-namespace
+ * processing.
+ */
+public class DBFNamespaceTest {
+
+ /**
+ * Provide input for the cases that supporting namespace or not.
+ */
+ @DataProvider(name = "input-provider")
+ public Object[][] getInput() {
+ DocumentBuilderFactory dbf1 = DocumentBuilderFactory.newInstance();
+ String outputfile1 = USER_DIR + FILE_SEP + "dbfnstest01.out";
+ String goldfile1 = TestUtils.GOLDEN_DIR + FILE_SEP + "dbfnstest01GF.out";
+
+ DocumentBuilderFactory dbf2 = DocumentBuilderFactory.newInstance();
+ dbf2.setNamespaceAware(true);
+ String outputfile2 = USER_DIR + FILE_SEP + "dbfnstest02.out";
+ String goldfile2 = TestUtils.GOLDEN_DIR + FILE_SEP + "dbfnstest02GF.out";
+ return new Object[][] { { dbf1, outputfile1, goldfile1 }, { dbf2, outputfile2, goldfile2 } };
+ }
+
+ /**
+ * Test to parse and transform a document without supporting namespace and
+ * with supporting namespace.
+ */
+ @Test(dataProvider = "input-provider")
+ public void testNamespaceTest(DocumentBuilderFactory dbf, String outputfile, String goldfile) {
+ try {
+ Document doc = dbf.newDocumentBuilder().parse(new File(TestUtils.XML_DIR, "namespace1.xml"));
+ dummyTransform(doc, outputfile);
+ assertTrue(compareWithGold(goldfile, outputfile));
+ } catch (SAXException | IOException | ParserConfigurationException | TransformerFactoryConfigurationError | TransformerException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * This method transforms a Node without any xsl file and uses SAXResult to
+ * invoke the callbacks through a ContentHandler. If namespace processing is
+ * not chosen, namespaceURI in callbacks should be an empty string otherwise
+ * it should be namespaceURI.
+ *
+ * @throws TransformerFactoryConfigurationError
+ * @throws TransformerException
+ * @throws IOException
+ */
+ private void dummyTransform(Document document, String fileName) throws TransformerFactoryConfigurationError, TransformerException, IOException {
+ DOMSource domSource = new DOMSource(document);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ File file = new File(fileName);
+ System.out.println("The fileName is " + file.getAbsolutePath());
+ transformer.transform(domSource, new SAXResult(MyCHandler.newInstance(file)));
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactory01.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactory01.java
new file mode 100644
index 00000000000..fddfaaa89b1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactory01.java
@@ -0,0 +1,451 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertEquals;
+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 java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * This checks the methods of DocumentBuilderFactoryImpl
+ */
+public class DocumentBuilderFactory01 {
+ /**
+ * Testcase to test the default functionality of schema support method.
+ */
+ @Test
+ public void testCheckSchemaSupport1() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ dbf.setNamespaceAware(true);
+ dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "test.xml"));
+ assertFalse(eh.errorOccured);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the default functionality of schema support method. In
+ * this case the schema source property is set.
+ */
+ @Test
+ public void testCheckSchemaSupport2() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ dbf.setNamespaceAware(true);
+ dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", new InputSource(new FileInputStream(
+ new File(TestUtils.XML_DIR, "test.xsd"))));
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "test1.xml"));
+ assertFalse(eh.errorOccured);
+ } catch (IllegalArgumentException | ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the default functionality of schema support method. In
+ * this case the schema source property is set.
+ */
+ @Test
+ public void testCheckSchemaSupport3() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ spf.setNamespaceAware(true);
+ SAXParser sp = spf.newSAXParser();
+ sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",
+ new InputSource(new FileInputStream(new File(TestUtils.XML_DIR, "test.xsd"))));
+ DefaultHandler dh = new DefaultHandler();
+ sp.parse(new File(TestUtils.XML_DIR, "test1.xml"), dh);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the default functionality of newInstance method. To test
+ * the isCoalescing method and setCoalescing This checks to see if the CDATA
+ * and text nodes got combined In that case it will print "<xml>This
+ * is not parsed</xml> yet".
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory02() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setCoalescing(true);
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new File(TestUtils.XML_DIR, "DocumentBuilderFactory01.xml"));
+ Element e = (Element) doc.getElementsByTagName("html").item(0);
+ NodeList nl = e.getChildNodes();
+ assertEquals(nl.item(0).getNodeValue().trim(), "This is not parsed yet");
+ } catch (IOException | SAXException | ParserConfigurationException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the isIgnoringComments. By default it is false.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory03() {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ assertFalse(dbf.isIgnoringComments());
+ }
+
+ /**
+ * Testcase to test the isValidating. By default it is false, set it to true
+ * and then use a document which is not valid. It should throw a warning or
+ * an error at least. The test passes in case retval 0 is set in the error
+ * method .
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory04() {
+ try {
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "DocumentBuilderFactory05.xml"));
+ assertTrue(eh.errorOccured);
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the setValidating. By default it is false, use a
+ * document which is not valid. It should not throw a warning or an error.
+ * The test passes in case the retval equals 1 .
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory16() {
+ try {
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "DocumentBuilderFactory05.xml"));
+ assertFalse(eh.errorOccured);
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the setValidating. By default it is false, use a
+ * document which is valid. It should not throw a warning or an error. The
+ * test passes in case the retval equals 1.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory17() {
+ try {
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "DocumentBuilderFactory04.xml"));
+ assertFalse(eh.errorOccured);
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * To test the isExpandEntityReferences. By default it is true.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory05() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderFactory02.xml")));
+ Element e = (Element) doc.getElementsByTagName("title").item(0);
+ NodeList nl = e.getChildNodes();
+ assertTrue(dbf.isExpandEntityReferences());
+ assertEquals(nl.item(0).getNodeValue().trim().charAt(0), 'W');
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the default functionality of setValidating method. The
+ * xml file has a DTD which has namespaces defined. The parser takes care to
+ * check if the namespaces using elements and defined attributes are there
+ * or not.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory06() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "DocumentBuilderFactory04.xml"));
+ assertTrue(doc instanceof Document);
+ assertFalse(eh.errorOccured);
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the setExpandEntityReferences.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory07() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setExpandEntityReferences(true);
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderFactory02.xml")));
+ Element e = (Element) doc.getElementsByTagName("title").item(0);
+ NodeList nl = e.getChildNodes();
+ assertTrue(dbf.isExpandEntityReferences());
+ assertEquals(nl.item(0).getNodeValue().trim().charAt(0), 'W');
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the setExpandEntityReferences.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory08() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setExpandEntityReferences(false);
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderFactory02.xml")));
+ Element e = (Element) doc.getElementsByTagName("title").item(0);
+ NodeList nl = e.getChildNodes();
+ assertNull(nl.item(0).getNodeValue());
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the setIgnoringComments. By default it is set to false.
+ * explicitly setting it to false, it recognizes the comment which is in
+ * Element Node Hence the Element's child node is not null.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory09() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setIgnoringComments(false);
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderFactory07.xml")));
+ Element e = (Element) doc.getElementsByTagName("body").item(0);
+ NodeList nl = e.getChildNodes();
+ assertNotNull(nl.item(0).getNodeValue());
+ } catch (ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * This tests for the parse(InputSource).
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory10() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new InputSource(new BufferedReader(new FileReader(new File(TestUtils.XML_DIR, "DocumentBuilderFactory07.xml")))));
+ assertTrue(doc instanceof Document);
+ } catch (IllegalArgumentException | ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * This tests for the parse InputStream with SystemID as a second parameter.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory11() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "dbf10import.xsl")), new File(TestUtils.XML_DIR).toURI()
+ .toASCIIString());
+ assertTrue(doc instanceof Document);
+ } catch (IllegalArgumentException | ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * This tests for the parse InputStream with empty SystemID as a second
+ * parameter.
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory12() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "dbf10import.xsl")), " ");
+ assertTrue(doc instanceof Document);
+ } catch (IllegalArgumentException | ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * This tests for the parse(uri).
+ */
+ @Test
+ public void testCheckDocumentBuilderFactory13() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new File(TestUtils.XML_DIR + FILE_SEP + "dbf10import.xsl").toURI().toASCIIString());
+ assertTrue(doc instanceof Document);
+ } catch (IllegalArgumentException | ParserConfigurationException | IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * This tests for the parse (uri) with empty string as parameter should
+ * throw Sax Exception.
+ *
+ * @throws SAXException
+ * If any parse errors occur.
+ */
+ @Test(expectedExceptions = SAXException.class)
+ public void testCheckDocumentBuilderFactory14() throws SAXException {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ docBuilder.parse("");
+ } catch (ParserConfigurationException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * This tests for the parse (uri) with null uri as parameter should throw
+ * IllegalArgumentException.
+ *
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ public void testCheckDocumentBuilderFactory15() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ String uri = null;
+ docBuilder.parse(uri);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the setIgnoringComments. By default it is set to false,
+ * setting this to true, It does not recognize the comment, Here the
+ * nodelist has a length 0 because the ignoring comments is true.
+ */
+ @Test
+ public void testCheckIgnoringComments() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setIgnoringComments(true);
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderFactory08.xml")));
+ Element e = (Element) doc.getElementsByTagName("body").item(0);
+ NodeList nl = e.getChildNodes();
+ assertEquals(nl.getLength(), 0);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the default behaviour of setIgnoringComments. By default
+ * it is set to false, this is similar to case 9 but not setIgnoringComments
+ * explicitly, it does not recognize the comment.
+ */
+ @Test
+ public void testCheckIgnoringComments1() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderFactory07.xml")));
+ Element e = (Element) doc.getElementsByTagName("body").item(0);
+ NodeList nl = e.getChildNodes();
+ assertFalse(dbf.isIgnoringComments());
+ assertNotNull(nl.item(0).getNodeValue());
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactory02.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactory02.java
new file mode 100644
index 00000000000..68722085ba2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactory02.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * This tests the setIgnoringElementWhitespace and setIgnoringComments of
+ * DocumentBuilderFactory
+ */
+public class DocumentBuilderFactory02 {
+
+ /**
+ * This testcase tests for the isIgnoringElementContentWhitespace and the
+ * setIgnoringElementContentWhitespace. The xml file has all kinds of
+ * whitespace,tab and newline characters, it uses the MyNSContentHandler
+ * which does not invoke the characters callback when this
+ * setIgnoringElementContentWhitespace is set to true.
+ */
+ @Test
+ public void testCheckElementContentWhitespace() {
+ try {
+ String goldFile = TestUtils.GOLDEN_DIR + FILE_SEP + "dbfactory02GF.out";
+ String outputFile = USER_DIR + FILE_SEP + "dbfactory02.out";
+ MyErrorHandler eh = MyErrorHandler.newInstance();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ assertFalse(dbf.isIgnoringElementContentWhitespace());
+ dbf.setIgnoringElementContentWhitespace(true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ db.setErrorHandler(eh);
+ Document doc = db.parse(new File(TestUtils.XML_DIR, "DocumentBuilderFactory06.xml"));
+ assertFalse(eh.errorOccured);
+ DOMSource domSource = new DOMSource(doc);
+ TransformerFactory tfactory = TransformerFactory.newInstance();
+ Transformer transformer = tfactory.newTransformer();
+ SAXResult saxResult = new SAXResult();
+ saxResult.setHandler(MyCHandler.newInstance(new File(outputFile)));
+ transformer.transform(domSource, saxResult);
+ assertTrue(compareWithGold(goldFile, outputFile));
+ } catch (ParserConfigurationException | SAXException | IOException | TransformerException e) {
+ failUnexpected(e);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderImpl01.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderImpl01.java
new file mode 100644
index 00000000000..d565748c37a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderImpl01.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * This checks for the methods of DocumentBuilder
+ */
+public class DocumentBuilderImpl01 implements EntityResolver {
+
+ /**
+ * Provide DocumentBuilder.
+ *
+ * @throws ParserConfigurationException
+ */
+ @DataProvider(name = "builder-provider")
+ public Object[][] getBuilder() throws ParserConfigurationException {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = dbf.newDocumentBuilder();
+ return new Object[][] { { docBuilder } };
+ }
+
+ /**
+ * Testcase to test the default functionality of isValidation method. Expect
+ * to return false because not setting the validation.
+ */
+ @Test(dataProvider = "builder-provider")
+ public void testCheckDocumentBuilderImpl01(DocumentBuilder docBuilder) {
+ assertFalse(docBuilder.isValidating());
+
+ }
+
+ /**
+ * Testcase to test the default functionality of isNamespaceAware method.
+ */
+ @Test(dataProvider = "builder-provider")
+ public void testCheckDocumentBuilderImpl02(DocumentBuilder docBuilder) {
+ assertFalse(docBuilder.isNamespaceAware());
+ }
+
+ /**
+ * Testcase to test the parse(InputStream).
+ */
+ @Test(dataProvider = "builder-provider")
+ public void testCheckDocumentBuilderImpl04(DocumentBuilder docBuilder) {
+ try {
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderImpl01.xml")));
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the parse(File).
+ */
+ @Test(dataProvider = "builder-provider")
+ public void testCheckDocumentBuilderImpl05(DocumentBuilder docBuilder) {
+ try {
+ Document doc = docBuilder.parse(new File(TestUtils.XML_DIR, "DocumentBuilderImpl01.xml"));
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the parse(InputStream,systemId).
+ */
+ @Test(dataProvider = "builder-provider")
+ public void testCheckDocumentBuilderImpl06(DocumentBuilder docBuilder) {
+ try {
+ Document doc = docBuilder.parse(new FileInputStream(new File(TestUtils.XML_DIR, "DocumentBuilderImpl02.xml")), new File(TestUtils.XML_DIR).toURI()
+ .toASCIIString() + FILE_SEP);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the setEntityResolver.
+ */
+ @Test(dataProvider = "builder-provider")
+ public void testCheckDocumentBuilderImpl07(DocumentBuilder docBuilder) {
+ docBuilder.setEntityResolver(this);
+ resolveEntity("publicId", "http://www.myhost.com/today");
+ }
+
+ public InputSource resolveEntity(String publicId, String systemId) {
+ if (systemId.equals("http://www.myhost.com/today"))
+ return new InputSource(systemId);
+ else
+ return null;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/FactoryConfErrorTest.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/FactoryConfErrorTest.java
new file mode 100644
index 00000000000..947d6d8dd7d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/FactoryConfErrorTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+/**
+ * Class containing the test cases for SAXParserFactory/DocumentBuilderFactory
+ * newInstance methods.
+ */
+public class FactoryConfErrorTest {
+
+ /**
+ * Set properties DocumentBuilderFactory and SAXParserFactory to invalid
+ * value before any test run.
+ */
+ @BeforeTest
+ public void setup() {
+ System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "xx");
+ System.setProperty("javax.xml.parsers.SAXParserFactory", "xx");
+ }
+
+ /**
+ * Restore properties DocumentBuilderFactory and SAXParserFactory to default
+ * value after all tests run.
+ */
+ @AfterTest
+ public void cleanup() {
+ System.clearProperty("javax.xml.parsers.DocumentBuilderFactory");
+ System.clearProperty("javax.xml.parsers.SAXParserFactory");
+ }
+
+ /**
+ * To test exception thrown if javax.xml.parsers.SAXParserFactory property
+ * is invalid.
+ */
+ @Test(expectedExceptions = FactoryConfigurationError.class)
+ public void testNewInstance01() {
+ SAXParserFactory.newInstance();
+ }
+
+ /**
+ * To test exeception thrown if javax.xml.parsers.DocumentBuilderFactory is
+ * invalid.
+ */
+ @Test(expectedExceptions = FactoryConfigurationError.class)
+ public void testNewInstance02() {
+ DocumentBuilderFactory.newInstance();
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserFactTest.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserFactTest.java
new file mode 100644
index 00000000000..da87e006f58
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserFactTest.java
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+
+/**
+ * Class containing the test cases for SAXParserFactory API
+ */
+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";
+ private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
+ private static final String VALIDATION = "http://xml.org/sax/features/validation";
+ private static final String EXTERNAL_G_ENTITIES = "http://xml.org/sax/features/external-general-entities";
+ private static final String EXTERNAL_P_ENTITIES = "http://xml.org/sax/features/external-parameter-entities";
+
+ /**
+ * Testcase to test if newSAXParser() method returns SAXParser.
+ */
+ @Test
+ public void testParser01() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser saxparser = spf.newSAXParser();
+ } catch (ParserConfigurationException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the default functionality (No validation) of the parser.
+ */
+ @Test
+ public void testValidate01() {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertFalse(spf.isValidating());
+ }
+
+ /**
+ * Testcase to test the functionality of setValidating and isvalidating
+ * methods.
+ */
+ @Test
+ public void testValidate02() {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setValidating(true);
+ assertTrue(spf.isValidating());
+ }
+
+ /**
+ * Parser should not be namespaceaware by default.
+ */
+ @Test
+ public void testNamespace01() {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertFalse(spf.isNamespaceAware());
+ }
+
+ /**
+ * Testcase to test the functionality of setNamespaceAware and
+ * isNamespaceAware methods.
+ */
+ @Test
+ public void testNamespace02() {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ assertTrue(spf.isNamespaceAware());
+ }
+
+ /**
+ * Testcase to test the functionality of setNamespaceAware and getFeature()
+ * methods for namespaces property.
+ */
+ @Test
+ public void testFeature01() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertFalse(spf.getFeature(NAMESPACES));
+
+ spf.setNamespaceAware(true);
+ assertTrue(spf.getFeature(NAMESPACES));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the functionality of setFeature and getFeature methods
+ * for namespaces property.
+ */
+ @Test
+ public void testFeature02() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+
+ spf.setFeature(NAMESPACES, true);
+ assertTrue(spf.getFeature(NAMESPACES));
+
+ spf.setFeature(NAMESPACES, false);
+ assertFalse(spf.getFeature(NAMESPACES));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the functionality of setFeature and getFeature methods
+ * for namespace-prefixes property.
+ */
+ @Test
+ public void testFeature03() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+
+ spf.setFeature(NAMESPACE_PREFIXES, true);
+ assertTrue(spf.getFeature(NAMESPACE_PREFIXES));
+
+ spf.setFeature(NAMESPACE_PREFIXES, false);
+ assertFalse(spf.getFeature(NAMESPACE_PREFIXES));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the functionality of getFeature method for
+ * string-interning property.
+ */
+ @Test
+ public void testFeature04() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertTrue(spf.getFeature(STRING_INTERNING));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the functionality of getFeature and setValidating
+ * methods for validation property.
+ */
+ @Test
+ public void testFeature05() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertFalse(spf.getFeature(VALIDATION));
+ spf.setValidating(true);
+ assertTrue(spf.getFeature(VALIDATION));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the functionality of setFeature and getFeature methods
+ * for validation property.
+ */
+ @Test
+ public void testFeature06() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+
+ spf.setFeature(VALIDATION, true);
+ assertTrue(spf.getFeature(VALIDATION));
+
+ spf.setFeature(VALIDATION, false);
+ assertFalse(spf.getFeature(VALIDATION));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the functionality of getFeature method for
+ * external-general-entities property.
+ */
+ @Test
+ public void testFeature07() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertTrue(spf.getFeature(EXTERNAL_G_ENTITIES));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the functionality of setFeature and getFeature methods
+ * for external-general-entities property.
+ */
+ @Test
+ public void testFeature08() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setFeature(EXTERNAL_G_ENTITIES, false);
+ assertFalse(spf.getFeature(EXTERNAL_G_ENTITIES));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the functionality of getFeature method for
+ * external-parameter-entities property.
+ */
+ @Test
+ public void testFeature09() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ assertTrue(spf.getFeature(EXTERNAL_P_ENTITIES));
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase to test the functionality of setFeature method for
+ * external-parameter-entitie property.
+ */
+ @Test
+ public void testFeature10() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setFeature(EXTERNAL_P_ENTITIES, false);
+ } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
+ failUnexpected(e);
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest.java
new file mode 100644
index 00000000000..af2c5a683b7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest.java
@@ -0,0 +1,559 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.xml.sax.HandlerBase;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Class contains the test cases for SAXParser API
+ */
+public class SAXParserTest {
+
+ /**
+ * Provide SAXParser.
+ *
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ */
+ @DataProvider(name = "parser-provider")
+ public Object[][] getParser() throws ParserConfigurationException, SAXException {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser saxparser = spf.newSAXParser();
+ return new Object[][] { { saxparser } };
+ }
+
+ /**
+ * Test case with FileInputStream null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse01(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ FileInputStream instream = null;
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(instream, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with an error in xml file, parsing should fail and throw
+ * SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse02(SAXParser saxparser) throws SAXException {
+ try {
+ HandlerBase handler = new HandlerBase();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "invalid.xml"));
+ saxparser.parse(instream, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with a valid in xml file, parser should parse the xml document.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse03(SAXParser saxparser) {
+ try {
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(new File(TestUtils.XML_DIR, "parsertest.xml"), handler);
+ } catch (IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with valid input stream, parser should parse the xml document
+ * successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse04(SAXParser saxparser) {
+ try {
+ HandlerBase handler = new HandlerBase();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "correct.xml"));
+ saxparser.parse(instream, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with valid input source, parser should parse the xml document
+ * successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse05(SAXParser saxparser) {
+ try {
+ HandlerBase handler = new HandlerBase();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "parsertest.xml"));
+ saxparser.parse(instream, handler, new File(TestUtils.XML_DIR).toURI().toASCIIString());
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with uri null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse07(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ String uri = null;
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(uri, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with non-existant uri, parsing should fail and throw
+ * IOException.
+ *
+ * @throws SAXException
+ * @throws IOException
+ */
+ @Test(expectedExceptions = { SAXException.class, IOException.class }, dataProvider = "parser-provider")
+ public void testParse08(SAXParser saxparser) throws SAXException, IOException {
+ String uri = " ";
+
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(uri, handler);
+
+ }
+
+ /**
+ * Testcase with proper uri, parser should parse successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse09(SAXParser saxparser) {
+ try {
+ File file = new File(TestUtils.XML_DIR, "correct.xml");
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(file.toURI().toASCIIString(), handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with File null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse10(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ File file = null;
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(file, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with empty string as File, parsing should fail and throw
+ * SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse11(SAXParser saxparser) throws SAXException {
+ try {
+ HandlerBase handler = new HandlerBase();
+ File file = new File("");
+ saxparser.parse(file, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with xml file that has errors parsing should fail and throw
+ * SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse12(SAXParser saxparser) throws SAXException {
+ try {
+ HandlerBase handler = new HandlerBase();
+ File file = new File(TestUtils.XML_DIR, "valid.xml");
+ saxparser.parse(file, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with xml file that has no errors Parser should successfully
+ * parse the xml document.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse13(SAXParser saxparser) {
+ try {
+ HandlerBase handler = new HandlerBase();
+ File file = new File(TestUtils.XML_DIR, "correct.xml");
+ saxparser.parse(file, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase with input source null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse14(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ InputSource is = null;
+ HandlerBase handler = new HandlerBase();
+ saxparser.parse(is, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with input source attached an invaild xml, parsing should fail
+ * and throw SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse15(SAXParser saxparser) throws SAXException {
+ try {
+ HandlerBase handler = new HandlerBase();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "invalid.xml"));
+ InputSource is = new InputSource(instream);
+ saxparser.parse(is, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with input source attached an vaild xml, parser should
+ * successfully parse the xml document.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse16(SAXParser saxparser) {
+ try {
+ HandlerBase handler = new HandlerBase();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "correct.xml"));
+ InputSource is = new InputSource(instream);
+ saxparser.parse(is, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with FileInputStream null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse17(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ FileInputStream instream = null;
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse(instream, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with an error in xml file, parsing should fail and throw
+ * SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse18(SAXParser saxparser) throws SAXException {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "invalid.xml"));
+ saxparser.parse(instream, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with valid input stream, parser should parse the xml document
+ * successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse19(SAXParser saxparser) {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse(new File(TestUtils.XML_DIR, "parsertest.xml"), handler);
+ } catch (IOException | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with valid input stream, parser should parse the xml document
+ * successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse20(SAXParser saxparser) {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "correct.xml"));
+ saxparser.parse(instream, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with valid input source, parser should parse the xml document
+ * successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse21(SAXParser saxparser) {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "parsertest.xml"));
+ saxparser.parse(instream, handler, new File(TestUtils.XML_DIR).toURI().toASCIIString());
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase with uri null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse23(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ String uri = null;
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse(uri, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with non-existant uri, parsing should fail and throw
+ * SAXException or IOException.
+ *
+ * @throws SAXException
+ * @throws IOException
+ */
+ @Test(expectedExceptions = { SAXException.class, IOException.class }, dataProvider = "parser-provider")
+ public void testParse24(SAXParser saxparser) throws SAXException, IOException {
+ String uri = " ";
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse(uri, handler);
+
+ }
+
+ /**
+ * Testcase with proper uri, parser should parse successfully.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse25(SAXParser saxparser) {
+ try {
+ File file = new File(TestUtils.XML_DIR, "correct.xml");
+
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse(file.toURI().toASCIIString(), handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with File null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse26(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse((File) null, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with empty string as File, parsing should fail and throw
+ * SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse27(SAXParser saxparser) throws SAXException {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ File file = new File("");
+ saxparser.parse(file, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with xml file that has errors, parsing should fail and throw
+ * SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse28(SAXParser saxparser) throws SAXException {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ File file = new File(TestUtils.XML_DIR, "valid.xml");
+ saxparser.parse(file, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with xml file that has no errors, parser should successfully
+ * parse the xml document.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse29(SAXParser saxparser) {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ File file = new File(TestUtils.XML_DIR, "correct.xml");
+ saxparser.parse(file, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with input source null, parsing should fail and throw
+ * IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ @Test(expectedExceptions = IllegalArgumentException.class, dataProvider = "parser-provider")
+ public void testParse30(SAXParser saxparser) throws IllegalArgumentException {
+ try {
+ InputSource is = null;
+ DefaultHandler handler = new DefaultHandler();
+ saxparser.parse(is, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Testcase with an invalid xml file, parser should throw SAXException.
+ *
+ * @throws SAXException
+ */
+ @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
+ public void testParse31(SAXParser saxparser) throws SAXException {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "invalid.xml"));
+ InputSource is = new InputSource(instream);
+ saxparser.parse(is, handler);
+ } catch (IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test case to parse an xml file that not use namespaces.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParse32(SAXParser saxparser) {
+ try {
+ DefaultHandler handler = new DefaultHandler();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "correct.xml"));
+ InputSource is = new InputSource(instream);
+ saxparser.parse(is, handler);
+ } catch (SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test case to parse an xml file that uses namespaces.
+ */
+ @Test
+ public void testParse33() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ SAXParser saxparser = spf.newSAXParser();
+ HandlerBase handler = new HandlerBase();
+ FileInputStream instream = new FileInputStream(new File(TestUtils.XML_DIR, "ns4.xml"));
+ saxparser.parse(instream, handler);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest02.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest02.java
new file mode 100644
index 00000000000..9bfd3ef4c4e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest02.java
@@ -0,0 +1,283 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.xml.sax.Parser;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
+
+/**
+ * Class contains the test cases for SAXParser API
+ */
+public class SAXParserTest02 {
+ final String DOM_NODE = "http://xml.org/sax/properties/dom-node";
+ final String XML_STRING = "http://xml.org/sax/properties/xml-string";
+ final String DECL_HANDLER = "http://xml.org/sax/properties/declaration-handler";
+ final String LEXICAL_HANDLER = "http://xml.org/sax/properties/lexical-handler";
+
+ /**
+ * Provide SAXParser.
+ *
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ */
+ @DataProvider(name = "parser-provider")
+ public Object[][] getParser() throws ParserConfigurationException, SAXException {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser saxparser = spf.newSAXParser();
+ return new Object[][] { { saxparser } };
+ }
+
+ /**
+ * Testcase to test the default functionality (No validation) of the parser.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testValidate01(SAXParser saxparser) {
+ try {
+ assertFalse(saxparser.isValidating());
+ } catch (FactoryConfigurationError e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Testcase to test the functionality of setValidating and isvalidating
+ * methods.
+ */
+ @Test
+ public void testValidate02() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setValidating(true);
+ spf.newSAXParser();
+ assertTrue(spf.isValidating());
+ } catch (FactoryConfigurationError | ParserConfigurationException | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Test case to test isNamespaceAware() method. By default, namespaces are
+ * not supported.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testNamespace01(SAXParser saxparser) {
+ try {
+ assertFalse(saxparser.isNamespaceAware());
+ } catch (FactoryConfigurationError e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Test case to test setnamespaceAware() method.
+ */
+ @Test
+ public void testNamespace02() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ SAXParser saxparser = spf.newSAXParser();
+ assertTrue(saxparser.isNamespaceAware());
+ } catch (FactoryConfigurationError | ParserConfigurationException | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Test case to test if the getParser() method returns instance of Parser.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testParser01(SAXParser saxparser) {
+ try {
+ Parser parser = saxparser.getParser();
+ } catch (FactoryConfigurationError | SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Test case to test if the getXMLReader() method returns instance of
+ * XMLReader.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testXmlReader01(SAXParser saxparser) {
+ try {
+ XMLReader xmlReader = saxparser.getXMLReader();
+ } catch (FactoryConfigurationError | SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test whether the xml-string property is not supported.
+ *
+ * @throws SAXNotSupportedException
+ */
+ @Test(expectedExceptions = SAXNotSupportedException.class, dataProvider = "parser-provider")
+ public void testProperty01(SAXParser saxparser) throws SAXNotSupportedException {
+ try {
+ Object object = saxparser.getProperty(XML_STRING);
+ } catch (SAXNotRecognizedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test whether the dom-node property is not supported.
+ *
+ * @throws SAXNotSupportedException
+ */
+ @Test(expectedExceptions = SAXNotSupportedException.class, dataProvider = "parser-provider")
+ public void testProperty02(SAXParser saxparser) throws SAXNotSupportedException {
+ try {
+ Object object = saxparser.getProperty(DOM_NODE);
+ } catch (SAXNotRecognizedException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test the default lexical-handler not exists.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testProperty03(SAXParser saxparser) {
+ try {
+ assertNull(saxparser.getProperty(LEXICAL_HANDLER));
+ } catch (SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Test the default declaration-handler not exists.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testProperty04(SAXParser saxparser) {
+
+ try {
+ assertNull(saxparser.getProperty(DECL_HANDLER));
+ } catch (SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test to set and get the lexical-handler.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testProperty05(SAXParser saxparser) {
+ try {
+ MyLexicalHandler myLexicalHandler = new MyLexicalHandler();
+ saxparser.setProperty(LEXICAL_HANDLER, myLexicalHandler);
+ Object object = saxparser.getProperty(LEXICAL_HANDLER);
+ assertTrue(object instanceof LexicalHandler);
+ } catch (SAXException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * Test to set and get the declaration-handler.
+ */
+ @Test(dataProvider = "parser-provider")
+ public void testProperty06(SAXParser saxparser) {
+ try {
+ MyDeclHandler myDeclHandler = new MyDeclHandler();
+ saxparser.setProperty(DECL_HANDLER, myDeclHandler);
+ Object object = saxparser.getProperty(DECL_HANDLER);
+ assertTrue(object instanceof DeclHandler);
+ } catch (SAXException e) {
+ failUnexpected(e);
+ }
+
+ }
+
+ /**
+ * Customized LexicalHandler used for test.
+ */
+ private class MyLexicalHandler implements LexicalHandler {
+
+ public void comment(char[] ch, int start, int length) {
+ }
+
+ public void endCDATA() {
+ }
+
+ public void endDTD() {
+ }
+
+ public void endEntity(String name) {
+ }
+
+ public void startCDATA() {
+ }
+
+ public void startDTD(String name, String publicId, String systemId) {
+ }
+
+ public void startEntity(String name) {
+ }
+ }
+
+ /**
+ * Customized DeclHandler used for test.
+ */
+ private class MyDeclHandler implements DeclHandler {
+
+ public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) {
+ }
+
+ public void elementDecl(String name, String model) {
+ }
+
+ public void externalEntityDecl(String name, String publicId, String systemId) {
+ }
+
+ public void internalEntityDecl(String name, String value) {
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest03.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest03.java
new file mode 100644
index 00000000000..efe12c595d6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest03.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/**
+ * Class contains the test cases for SAXParser API
+ */
+public class SAXParserTest03 {
+
+ /**
+ * Provide SAXParserFactory.
+ *
+ * @throws Exception
+ */
+ @DataProvider(name = "input-provider")
+ public Object[][] getFactory() {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setValidating(true);
+ MyErrorHandler handler = MyErrorHandler.newInstance();
+ return new Object[][] { { spf, handler } };
+ }
+
+ /**
+ * parsertest.xml holds a valid document. This method tests the validating
+ * parser.
+ */
+ @Test(dataProvider = "input-provider")
+ public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler) {
+ try {
+ SAXParser saxparser = spf.newSAXParser();
+ saxparser.parse(new File(TestUtils.XML_DIR, "parsertest.xml"), handler);
+ assertFalse(handler.errorOccured);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * validns.xml holds a valid document with XML namespaces in it. This method
+ * tests the Validating parser with namespace processing on.
+ */
+ @Test(dataProvider = "input-provider")
+ public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler) {
+ try {
+ spf.setNamespaceAware(true);
+ SAXParser saxparser = spf.newSAXParser();
+ saxparser.parse(new File(TestUtils.XML_DIR, "validns.xml"), handler);
+ assertFalse(handler.errorOccured);
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ failUnexpected(e);
+ }
+ }
+
+ /**
+ * invalidns.xml holds an invalid document with XML namespaces in it. This
+ * method tests the validating parser with namespace processing on. It
+ * should throw validation error.
+ */
+ @Test(dataProvider = "input-provider")
+ public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler) {
+ try {
+ spf.setNamespaceAware(true);
+ SAXParser saxparser = spf.newSAXParser();
+ saxparser.parse(new File(TestUtils.XML_DIR, "invalidns.xml"), handler);
+ failUnexpected(new RuntimeException());
+ } catch (ParserConfigurationException | SAXException | IOException e) {
+ if (e instanceof SAXException) {
+ assertTrue(handler.errorOccured);
+ }
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/TestUtils.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/TestUtils.java
new file mode 100644
index 00000000000..9f8dc355333
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/TestUtils.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.parsers.ptests;
+
+import static jaxp.library.JAXPTestUtilities.ERROR_MSG_HEADER;
+import static jaxp.library.JAXPTestUtilities.FILE_SEP;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.LocatorImpl;
+
+/**
+ * Utility interface which includes final variables of xml, golden file
+ * directories.
+ */
+interface TestUtils {
+ final String XML_DIR = System.getProperty("test.src", ".") + FILE_SEP + "javax/xml/parsers/xmlfiles";
+ final String GOLDEN_DIR = XML_DIR + FILE_SEP + "out";
+}
+
+/**
+ * Customized DefaultHandler which writes output document when methods are
+ * called by Transformer. Test may use output document to compare with golden
+ * file for verification.
+ */
+class MyCHandler extends DefaultHandler {
+
+ private final BufferedWriter bWriter;
+ private final Locator locator = new LocatorImpl();
+
+ private MyCHandler(File file) throws IOException {
+ bWriter = new BufferedWriter(new FileWriter(file));
+ }
+
+ public static MyCHandler newInstance(File file) throws IOException {
+ MyCHandler handler = new MyCHandler(file);
+ return handler;
+ }
+
+ public void characters(char[] ch, int start, int length) {
+ String s = new String(ch, start, length);
+ String str = String.format("characters...length is:%d\n<%s>", s.length(), s);
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void endDocument() {
+ String str = "endDocument...";
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ bWriter.flush();
+ bWriter.close();
+
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void endElement(String namespaceURI, String localName, String qName) {
+ String str = String.format("endElement...\nnamespaceURI: <%s> localName: <%s> qName: <%s>", namespaceURI, localName, qName);
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void endPrefixMapping(String prefix) {
+ String str = String.format("endPrefixMapping...\nprefix: <%s>", prefix);
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void ignorableWhitespace(char[] ch, int start, int length) {
+ String s = new String(ch, start, length);
+ String str = String.format("ignorableWhitespace...\n%s ignorable white space string length: %d", s, s.length());
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void processingInstruction(String target, String data) {
+ String str = String.format("processingInstruction...target:<%s> data: <%s>", target, data);
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void skippedEntity(String name) {
+ String str = String.format("skippedEntity...\nname: <%s>", name);
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void startDocument() {
+ String str = "startDocument...";
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
+ String str = String.format("startElement...\nnamespaceURI: <%s> localName: <%s> qName: <%s> Number of Attributes: <%d> Line# <%d>", namespaceURI,
+ localName, qName, atts.getLength(), locator.getLineNumber());
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+
+ public void startPrefixMapping(String prefix, String uri) {
+ String str = String.format("startPrefixMapping...\nprefix: <%s> uri: <%s>", prefix, uri);
+ try {
+ bWriter.write(str, 0, str.length());
+ bWriter.newLine();
+ } catch (IOException e) {
+ throw new RuntimeException(ERROR_MSG_HEADER, e);
+ }
+ }
+}
+
+/**
+ * Customized DefaultHandler used for SAXParseException testing.
+ */
+class MyErrorHandler extends DefaultHandler {
+ boolean errorOccured = false;
+
+ private MyErrorHandler() {
+ }
+
+ public static MyErrorHandler newInstance() {
+ return new MyErrorHandler();
+ }
+
+ public void error(SAXParseException e) {
+ errorOccured = true;
+ }
+
+ public void warning(SAXParseException e) {
+ errorOccured = true;
+ }
+
+ public void fatalError(SAXParseException e) {
+ errorOccured = true;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory01.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory01.xml
new file mode 100644
index 00000000000..fbd395050da
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory01.xml
@@ -0,0 +1,4 @@
+
+
+This is not parsed]]> yet
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory02.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory02.xml
new file mode 100644
index 00000000000..df31079b448
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory02.xml
@@ -0,0 +1,9 @@
+
+
+
+
+]>
+
+ &ws;
+
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory03.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory03.xml
new file mode 100644
index 00000000000..6b46e0066cc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory03.xml
@@ -0,0 +1,9 @@
+
+
+
+
+]>
+
+ &ws;
+
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory04.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory04.xml
new file mode 100644
index 00000000000..febbd6e4498
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory04.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+]>
+
+ xmlns:br="http://www.abc.com">
+Tove
+Jani
+Next
+Reminder
+ weekend!
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory05.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory05.xml
new file mode 100644
index 00000000000..29ff804df9b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory05.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+]>
+
+ xmlns:br="http://www.abc.com">
+Tove
+Jani
+Next
+Reminder
+ weekend!
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory06.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory06.xml
new file mode 100644
index 00000000000..8774a5ac5f5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory06.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+John
+
+
+with whitespace
+Jani
+Next
+Reminder
+ weekend!
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory07.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory07.xml
new file mode 100644
index 00000000000..a0c5f387d00
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory07.xml
@@ -0,0 +1,9 @@
+
+
+
+]>
+
+Tove
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory08.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory08.xml
new file mode 100644
index 00000000000..8bc74d7ad8d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderFactory08.xml
@@ -0,0 +1,5 @@
+
+
+Tove
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl01.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl01.xml
new file mode 100644
index 00000000000..fbd395050da
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl01.xml
@@ -0,0 +1,4 @@
+
+
+This is not parsed]]> yet
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl02.dtd b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl02.dtd
new file mode 100644
index 00000000000..28b8a7b586a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl02.dtd
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl02.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl02.xml
new file mode 100644
index 00000000000..89e09643844
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/DocumentBuilderImpl02.xml
@@ -0,0 +1,28 @@
+
+
+
+
+ Publishers of the Music of New York Women Composers
+
+ The Publishers
+
+
+ Alfred Publishing
+ &w;
+ 15535 Morrison
+ South Oaks CA 91403
+
+
+
+ eXtensible Markup Language
+
+
+
+
+
+ Publishers are not noted in report by time.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/correct.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/correct.xml
new file mode 100644
index 00000000000..5c137300c85
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/correct.xml
@@ -0,0 +1,23 @@
+
+
+ Publishers of the Music of New York Women Composers
+
+ The Publishers
+
+
+ Alfred Publishing
+ 15535 Morrison
+ South Oaks CA 91403
+
+
+
+ eXtensible Markup Language
+
+
+
+
+
+ Publishers are not noted in report by time.
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10.xml
new file mode 100644
index 00000000000..f73db963097
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10.xsl b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10.xsl
new file mode 100644
index 00000000000..b8b354d8afe
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10.xsl
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10import.xsl b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10import.xsl
new file mode 100644
index 00000000000..4a72677c638
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10import.xsl
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10include.xsl b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10include.xsl
new file mode 100644
index 00000000000..690055f8c22
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/dbf10include.xsl
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/firstdtd.dtd b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/firstdtd.dtd
new file mode 100644
index 00000000000..6fbfdfeb67b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/firstdtd.dtd
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/invalid.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/invalid.xml
new file mode 100644
index 00000000000..18b1e6175bc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/invalid.xml
@@ -0,0 +1,24 @@
+
+
+ Publishers of the Music of New York Women Composers
+
+ The Publishers
+
+
+ Alfred Publishing
+ &mkm;
+ 15535 Morrison
+ South Oaks CA 91403
+
+
+
+ eXtensible Markup Language
+
+
+
+
+
+ Publishers are not noted in report by time.
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/invalidns.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/invalidns.xml
new file mode 100644
index 00000000000..5ce64b9733a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/invalidns.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+]>
+
+ 4star
+ 3star
+ 2star
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/namespace1.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/namespace1.xml
new file mode 100644
index 00000000000..580e279c407
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/namespace1.xml
@@ -0,0 +1,15 @@
+
+
+
+ Typography
+
+
+
+
Welcome to the world of typography! Here is a book that you may find useful.
Number of Attributes: <0> Line# <0>
+characters...length is:77
+< Welcome to the world of typography! Here is a book that you may find useful.>
+endElement...
+namespaceURI: localName:
Number of Attributes: <0> Line# <0>
+characters...length is:77
+< Welcome to the world of typography! Here is a book that you may find useful.>
+endElement...
+namespaceURI: localName:
qName:
+characters...length is:5
+<
+ >
+startElement...
+namespaceURI: localName: qName: Number of Attributes: <1> Line# <0>
+characters...length is:18
+
+endElement...
+namespaceURI: localName: qName:
+characters...length is:6
+<
+ >
+startElement...
+namespaceURI: localName: qName: Number of Attributes: <0> Line# <0>
+characters...length is:12
+
+endElement...
+namespaceURI: localName: qName:
+characters...length is:5
+<
+ >
+processingInstruction...target: data:
+characters...length is:3
+<
+ >
+endElement...
+namespaceURI: localName: qName:
+characters...length is:2
+<
+
+>
+endElement...
+namespaceURI: localName: qName:
+endPrefixMapping...
+prefix:
+endPrefixMapping...
+prefix: <>
+endDocument...
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/parsertest.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/parsertest.xml
new file mode 100644
index 00000000000..3d3192f4045
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/parsertest.xml
@@ -0,0 +1,25 @@
+
+
+
+ Publishers of the Music of New York Women Composers
+
+ The Publishers
+
+
+ Alfred Publishing
+ &mkm;
+ 15535 Morrison
+ South Oaks CA 91403
+
+
+
+ eXtensible Markup Language
+
+
+
+
+
+ Publishers are not noted in report by time.
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test.xml
new file mode 100644
index 00000000000..8ad28618d01
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test.xml
@@ -0,0 +1,5 @@
+
+
+ John
+444-121-3434
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test.xsd b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test.xsd
new file mode 100644
index 00000000000..1671283691c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test.xsd
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test1.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test1.xml
new file mode 100644
index 00000000000..45de38a3bce
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/test1.xml
@@ -0,0 +1,5 @@
+
+
+ John
+444-121-3434
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/valid.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/valid.xml
new file mode 100644
index 00000000000..18b1e6175bc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/valid.xml
@@ -0,0 +1,24 @@
+
+
+ Publishers of the Music of New York Women Composers
+
+ The Publishers
+
+
+ Alfred Publishing
+ &mkm;
+ 15535 Morrison
+ South Oaks CA 91403
+
+
+
+ eXtensible Markup Language
+
+
+
+
+
+ Publishers are not noted in report by time.
+
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/validns.xml b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/validns.xml
new file mode 100644
index 00000000000..805b468e74e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/xmlfiles/validns.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+]>
+
+ 4star
+ 3star
+
diff --git a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java
index 1c92fd67316..45099ebb19c 100644
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java
@@ -61,33 +61,25 @@ public class TransformerFactoryTest {
String xmlFile = XML_DIR + "TransformerFactoryTest.xml";
String xmlURI = "file:///" + XML_DIR;
- try {
+ try (FileInputStream fis = new FileInputStream(xmlFile);
+ FileOutputStream fos = new FileOutputStream(outputFile);) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
- Document doc = db.parse(new FileInputStream(xmlFile), xmlURI);
+ Document doc = db.parse(fis, xmlURI);
DOMSource domSource = new DOMSource(doc);
domSource.setSystemId(xmlURI);
- StreamResult streamResult =new StreamResult(
- new FileOutputStream(outputFile));
+ StreamResult streamResult = new StreamResult(fos);
TransformerFactory tFactory = TransformerFactory.newInstance();
- Source s = tFactory.getAssociatedStylesheet(domSource,"screen",
- "Modern",null);
+ Source s = tFactory.getAssociatedStylesheet(domSource, "screen",
+ "Modern", null);
Transformer t = tFactory.newTransformer();
- t.transform(s,streamResult);
+ t.transform(s, streamResult);
assertTrue(compareWithGold(goldFile, outputFile));
- }catch (IOException | ParserConfigurationException
+ } catch (IOException | ParserConfigurationException
| TransformerException | SAXException ex) {
failUnexpected(ex);
- } finally {
- try {
- Path outputPath = Paths.get(outputFile);
- if(Files.exists(outputPath))
- Files.delete(outputPath);
- } catch (IOException ex) {
- failCleanup(ex, outputFile);
- }
}
}
}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6350682.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6350682.java
new file mode 100644
index 00000000000..04d4f2502b7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6350682.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.common;
+
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6350682
+ * @summary Test SAXParserFactory and TransformerFactory can newInstance when setContextClassLoader(null).
+ */
+public class Bug6350682 {
+
+ @Test
+ public void testSAXParserFactory() {
+ try {
+ Thread.currentThread().setContextClassLoader(null);
+ if (Bug6350682.class.getClassLoader() == null)
+ System.out.println("this class loader is NULL");
+ else
+ System.out.println("this class loader is NOT NULL");
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ Assert.assertTrue(factory != null, "Failed to get an instance of a SAXParserFactory");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testTransformerFactory() {
+ try {
+ Thread.currentThread().setContextClassLoader(null);
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Assert.assertTrue(factory != null, "Failed to get an instance of a TransformerFactory");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ } catch (TransformerFactoryConfigurationError error) {
+ error.printStackTrace();
+ Assert.fail(error.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6723276Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6723276Test.java
new file mode 100644
index 00000000000..7e1ecd89a6f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6723276Test.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.common;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.xml.parsers.SAXParserFactory;
+
+/*
+ * @bug 6723276
+ * @summary Test JAXP class can be loaded by bootstrap classloader.
+ */
+public class Bug6723276Test {
+
+ @Test
+ public void test1() {
+ try {
+ SAXParserFactory.newInstance();
+ } catch (Exception e) {
+ if (e.getMessage().indexOf("org.apache.xerces.jaxp.SAXParserFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ }
+ }
+ }
+
+ @Test
+ public void test2() {
+ try {
+ System.out.println(Thread.currentThread().getContextClassLoader());
+ System.out.println(ClassLoader.getSystemClassLoader().getParent());
+ Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0], ClassLoader.getSystemClassLoader().getParent()));
+ SAXParserFactory.newInstance();
+ } catch (Exception e) {
+ if (e.getMessage().indexOf("org.apache.xerces.jaxp.SAXParserFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ }
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xml
new file mode 100644
index 00000000000..eca850a354f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xml
@@ -0,0 +1,10 @@
+
+
+
+ test
+
+
+
+ information
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xsd
new file mode 100644
index 00000000000..27282f4da15
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169.xsd
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169Test.java
new file mode 100644
index 00000000000..fa35c3aa2cb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6941169Test.java
@@ -0,0 +1,501 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.common;
+
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.security.AllPermission;
+import java.security.Permission;
+import java.security.Permissions;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 6941169
+ * @summary Test use-service-mechanism feature.
+ */
+public class Bug6941169Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ private static final String DOM_FACTORY_ID = "javax.xml.parsers.DocumentBuilderFactory";
+ private static final String SAX_FACTORY_ID = "javax.xml.parsers.SAXParserFactory";
+
+ // impl specific feature
+ final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism";
+
+ static String _xml = Bug6941169Test.class.getResource("Bug6941169.xml").getPath();
+ static String _xsd = Bug6941169Test.class.getResource("Bug6941169.xsd").getPath();
+
+ @Test
+ public void testValidation_SAX_withoutServiceMech() {
+ System.out.println("Validation using SAX Source; Service mechnism is turned off; SAX Impl should be the default:");
+ InputSource is = new InputSource(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"));
+ SAXSource ss = new SAXSource(is);
+ System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false);
+ Schema schema = factory.newSchema(new StreamSource(_xsd));
+ Validator validator = schema.newValidator();
+ validator.validate(ss, null);
+ } catch (Exception e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("javax.xml.parsers.FactoryConfigurationError: Provider MySAXFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ }
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(SAX_FACTORY_ID);
+ }
+
+ @Test
+ public void testValidation_SAX_withServiceMech() {
+ System.out.println("Validation using SAX Source. Using service mechnism (by default) to find SAX Impl:");
+ InputSource is = new InputSource(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"));
+ SAXSource ss = new SAXSource(is);
+ System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new StreamSource(_xsd));
+ Validator validator = schema.newValidator();
+ validator.validate(ss, null);
+ Assert.fail("User impl MySAXFactoryImpl should be used.");
+ } catch (Exception e) {
+ String error = e.getMessage();
+ if (error.indexOf("javax.xml.parsers.FactoryConfigurationError: Provider MySAXFactoryImpl not found") > 0) {
+ // expected
+ }
+ // System.out.println(e.getMessage());
+
+ }
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(SAX_FACTORY_ID);
+ }
+
+ @Test
+ public void testValidation_SAX_withSM() {
+ System.out.println("Validation using SAX Source with security manager:");
+ InputSource is = new InputSource(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"));
+ SAXSource ss = new SAXSource(is);
+ System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl");
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+ System.setSecurityManager(new MySM(granted));
+
+ long start = System.currentTimeMillis();
+ try {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false);
+ Schema schema = factory.newSchema(new StreamSource(_xsd));
+ Validator validator = schema.newValidator();
+ validator.validate(ss, null);
+ } catch (Exception e) {
+ String error = e.getMessage();
+ if (error.indexOf("javax.xml.parsers.FactoryConfigurationError: Provider MySAXFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } finally {
+ System.clearProperty(SAX_FACTORY_ID);
+ System.setSecurityManager(null);
+ }
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.setSecurityManager(null);
+
+ }
+
+ @Test
+ public void testTransform_DOM_withoutServiceMech() {
+ System.out.println("Transform using DOM Source; Service mechnism is turned off; Default DOM Impl should be the default:");
+ DOMSource domSource = new DOMSource();
+ domSource.setSystemId(_xml);
+
+ // DOMSource domSource = new
+ // DOMSource(getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")));
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false);
+
+ Transformer t = factory.newTransformer();
+
+ StringWriter result = new StringWriter();
+ StreamResult streamResult = new StreamResult(result);
+ t.transform(domSource, streamResult);
+ System.out.println("Writing to " + result.toString());
+
+ } catch (Exception e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } catch (Error e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ }
+
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ /** this is by default */
+ @Test
+ public void testTransform_DOM_withServiceMech() {
+ System.out.println("Transform using DOM Source; By default, the factory uses services mechanism to look up impl:");
+ DOMSource domSource = new DOMSource();
+ domSource.setSystemId(_xml);
+
+ // DOMSource domSource = new
+ // DOMSource(getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")));
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer t = factory.newTransformer();
+
+ StringWriter result = new StringWriter();
+ StreamResult streamResult = new StreamResult(result);
+ t.transform(domSource, streamResult);
+ System.out.println("Writing to " + result.toString());
+
+ Assert.fail("User impl MyDOMFactoryImpl should be used.");
+
+ } catch (Exception e) {
+ String error = e.getMessage();
+ if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) {
+ // expected
+ }
+ System.out.println(error);
+
+ } catch (Error e) {
+ String error = e.getMessage();
+ if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) {
+ // expected
+ }
+ System.out.println(error);
+
+ }
+
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testTransform_DOM_withSM() {
+ System.out.println("Transform using DOM Source; Security Manager is set:");
+ DOMSource domSource = new DOMSource();
+ domSource.setSystemId(_xml);
+
+ // DOMSource domSource = new
+ // DOMSource(getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml")));
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+ System.setSecurityManager(new MySM(granted));
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ TransformerFactory factory = TransformerFactory.newInstance("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl",
+ TransformerFactory.class.getClassLoader());
+ Transformer t = factory.newTransformer();
+
+ StringWriter result = new StringWriter();
+ StreamResult streamResult = new StreamResult(result);
+ t.transform(domSource, streamResult);
+ System.out.println("Writing to " + result.toString());
+
+ } catch (Exception e) {
+ String error = e.getMessage();
+ if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } catch (Error e) {
+ String error = e.getMessage();
+ if (error.indexOf("Provider MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } finally {
+ System.clearProperty(DOM_FACTORY_ID);
+ System.setSecurityManager(null);
+ }
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testXPath_DOM_withoutServiceMech() {
+ final String XPATH_EXPRESSION = "/fooTest";
+ System.out.println("Evaluate DOM Source; Service mechnism is turned off; Default DOM Impl should be used:");
+ Document doc = getDocument(Bug6941169Test.class.getResourceAsStream("Bug6941169.xml"));
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ XPathFactory xPathFactory = XPathFactory.newInstance();
+ xPathFactory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, false);
+
+ XPath xPath = xPathFactory.newXPath();
+
+ String xPathResult = xPath.evaluate(XPATH_EXPRESSION, doc);
+
+ } catch (Exception e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } catch (Error e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl is used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ }
+
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testXPath_DOM_withServiceMech() {
+ final String XPATH_EXPRESSION = "/fooTest";
+ System.out.println("Evaluate DOM Source; Service mechnism is on by default; It would try to use MyDOMFactoryImpl:");
+ InputStream input = getClass().getResourceAsStream("Bug6941169.xml");
+ InputSource source = new InputSource(input);
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ XPathFactory xPathFactory = XPathFactory.newInstance();
+
+ XPath xPath = xPathFactory.newXPath();
+
+ String xPathResult = xPath.evaluate(XPATH_EXPRESSION, source);
+ Assert.fail("User impl MyDOMFactoryImpl should be used.");
+
+ } catch (Exception e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("MyDOMFactoryImpl not found") > 0) {
+ System.out.println("Tried to locate MyDOMFactoryImpl");
+ } else {
+ Assert.fail(e.getMessage());
+
+ }
+
+ // System.out.println(e.getMessage());
+
+ } catch (Error e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("MyDOMFactoryImpl not found") > 0) {
+ System.out.println("Tried to locate MyDOMFactoryImpl");
+ } else {
+ Assert.fail(e.getMessage());
+
+ }
+
+ // System.out.println(e.getMessage());
+
+ }
+
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testXPath_DOM_withSM() {
+ final String XPATH_EXPRESSION = "/fooTest";
+ System.out.println("Evaluate DOM Source; Security Manager is set:");
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+ System.setSecurityManager(new MySM(granted));
+ InputStream input = getClass().getResourceAsStream("Bug6941169.xml");
+ InputSource source = new InputSource(input);
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+ long start = System.currentTimeMillis();
+ try {
+ XPathFactory xPathFactory = XPathFactory.newInstance("http://java.sun.com/jaxp/xpath/dom",
+ "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", null);
+
+ XPath xPath = xPathFactory.newXPath();
+
+ String xPathResult = xPath.evaluate(XPATH_EXPRESSION, source);
+ System.out.println("Use default impl");
+ } catch (Exception e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl should be used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } catch (Error e) {
+ // e.printStackTrace();
+ String error = e.getMessage();
+ if (error.indexOf("MyDOMFactoryImpl not found") > 0) {
+ Assert.fail(e.getMessage());
+ } else {
+ System.out.println("Default impl should be used");
+ }
+
+ // System.out.println(e.getMessage());
+
+ } finally {
+ System.clearProperty(DOM_FACTORY_ID);
+ System.setSecurityManager(null);
+ }
+ long end = System.currentTimeMillis();
+ double elapsedTime = ((end - start));
+ System.out.println("Time elapsed: " + elapsedTime);
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testSM() {
+ SecurityManager sm = System.getSecurityManager();
+ if (System.getSecurityManager() != null) {
+ System.out.println("Security manager not cleared: " + sm.toString());
+ } else {
+ System.out.println("Security manager cleared: ");
+ }
+ }
+
+ private static Document getDocument(InputStream in) {
+
+ Document document = null;
+
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ document = db.parse(in);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ return document;
+ }
+
+ class MySM extends SecurityManager {
+ Permissions granted;
+
+ public MySM(Permissions perms) {
+ granted = perms;
+ }
+
+ @Override
+ public void checkPermission(Permission perm) {
+ if (granted.implies(perm)) {
+ return;
+ }
+ super.checkPermission(perm);
+ }
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java
new file mode 100644
index 00000000000..4058e3a41bf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.common;
+
+import org.testng.annotations.Test;
+
+import com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck;
+
+/*
+ * @bug 6979306
+ * @summary Test JAXP component version.
+ */
+public class Bug6979306Test {
+
+ @Test
+ public void test() {
+ String[] input = {};
+ EnvironmentCheck.main(input);
+ com.sun.org.apache.xerces.internal.impl.Version.main(input);
+ com.sun.org.apache.xalan.internal.Version._main(input);
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java
new file mode 100644
index 00000000000..a9f8b84c13c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.common;
+
+import java.security.AllPermission;
+import java.security.Permission;
+import java.security.Permissions;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.xpath.XPathFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 7143711
+ * @summary Test set use-service-mechanism shall not override what's set by the constructor in secure mode.
+ */
+public class Bug7143711Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ private static final String DOM_FACTORY_ID = "javax.xml.parsers.DocumentBuilderFactory";
+ private static final String SAX_FACTORY_ID = "javax.xml.parsers.SAXParserFactory";
+
+ // impl specific feature
+ final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism";
+
+ @Test
+ public void testValidation_SAX_withSM() {
+ System.out.println("Validation using SAX Source with security manager:");
+ System.setProperty(SAX_FACTORY_ID, "MySAXFactoryImpl");
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+ System.setSecurityManager(new MySM(granted));
+
+ try {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ // should not allow
+ factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true);
+ if ((boolean) factory.getFeature(ORACLE_FEATURE_SERVICE_MECHANISM)) {
+ Assert.fail("should not override in secure mode");
+ }
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+
+ } finally {
+ System.clearProperty(SAX_FACTORY_ID);
+ System.setSecurityManager(null);
+ }
+
+ System.setSecurityManager(null);
+
+ }
+
+ @Test
+ public void testTransform_DOM_withSM() {
+ System.out.println("Transform using DOM Source; Security Manager is set:");
+
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+ System.setSecurityManager(new MySM(granted));
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+
+ try {
+ TransformerFactory factory = TransformerFactory.newInstance("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl",
+ TransformerFactory.class.getClassLoader());
+ factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true);
+ if (((com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl) factory).useServicesMechnism()) {
+ Assert.fail("should not override in secure mode");
+ }
+
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ } finally {
+ System.clearProperty(DOM_FACTORY_ID);
+ System.setSecurityManager(null);
+ }
+
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testXPath_DOM_withSM() {
+ System.out.println("Evaluate DOM Source; Security Manager is set:");
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+ System.setSecurityManager(new MySM(granted));
+ System.setProperty(DOM_FACTORY_ID, "MyDOMFactoryImpl");
+
+ try {
+ XPathFactory xPathFactory = XPathFactory.newInstance("http://java.sun.com/jaxp/xpath/dom",
+ "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", null);
+ xPathFactory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true);
+ if ((boolean) xPathFactory.getFeature(ORACLE_FEATURE_SERVICE_MECHANISM)) {
+ Assert.fail("should not override in secure mode");
+ }
+
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ } finally {
+ System.clearProperty(DOM_FACTORY_ID);
+ System.setSecurityManager(null);
+ }
+
+ System.clearProperty(DOM_FACTORY_ID);
+ }
+
+ @Test
+ public void testSM() {
+ SecurityManager sm = System.getSecurityManager();
+ if (System.getSecurityManager() != null) {
+ System.out.println("Security manager not cleared: " + sm.toString());
+ } else {
+ System.out.println("Security manager cleared: ");
+ }
+ }
+
+ class MySM extends SecurityManager {
+ Permissions granted;
+
+ public MySM(Permissions perms) {
+ granted = perms;
+ }
+
+ @Override
+ public void checkPermission(Permission perm) {
+ if (granted.implies(perm)) {
+ return;
+ }
+ super.checkPermission(perm);
+ }
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6320118.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6320118.java
new file mode 100644
index 00000000000..959a978f6f0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6320118.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6320118
+ * @summary Test xml datatype XMLGregorianCalendar.
+ */
+public class Bug6320118 {
+
+ DatatypeFactory df;
+
+ @Test
+ public void test1() {
+ try {
+ df = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException e) {
+ Assert.fail(e.getMessage());
+ }
+
+ try {
+ XMLGregorianCalendar calendar = df.newXMLGregorianCalendar(1970, 1, 1, 24, 0, 0, 0, 0);
+ } catch (IllegalArgumentException e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void test2() {
+ try {
+ df = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException e) {
+ Assert.fail(e.getMessage());
+ }
+
+ try {
+ XMLGregorianCalendar calendar = df.newXMLGregorianCalendarTime(24, 0, 0, 0);
+ } catch (IllegalArgumentException e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void test3() {
+ try {
+ df = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException e) {
+ Assert.fail(e.getMessage());
+ }
+ try {
+ XMLGregorianCalendar calendar = df.newXMLGregorianCalendar();
+ // Must fail as other params are not 0 but undefined
+ calendar.setHour(24);
+ Assert.fail("test3() - Expected IllegalArgumentException not thrown");
+ } catch (IllegalArgumentException e) {
+ // falls through
+ }
+ }
+
+ @Test
+ public void test4() {
+ try {
+ df = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException e) {
+ Assert.fail(e.getMessage());
+ }
+
+ try {
+ XMLGregorianCalendar calendar = df.newXMLGregorianCalendar();
+ calendar.setTime(24, 0, 0, 0);
+ } catch (IllegalArgumentException e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937951Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937951Test.java
new file mode 100644
index 00000000000..a7335644c61
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937951Test.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6937951
+ * @summary Test midnight is same as the start of the next day in XMLGregorianCalendar.
+ */
+public class Bug6937951Test {
+
+ @Test
+ public void test() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ XMLGregorianCalendar c1 = dtf.newXMLGregorianCalendar("1999-12-31T24:00:00");
+ XMLGregorianCalendar c2 = dtf.newXMLGregorianCalendar("2000-01-01T00:00:00");
+ System.out.println("c1: " + c1.getYear() + "-" + c1.getMonth() + "-" + c1.getDay() + "T" + c1.getHour());
+ System.out.println(c1.equals(c2) ? "pass" : "fail"); // fails
+ if (!c1.equals(c2))
+ Assert.fail("hour 24 needs to be treated as equal to hour 0 of the next day");
+ if (c1.getYear() != 2000 && c1.getHour() != 0)
+ Assert.fail("hour 24 needs to be treated as equal to hour 0 of the next day");
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937964Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937964Test.java
new file mode 100644
index 00000000000..31aff0538f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug6937964Test.java
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import javax.xml.namespace.QName;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6937964
+ * @summary Test Duration is normalized.
+ */
+public class Bug6937964Test {
+ /**
+ * Print debugging to System.err.
+ */
+ private static final boolean DEBUG = false;
+ /**
+ * Constant to indicate expected lexical test failure.
+ */
+ private static final String TEST_VALUE_FAIL = "*FAIL*";
+
+ private static final String FIELD_UNDEFINED = "FIELD_UNDEFINED";
+ static final DatatypeConstants.Field[] fields = { DatatypeConstants.YEARS, DatatypeConstants.MONTHS, DatatypeConstants.DAYS, DatatypeConstants.HOURS,
+ DatatypeConstants.MINUTES, DatatypeConstants.SECONDS };
+
+ @Test
+ public void test() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationYearMonth("P20Y15M");
+ int years = d.getYears();
+ System.out.println(d.getYears() == 21 ? "pass" : "fail");
+ }
+
+ @Test
+ public void testNewDurationYearMonthLexicalRepresentation() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationYearMonth("P20Y15M");
+ int years = d.getYears();
+ Assert.assertTrue(years == 21, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationYearMonthMilliseconds() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationYearMonth(671976000000L);
+ int years = d.getYears();
+ System.out.println("Years: " + years);
+ Assert.assertTrue(years == 21, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationYearMonthBigInteger() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ BigInteger year = new BigInteger("20");
+ BigInteger mon = new BigInteger("15");
+ Duration d = dtf.newDurationYearMonth(true, year, mon);
+ int years = d.getYears();
+ Assert.assertTrue(years == 21, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationYearMonthInt() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationYearMonth(true, 20, 15);
+ int years = d.getYears();
+ Assert.assertTrue(years == 21, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationDayTimeLexicalRepresentation() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationDayTime("P1DT23H59M65S");
+ int days = d.getDays();
+ Assert.assertTrue(days == 2, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationDayTimeMilliseconds() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationDayTime(172805000L);
+ int days = d.getDays();
+ Assert.assertTrue(days == 2, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationDayTimeBigInteger() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ BigInteger day = new BigInteger("1");
+ BigInteger hour = new BigInteger("23");
+ BigInteger min = new BigInteger("59");
+ BigInteger sec = new BigInteger("65");
+ Duration d = dtf.newDurationDayTime(true, day, hour, min, sec);
+ int days = d.getDays();
+ System.out.println("Days: " + days);
+ Assert.assertTrue(days == 2, "Return value should be normalized");
+ }
+
+ @Test
+ public void testNewDurationDayTimeInt() throws DatatypeConfigurationException {
+ DatatypeFactory dtf = DatatypeFactory.newInstance();
+ Duration d = dtf.newDurationDayTime(true, 1, 23, 59, 65);
+ int days = d.getDays();
+ System.out.println("Days: " + days);
+ Assert.assertTrue(days == 2, "Return value should be normalized");
+ }
+
+ @Test
+ public final void testNewDurationYearMonthLexicalRepresentation1() {
+
+ /**
+ * Lexical test values to test.
+ */
+ final String[] TEST_VALUES_LEXICAL = { "P13M", "P1Y1M", "-P13M", "-P1Y1M", "P1Y", "P1Y", "-P1Y", "-P1Y", "P1Y25M", "P3Y1M", "-P1Y25M", "-P3Y1M" };
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES_LEXICAL.length; onTestValue = onTestValue + 2) {
+
+ if (DEBUG) {
+ System.err.println("testing value: \"" + TEST_VALUES_LEXICAL[onTestValue] + "\", expecting: \"" + TEST_VALUES_LEXICAL[onTestValue + 1] + "\"");
+ }
+
+ try {
+ Duration duration = datatypeFactory.newDurationYearMonth(TEST_VALUES_LEXICAL[onTestValue]);
+
+ if (DEBUG) {
+ System.err.println("Duration created: \"" + duration.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + "\"");
+ }
+
+ // right XMLSchemaType?
+ // TODO: enable test, it should pass, it fails with Exception(s)
+ // for now due to a bug
+ try {
+ QName xmlSchemaType = duration.getXMLSchemaType();
+ if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) {
+ Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \""
+ + DatatypeConstants.DURATION_YEARMONTH + "\" and has the value \"" + duration.toString() + "\"");
+ }
+ } catch (IllegalStateException illegalStateException) {
+ // TODO; this test really should pass
+ System.err.println("Please fix this bug that is being ignored, for now: " + illegalStateException.getMessage());
+ }
+
+ // does it have the right value?
+ if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(duration.toString())) {
+ Assert.fail("Duration created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \""
+ + TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + duration.toString() + "\"");
+ }
+
+ // Duration created with correct value
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating duration: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ /**
+ * TCK test failure
+ */
+ @Test
+ public void testNewDurationDayTime005() {
+ BigInteger one = new BigInteger("1");
+ BigInteger zero = new BigInteger("0");
+ BigDecimal bdZero = new BigDecimal("0");
+ BigDecimal bdOne = new BigDecimal("1");
+
+ Object[][] values = {
+ // lex, isPositive, years, month, days, hours, minutes, seconds
+ { "P1D", Boolean.TRUE, null, null, one, zero, zero, bdZero }, { "PT1H", Boolean.TRUE, null, null, zero, one, zero, bdZero },
+ { "PT1M", Boolean.TRUE, null, null, zero, zero, one, bdZero }, { "PT1.1S", Boolean.TRUE, null, null, zero, zero, zero, bdOne },
+ { "-PT1H1.1S", Boolean.FALSE, null, null, zero, one, zero, bdOne }, };
+
+ StringBuffer result = new StringBuffer();
+ DatatypeFactory df = null;
+
+ try {
+ df = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException e) {
+ Assert.fail(e.toString());
+ }
+
+ for (int valueIndex = 0; valueIndex < values.length; ++valueIndex) {
+ Duration duration = null;
+ try {
+ duration = df.newDurationDayTime(values[valueIndex][1].equals(Boolean.TRUE), ((BigInteger) values[valueIndex][4]).intValue(),
+ ((BigInteger) values[valueIndex][5]).intValue(), ((BigInteger) values[valueIndex][6]).intValue(),
+ ((BigDecimal) values[valueIndex][7]).intValue());
+ } catch (IllegalArgumentException e) {
+ result.append("; unexpected " + e + " trying to create duration \'" + values[valueIndex][0] + "\'");
+ }
+ if (duration != null) {
+ if ((duration.getSign() == 1) != values[valueIndex][1].equals(Boolean.TRUE)) {
+ result.append("; " + values[valueIndex][0] + ": wrong sign " + duration.getSign() + ", expected " + values[valueIndex][1]);
+ }
+ for (int i = 0; i < fields.length; ++i) {
+ Number value = duration.getField(fields[i]);
+ if ((value != null && values[valueIndex][2 + i] == null) || (value == null && values[valueIndex][2 + i] != null)
+ || (value != null && !value.equals(values[valueIndex][2 + i]))) {
+ result.append("; " + values[valueIndex][0] + ": wrong value of the field " + fields[i] + ": \'" + value + "\'" + ", expected \'"
+ + values[valueIndex][2 + i] + "\'");
+ }
+ }
+ }
+ }
+
+ if (result.length() > 0) {
+ Assert.fail(result.substring(2));
+ }
+ System.out.println("OK");
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug7042647Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug7042647Test.java
new file mode 100644
index 00000000000..36438265010
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/Bug7042647Test.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 7042647
+ * @summary Test getFirstDayOfWeek is correct after converting XMLGregorianCalendar to a GregorianCalendar.
+ */
+public class Bug7042647Test {
+
+ @Test
+ public void test() throws DatatypeConfigurationException {
+ XMLGregorianCalendar xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(1970, 1, 1, 0, 0, 0, 0, 0);
+ GregorianCalendar calendar = xmlCalendar.toGregorianCalendar();
+ int firstDayOfWeek = calendar.getFirstDayOfWeek();
+ Calendar defaultCalendar = Calendar.getInstance();
+ int defaultFirstDayOfWeek = defaultCalendar.getFirstDayOfWeek();
+ if (firstDayOfWeek != defaultFirstDayOfWeek) {
+ Assert.fail("Failed firstDayOfWeek=" + firstDayOfWeek + " != defaultFirstDayOfWeek=" + defaultFirstDayOfWeek);
+ } else {
+ System.out.println("Success firstDayOfWeek=" + firstDayOfWeek + " == defaultFirstDayOfWeek=" + defaultFirstDayOfWeek);
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DatatypeFactoryTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DatatypeFactoryTest.java
new file mode 100644
index 00000000000..67e458ee719
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DatatypeFactoryTest.java
@@ -0,0 +1,631 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import javax.xml.namespace.QName;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test DatatypeFactory.
+ */
+public class DatatypeFactoryTest {
+
+ private static final boolean DEBUG = false;
+
+ private static final String TEST_VALUE_FAIL = "*FAIL*";
+
+ private static final String FIELD_UNDEFINED = "FIELD_UNDEFINED";
+
+ static int parseInt(String value) {
+ return FIELD_UNDEFINED.equals(value) ? DatatypeConstants.FIELD_UNDEFINED : Integer.parseInt(value);
+ }
+
+ static BigDecimal parseBigDecimal(String value) {
+ return FIELD_UNDEFINED.equals(value) ? null : new BigDecimal(value);
+ }
+
+ static BigInteger parseBigInteger(String value) {
+ return FIELD_UNDEFINED.equals(value) ? null : new BigInteger(value);
+ }
+
+ @Test
+ public final void testNewDurationMilliseconds() {
+
+ /*
+ * to generate millisecond values
+ * final TimeZone GMT = TimeZone.getTimeZone("GMT"); GregorianCalendar
+ * gregorianCalendar = new GregorianCalendar(GMT);
+ * gregorianCalendar.setTimeInMillis(0);
+ * gregorianCalendar.add(Calendar.HOUR_OF_DAY, 1);
+ * gregorianCalendar.add(Calendar.MINUTE, 1);
+ * System.err.println("1 hour, 1 minute = " +
+ * gregorianCalendar.getTimeInMillis() + " milliseconds");
+ */
+
+ /**
+ * Millisecond test values to test.
+ */
+ final long[] TEST_VALUES_MILLISECONDS = { 0L, // 0
+ 1L, // 1 millisecond
+ -1L, 1000L, // 1 second
+ -1000L, 1001L, // 1 second, 1 millisecond
+ -1001L, 60000L, // 1 minute
+ -60000L, 61000L, // 1 minute, 1 second
+ -61000L, 3600000L, // 1 hour
+ -3600000L, 3660000L, // 1 hour, 1 minute
+ -3660000L, 86400000L, // 1 day
+ -86400000L, 90000000L, // 1 day, 1 hour
+ -90000000L, 2678400000L, // 1 month
+ -2678400000L, 2764800000L, // 1 month, 1 day
+ -2764800000L, 31536000000L, // 1 year
+ -31536000000L, 34214400000L, // 1 year, 1 month
+ -34214400000L };
+
+ /**
+ * Millisecond test value results of test.
+ */
+ final String[] TEST_VALUES_MILLISECONDS_RESULTS = { "P0Y0M0DT0H0M0.000S", // 0
+ "P0Y0M0DT0H0M0.001S", // 1 millisecond
+ "-P0Y0M0DT0H0M0.001S", "P0Y0M0DT0H0M1.000S", // 1 second
+ "-P0Y0M0DT0H0M1.000S", "P0Y0M0DT0H0M1.001S", // 1 second, 1
+ // millisecond
+ "-P0Y0M0DT0H0M1.001S", "P0Y0M0DT0H1M0.000S", // 1 minute
+ "-P0Y0M0DT0H1M0.000S", "P0Y0M0DT0H1M1.000S", // 1 minute, 1
+ // second
+ "-P0Y0M0DT0H1M1.000S", "P0Y0M0DT1H0M0.000S", // 1 hour
+ "-P0Y0M0DT1H0M0.000S", "P0Y0M0DT1H1M0.000S", // 1 hour, 1 minute
+ "-P0Y0M0DT1H1M0.000S", "P0Y0M1DT0H0M0.000S", // 1 day
+ "-P0Y0M1DT0H0M0.000S", "P0Y0M1DT1H0M0.000S", // 1 day, 1 hour
+ "-P0Y0M1DT1H0M0.000S", "P0Y1M0DT0H0M0.000S", // 1 month
+ "-P0Y1M0DT0H0M0.000S", "P0Y1M1DT0H0M0.000S", // 1 month, 1 day
+ "-P0Y1M1DT0H0M0.000S", "P1Y0M0DT0H0M0.000S", // 1 year
+ "-P1Y0M0DT0H0M0.000S", "P1Y1M0DT0H0M0.000S", // 1 year, 1 month
+ "-P1Y1M0DT0H0M0.000S" };
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES_MILLISECONDS.length; onTestValue++) {
+
+ if (DEBUG) {
+ System.err.println("testing value: \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\", expecting: \""
+ + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\"");
+ }
+
+ try {
+ Duration duration = datatypeFactory.newDuration(TEST_VALUES_MILLISECONDS[onTestValue]);
+
+ if (DEBUG) {
+ System.err.println("Duration created: \"" + duration.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString()
+ + "\"");
+ }
+
+ // right XMLSchemaType?
+ QName xmlSchemaType = duration.getXMLSchemaType();
+ if (!xmlSchemaType.equals(DatatypeConstants.DURATION)) {
+ Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \"" + DatatypeConstants.DURATION
+ + "\" and has the value \"" + duration.toString() + "\"");
+ }
+
+ // does it have the right value?
+ if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(duration.toString())) {
+ Assert.fail("Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" was expected to be \""
+ + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + "\"");
+ }
+
+ // Duration created with correct value
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating duration: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ /**
+ * Test {@link DatatypeFactory.newDurationYearMonth(String
+ * lexicalRepresentation)}.
+ */
+ @Test
+ public final void testNewDurationYearMonthLexicalRepresentation() {
+
+ /**
+ * Lexical test values to test.
+ */
+ final String[] TEST_VALUES_LEXICAL = { null, TEST_VALUE_FAIL, "", TEST_VALUE_FAIL, "-", TEST_VALUE_FAIL, "P", TEST_VALUE_FAIL, "-P", TEST_VALUE_FAIL,
+ "P1D", TEST_VALUE_FAIL, "P1Y1M1D", TEST_VALUE_FAIL, "P1M", "P1M", "-P1M", "-P1M", "P1Y", "P1Y", "-P1Y", "-P1Y", "P1Y1M", "P1Y1M", "-P1Y1M",
+ "-P1Y1M" };
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES_LEXICAL.length; onTestValue = onTestValue + 2) {
+
+ if (DEBUG) {
+ System.err.println("testing value: \"" + TEST_VALUES_LEXICAL[onTestValue] + "\", expecting: \"" + TEST_VALUES_LEXICAL[onTestValue + 1] + "\"");
+ }
+
+ try {
+ Duration duration = datatypeFactory.newDurationYearMonth(TEST_VALUES_LEXICAL[onTestValue]);
+
+ if (DEBUG) {
+ System.err.println("Duration created: \"" + duration.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString() + "\"");
+ }
+
+ // right XMLSchemaType?
+ // TODO: enable test, it should pass, it fails with Exception(s)
+ // for now due to a bug
+ try {
+ QName xmlSchemaType = duration.getXMLSchemaType();
+ if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) {
+ Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \""
+ + DatatypeConstants.DURATION_YEARMONTH + "\" and has the value \"" + duration.toString() + "\"");
+ }
+ } catch (IllegalStateException illegalStateException) {
+ // TODO; this test really should pass
+ System.err.println("Please fix this bug that is being ignored, for now: " + illegalStateException.getMessage());
+ }
+
+ // does it have the right value?
+ if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(duration.toString())) {
+ Assert.fail("Duration created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \""
+ + TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + duration.toString() + "\"");
+ }
+
+ // Duration created with correct value
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating duration: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ /**
+ * Test {@link DatatypeFactory.newDurationYearMonth(long milliseconds)}.
+ *
+ */
+ @Test
+ public final void testNewDurationYearMonthMilliseconds() {
+
+ /**
+ * Millisecond test values to test.
+ */
+ final long[] TEST_VALUES_MILLISECONDS = { 0L, 1L, -1L, 2678400000L, // 31
+ // days,
+ // e.g.
+ // 1
+ // month
+ -2678400000L, 5270400000L, // 61 days, e.g. 2 months
+ -5270400000L, 31622400000L, // 366 days, e.g. 1 year
+ -31622400000L, 34300800000L, // 397 days, e.g. 1 year, 1 month
+ -34300800000L };
+
+ /**
+ * Millisecond test value results of test.
+ */
+ final String[] TEST_VALUES_MILLISECONDS_RESULTS = { "P0Y0M", "P0Y0M", "P0Y0M", "P0Y1M", "-P0Y1M", "P0Y2M", "-P0Y2M", "P1Y0M", "-P1Y0M", "P1Y1M",
+ "-P1Y1M" };
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES_MILLISECONDS.length; onTestValue++) {
+
+ if (DEBUG) {
+ System.err.println("testing value: \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\", expecting: \""
+ + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\"");
+ }
+
+ try {
+ Duration duration = datatypeFactory.newDurationYearMonth(TEST_VALUES_MILLISECONDS[onTestValue]);
+
+ if (DEBUG) {
+ System.err.println("Duration created: \"" + duration.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString()
+ + "\"");
+ }
+
+ // right XMLSchemaType?
+ QName xmlSchemaType = duration.getXMLSchemaType();
+ if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) {
+ Assert.fail("Duration created with XMLSchemaType of\"" + xmlSchemaType + "\" was expected to be \"" + DatatypeConstants.DURATION_YEARMONTH
+ + "\" and has the value \"" + duration.toString() + "\"");
+ }
+
+ // does it have the right value?
+ if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(duration.toString())) {
+ Assert.fail("Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" was expected to be \""
+ + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + "\"");
+ }
+
+ // only YEAR & MONTH should have values
+ int days = duration.getDays();
+ int hours = duration.getHours();
+ int minutes = duration.getMinutes();
+ if (days != 0 || hours != 0 || minutes != 0) {
+ Assert.fail("xdt:yearMonthDuration created without discarding remaining milliseconds: " + " days = " + days + ", hours = " + hours
+ + ", minutess = " + minutes);
+ }
+
+ // Duration created with correct values
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating duration: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ /**
+ * Test {@link DatatypeFactory.newDurationDayTime(long milliseconds)}.
+ */
+ @Test
+ public final void testNewDurationDayTime() {
+
+ /**
+ * Millisecond test values to test.
+ */
+ final long[] TEST_VALUES_MILLISECONDS = { 0L, 1L, -1L, 2678400000L, // 31
+ // days,
+ // e.g.
+ // 1
+ // month
+ -2678400000L, 5270400000L, // 61 days, e.g. 2 months
+ -5270400000L, 31622400000L, // 366 days, e.g. 1 year
+ -31622400000L, 34300800000L, // 397 days, e.g. 1 year, 1 month
+ -34300800000L };
+
+ /**
+ * Millisecond test value results of test.
+ */
+ final String[] TEST_VALUES_MILLISECONDS_RESULTS = { "P0Y0M0DT0H0M0.000S", "P0Y0M0DT0H0M0.001S", "-P0Y0M0DT0H0M0.001S", "P0Y1M", "-P0Y1M", "P0Y2M",
+ "-P0Y2M", "P1Y0M", "-P1Y0M", "P1Y1M", "-P1Y1M" };
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES_MILLISECONDS.length; onTestValue++) {
+
+ if (DEBUG) {
+ System.err.println("testing value: \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\", expecting: \""
+ + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\"");
+ }
+
+ try {
+ Duration duration = datatypeFactory.newDurationDayTime(TEST_VALUES_MILLISECONDS[onTestValue]);
+
+ if (DEBUG) {
+ System.err.println("Duration created: \"" + duration.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is invalid yet it created the Duration \"" + duration.toString()
+ + "\"");
+ }
+
+ // does it have the right value?
+ if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(duration.toString())) {
+ // TODO: this is bug that should be fixed
+ if (false) {
+ Assert.fail("Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" was expected to be \""
+ + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString() + "\"");
+ } else {
+ System.err.println("Please fix this bug: " + "Duration created with \"" + TEST_VALUES_MILLISECONDS[onTestValue]
+ + "\" was expected to be \"" + TEST_VALUES_MILLISECONDS_RESULTS[onTestValue] + "\" and has the value \"" + duration.toString()
+ + "\"");
+ }
+ }
+
+ // only day, hour, minute, and second should have values
+ QName xmlSchemaType = duration.getXMLSchemaType();
+ int years = duration.getYears();
+ int months = duration.getMonths();
+
+ if (!xmlSchemaType.equals(DatatypeConstants.DURATION_DAYTIME) || years != 0 || months != 0) {
+ // TODO: this is bug that should be fixed
+ if (false) {
+ Assert.fail("xdt:dayTimeDuration created without discarding remaining milliseconds: " + " XMLSchemaType = " + xmlSchemaType
+ + ", years = " + years + ", months = " + months);
+ } else {
+ System.err.println("Please fix this bug: " + "xdt:dayTimeDuration created without discarding remaining milliseconds: "
+ + " XMLSchemaType = " + xmlSchemaType + ", years = " + years + ", months = " + months);
+ }
+ }
+
+ // Duration created with correct values
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating duration: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (!TEST_VALUES_MILLISECONDS_RESULTS[onTestValue].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_MILLISECONDS[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ /**
+ * Test {@link DatatypeFactory.newXMLGregorianCalendar(String
+ * lexicalRepresentation)}.
+ */
+ @Test
+ public final void testNewXMLGregorianCalendarLexicalRepresentation() {
+
+ /**
+ * Lexical test values to test.
+ */
+ final String[] TEST_VALUES_LEXICAL = { null, TEST_VALUE_FAIL, "", TEST_VALUE_FAIL, "---01", "---01", // gDay
+ "---01Z", "---01Z", // gDay, UTC
+ "---01-08:00", "---01-08:00", // gDay, PDT
+ "--01--", TEST_VALUE_FAIL, // gMonth pre errata, --MM--(z?)
+ "--01", "--01", // gMonth
+ "--01Z", "--01Z", // gMonth, UTC
+ "--01-08:00", "--01-08:00", // gMonth, PDT
+ "--01-01", "--01-01", // gMonthDay
+ "--01-01Z", "--01-01Z", // gMonthDay, UTC
+ "--01-01-08:00", "--01-01-08:00" // gMonthDay, PDT
+ };
+
+ // get a DatatypeFactory
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES_LEXICAL.length; onTestValue = onTestValue + 2) {
+
+ if (DEBUG) {
+ System.err.println("testing value: \"" + TEST_VALUES_LEXICAL[onTestValue] + "\", expecting: \"" + TEST_VALUES_LEXICAL[onTestValue + 1] + "\"");
+ }
+
+ try {
+ XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(TEST_VALUES_LEXICAL[onTestValue]);
+
+ if (DEBUG) {
+ System.err.println("XMLGregorianCalendar created: \"" + xmlGregorianCalendar.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is invalid yet it created the XMLGregorianCalendar \""
+ + xmlGregorianCalendar.toString() + "\"");
+ }
+
+ // does it have the right value?
+ if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(xmlGregorianCalendar.toString())) {
+ Assert.fail("XMLGregorianCalendar created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \""
+ + TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + xmlGregorianCalendar.toString() + "\"");
+ }
+
+ // XMLGregorianCalendar created with correct value
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating XMLGregorianCalendar: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(TEST_VALUE_FAIL)) {
+ Assert.fail("the value \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" is valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ /**
+ * Test {@link DatatypeFactory.newXMLGregorianCalendar( BigInteger year, int
+ * month, int day, int hour, int minute, int second, BigDecimal
+ * fractionalSecond, int timezone)} and
+ * DatatypeFactory.newXMLGregorianCalendar( int year, int month, int day,
+ * int hour, int minute, int second, int fractionalSecond, int timezone)} .
+ */
+ @Test
+ public final void testNewXMLGregorianCalendarYearMonthDayHourMinuteSecondFractionalSecondTimezone() {
+
+ final String[][] invalidDates = {
+ { "1970", "-1", "1", "0", "0", "0", "0", "0" },
+ { "1970", "0", "1", "0", "0", "0", "0", "0" },
+ { "1970", "13", "1", "0", "0", "0", "0", "0" },
+ { "1970", "1", "-1", "0", "0", "0", "0", "0" },
+ { "1970", "1", "0", "0", "0", "0", "0", "0" },
+ { "1970", "1", "32", "0", "0", "0", "0", "0" },
+ { "1970", "1", "1", "-1", "0", "0", "0", "0" },
+ // valid per Schema Errata:
+ // http://www.w3.org/2001/05/xmlschema-errata#e2-45
+ // {"1970", "1", "1", "24", "0", "0", "0", "0" }
+ // put in a repeat value to preserve offsets & TCK tests
+ { "1970", "1", "1", "0", "-1", "0", "0", "0" }, { "1970", "1", "1", "0", "-1", "0", "0", "0" }, { "1970", "1", "1", "0", "60", "0", "0", "0" },
+ { "1970", "1", "1", "0", "0", "-1", "0", "0" }, { "1970", "1", "1", "0", "0", "61", "0", "0" },
+ { "1970", "1", "1", "0", "0", "0", "-0.000001", "0" }, { "1970", "1", "1", "0", "0", "0", "1.0001", "0" },
+ { "1970", "1", "1", "0", "0", "0", "0", "841" }, { "1970", "1", "1", "0", "0", "0", "0", "-841" }, };
+
+ // get a DatatypeFactory
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // test values, expect failure
+ for (int valueIndex = 0; valueIndex < invalidDates.length; ++valueIndex) {
+
+ try {
+
+ if (DEBUG) {
+ System.err.println("testing DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", " + invalidDates[valueIndex][1]
+ + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", " + invalidDates[valueIndex][4] + ", "
+ + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", " + invalidDates[valueIndex][7] + ")");
+ }
+
+ XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(parseBigInteger(invalidDates[valueIndex][0]),
+ parseInt(invalidDates[valueIndex][1]), parseInt(invalidDates[valueIndex][2]), parseInt(invalidDates[valueIndex][3]),
+ parseInt(invalidDates[valueIndex][4]), parseInt(invalidDates[valueIndex][5]), parseBigDecimal(invalidDates[valueIndex][6]),
+ parseInt(invalidDates[valueIndex][7]));
+
+ if (DEBUG) {
+ System.err.println("created XMLGregorianCalendar: " + xmlGregorianCalendar.toString());
+ }
+
+ // unexpected success, should have failed
+ Assert.fail("expected IllegalArgumentException " + "for DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", "
+ + invalidDates[valueIndex][1] + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", "
+ + invalidDates[valueIndex][4] + ", " + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", "
+ + invalidDates[valueIndex][7] + "). " + "Instead, XMLGregorianCalendar: \"" + xmlGregorianCalendar.toString() + "\" was created.");
+ } catch (IllegalArgumentException illegalArgumentException) {
+ // expected failure
+ if (DEBUG) {
+ System.err.println("Exception creating XMLGregorianCalendar: " + illegalArgumentException.toString());
+ }
+ }
+ }
+
+ // test with all ints
+ int[] testIndex = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, };
+ for (int i = 0; i < testIndex.length; ++i) {
+ int valueIndex = testIndex[i];
+ try {
+ if (DEBUG) {
+ System.err.println("testing DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", " + invalidDates[valueIndex][1]
+ + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", " + invalidDates[valueIndex][4] + ", "
+ + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", " + invalidDates[valueIndex][7] + ")");
+ }
+
+ XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar(parseInt(invalidDates[valueIndex][0]),
+ parseInt(invalidDates[valueIndex][1]), parseInt(invalidDates[valueIndex][2]), parseInt(invalidDates[valueIndex][3]),
+ parseInt(invalidDates[valueIndex][4]), parseInt(invalidDates[valueIndex][5]), parseInt(invalidDates[valueIndex][6]),
+ parseInt(invalidDates[valueIndex][7]));
+
+ if (DEBUG) {
+ System.err.println("created XMLGregorianCalendar: " + xmlGregorianCalendar.toString());
+ }
+
+ // unexpected success, should have failed
+ Assert.fail("expected IllegalArgumentException " + "for DatatypeFactory.newXMLGregorianCalendar(" + invalidDates[valueIndex][0] + ", "
+ + invalidDates[valueIndex][1] + ", " + invalidDates[valueIndex][2] + ", " + invalidDates[valueIndex][3] + ", "
+ + invalidDates[valueIndex][4] + ", " + invalidDates[valueIndex][5] + ", " + invalidDates[valueIndex][6] + ", "
+ + invalidDates[valueIndex][7] + "). " + "Instead, XMLGregorianCalendar: \"" + xmlGregorianCalendar.toString() + "\" was created.");
+ } catch (IllegalArgumentException illegalArgumentException) {
+ // expected failure
+ if (DEBUG) {
+ System.err.println("Exception creating XMLGregorianCalendar: " + illegalArgumentException.toString());
+ }
+ }
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DurationTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DurationTest.java
new file mode 100644
index 00000000000..f97536c8765
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/DurationTest.java
@@ -0,0 +1,476 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+import javax.xml.namespace.QName;
+
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test Duration.
+ */
+public class DurationTest {
+
+ private final static boolean DEBUG = true;
+
+ protected Duration duration = null;
+
+ @BeforeMethod
+ protected void setUp() {
+ try {
+ duration = DatatypeFactory.newInstance().newDuration(100);
+ } catch (DatatypeConfigurationException dce) {
+ dce.printStackTrace();
+ Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
+ }
+ }
+
+ @Test
+ public void testDurationSubtract() {
+ try {
+ Duration bigDur = DatatypeFactory.newInstance().newDuration(20000);
+ Duration smallDur = DatatypeFactory.newInstance().newDuration(10000);
+ if (smallDur.subtract(bigDur).getSign() != -1) {
+ Assert.fail("smallDur.subtract(bigDur).getSign() is not -1");
+ }
+ if (bigDur.subtract(smallDur).getSign() != 1) {
+ Assert.fail("bigDur.subtract(smallDur).getSign() is not 1");
+ }
+ if (smallDur.subtract(smallDur).getSign() != 0) {
+ Assert.fail("smallDur.subtract(smallDur).getSign() is not 0");
+ }
+ } catch (DatatypeConfigurationException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testDurationMultiply() {
+ int num = 5000; // millisends. 5 seconds
+ int factor = 2;
+ try {
+ Duration dur = DatatypeFactory.newInstance().newDuration(num);
+ if (dur.multiply(factor).getSeconds() != 10) {
+ Assert.fail("duration.multiply() return wrong value");
+ }
+ // factor is 2*10^(-1)
+ if (dur.multiply(new BigDecimal(new BigInteger("2"), 1)).getSeconds() != 1) {
+ Assert.fail("duration.multiply() return wrong value");
+ }
+ if (dur.subtract(DatatypeFactory.newInstance().newDuration(1000)).multiply(new BigDecimal(new BigInteger("2"), 1)).getSeconds() != 0) {
+ Assert.fail("duration.multiply() return wrong value");
+ }
+ } catch (DatatypeConfigurationException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testDurationAndCalendar1() {
+ int year = 1;
+ int month = 2;
+ int day = 3;
+ int hour = 4;
+ int min = 5;
+ int sec = 6;
+ String lexicalRepresentation = "P" + year + "Y" + month + "M" + day + "DT" + hour + "H" + min + "M" + sec + "S";
+ try {
+ Duration dur = DatatypeFactory.newInstance().newDuration(lexicalRepresentation);
+ System.out.println(dur.toString());
+ AssertJUnit.assertTrue("year should be 1", dur.getYears() == year);
+ AssertJUnit.assertTrue("month should be 2", dur.getMonths() == month);
+ AssertJUnit.assertTrue("day should be 3", dur.getDays() == day);
+ AssertJUnit.assertTrue("hour should be 4", dur.getHours() == hour);
+ AssertJUnit.assertTrue("minute should be 5", dur.getMinutes() == min);
+ AssertJUnit.assertTrue("second should be 6", dur.getSeconds() == sec);
+ } catch (DatatypeConfigurationException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testDurationAndCalendar2() {
+ try {
+ AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("PT10.00099S")
+ .getTimeInMillis(new Date()) == 10000);
+ AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("-PT10.00099S")
+ .getTimeInMillis(new Date()) == -10000);
+ AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("PT10.00099S")
+ .getTimeInMillis(new GregorianCalendar()) == 10000);
+ AssertJUnit.assertTrue("10.00099S means 10 sec since it will be rounded to zero", DatatypeFactory.newInstance().newDuration("-PT10.00099S")
+ .getTimeInMillis(new GregorianCalendar()) == -10000);
+ } catch (DatatypeConfigurationException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testDurationAndCalendar3() {
+ try {
+ Calendar cal = new GregorianCalendar();
+ cal.set(Calendar.SECOND, 59);
+ DatatypeFactory.newInstance().newDuration(10000).addTo(cal);
+ AssertJUnit.assertTrue("sec will be 9", cal.get(Calendar.SECOND) == 9);
+
+ Date date = new Date();
+ date.setSeconds(59);
+ DatatypeFactory.newInstance().newDuration(10000).addTo(date);
+ AssertJUnit.assertTrue("sec will be 9", date.getSeconds() == 9);
+ } catch (DatatypeConfigurationException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testEqualsWithDifferentObjectParam() {
+
+ AssertJUnit.assertFalse("equals method should return false for any object other than Duration", duration.equals(new Integer(0)));
+ }
+
+ @Test
+ public void testEqualsWithNullObjectParam() {
+
+ AssertJUnit.assertFalse("equals method should return false for null parameter", duration.equals(null));
+ }
+
+ @Test
+ public void testEqualsWithEqualObjectParam() {
+ try {
+ AssertJUnit.assertTrue("equals method is expected to return true", duration.equals(DatatypeFactory.newInstance().newDuration(100)));
+ } catch (DatatypeConfigurationException dce) {
+ dce.printStackTrace();
+ Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
+ }
+ }
+
+ /**
+ * Inspired by CR 5077522 Duration.compare makes mistakes for some values.
+ */
+ @Test
+ public void testCompareWithInderterminateRelation() {
+
+ final String[][] partialOrder = { // partialOrder
+ { "P1Y", "<>", "P365D" }, { "P1Y", "<>", "P366D" }, { "P1M", "<>", "P28D" }, { "P1M", "<>", "P29D" }, { "P1M", "<>", "P30D" }, { "P1M", "<>", "P31D" },
+ { "P5M", "<>", "P150D" }, { "P5M", "<>", "P151D" }, { "P5M", "<>", "P152D" }, { "P5M", "<>", "P153D" }, { "PT2419200S", "<>", "P1M" },
+ { "PT2678400S", "<>", "P1M" }, { "PT31536000S", "<>", "P1Y" }, { "PT31622400S", "<>", "P1Y" }, { "PT525600M", "<>", "P1Y" },
+ { "PT527040M", "<>", "P1Y" }, { "PT8760H", "<>", "P1Y" }, { "PT8784H", "<>", "P1Y" }, { "P365D", "<>", "P1Y" }, };
+
+ DatatypeFactory df = null;
+ try {
+ df = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+
+ boolean compareErrors = false;
+
+ for (int valueIndex = 0; valueIndex < partialOrder.length; ++valueIndex) {
+ Duration duration1 = df.newDuration(partialOrder[valueIndex][0]);
+ Duration duration2 = df.newDuration(partialOrder[valueIndex][2]);
+ int cmp = duration1.compare(duration2);
+ int expected = ">".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.GREATER
+ : "<".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.LESSER : "==".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.EQUAL
+ : DatatypeConstants.INDETERMINATE;
+
+ // just note any errors, do not fail until all cases have been
+ // tested
+ if (expected != cmp) {
+ compareErrors = true;
+ System.err.println("returned " + cmp2str(cmp) + " for durations \'" + duration1 + "\' and " + duration2 + "\', but expected "
+ + cmp2str(expected));
+ }
+ }
+
+ if (compareErrors) {
+ // TODO; fix bug, these tests should pass
+ if (false) {
+ Assert.fail("Errors in comparing indeterminate relations, see Stderr");
+ } else {
+ System.err.println("Please fix this bug: " + "Errors in comparing indeterminate relations, see Stderr");
+ }
+ }
+ }
+
+ public static String cmp2str(int cmp) {
+ return cmp == DatatypeConstants.LESSER ? "LESSER" : cmp == DatatypeConstants.GREATER ? "GREATER" : cmp == DatatypeConstants.EQUAL ? "EQUAL"
+ : cmp == DatatypeConstants.INDETERMINATE ? "INDETERMINATE" : "UNDEFINED";
+ }
+
+ /**
+ * Inspired by CR 6238220 javax.xml.datatype.Duration has no clear
+ * description concerning return values range.
+ */
+ @Test
+ public void testNormalizedReturnValues() throws Exception {
+
+ final Object[] TEST_VALUES = {
+ // test 61 seconds -> 1 minute, 1 second
+ true, // isPositive,
+ BigInteger.ZERO, // years,
+ BigInteger.ZERO, // months
+ BigInteger.ZERO, // days
+ BigInteger.ZERO, // hours
+ BigInteger.ZERO, // minutes
+ new BigDecimal(61), // seconds
+ 61000L, // durationInMilliSeconds,
+ "P0Y0M0DT0H0M61S", // lexicalRepresentation
+
+ // test - 61 seconds -> - 1 minute, 1 second
+ false, // isPositive,
+ BigInteger.ZERO, // years,
+ BigInteger.ZERO, // months
+ BigInteger.ZERO, // days
+ BigInteger.ZERO, // hours
+ BigInteger.ZERO, // minutes
+ new BigDecimal(61), // seconds
+ 61000L, // durationInMilliSeconds,
+ "-P0Y0M0DT0H0M61S", // lexicalRepresentation
+ };
+
+ final Object[] NORM_VALUES = {
+ // test 61 seconds -> 1 minute, 1 second
+ true, // normalized isPositive,
+ BigInteger.ZERO, // normalized years,
+ BigInteger.ZERO, // normalized months
+ BigInteger.ZERO, // normalized days
+ BigInteger.ZERO, // normalized hours
+ BigInteger.ONE, // normalized minutes
+ BigDecimal.ONE, // normalized seconds
+ 61000L, // normalized durationInMilliSeconds,
+ "P0Y0M0DT0H1M1.000S", // normalized lexicalRepresentation
+
+ // test - 61 seconds -> - 1 minute, 1 second
+ false, // normalized isPositive,
+ BigInteger.ZERO, // normalized years,
+ BigInteger.ZERO, // normalized months
+ BigInteger.ZERO, // normalized days
+ BigInteger.ZERO, // normalized hours
+ BigInteger.ONE, // normalized minutes
+ BigDecimal.ONE, // normalized seconds
+ 61000L, // normalized durationInMilliSeconds,
+ "-P0Y0M0DT0H1M1.000S" // normalized lexicalRepresentation
+ };
+
+ for (int onValue = 0; onValue < TEST_VALUES.length; onValue += 9) {
+ newDurationTester(((Boolean) TEST_VALUES[onValue]).booleanValue(), // isPositive,
+ ((Boolean) NORM_VALUES[onValue]).booleanValue(), // normalized
+ // isPositive,
+ (BigInteger) TEST_VALUES[onValue + 1], // years,
+ (BigInteger) NORM_VALUES[onValue + 1], // normalized years,
+ (BigInteger) TEST_VALUES[onValue + 2], // months
+ (BigInteger) NORM_VALUES[onValue + 2], // normalized months
+ (BigInteger) TEST_VALUES[onValue + 3], // days
+ (BigInteger) NORM_VALUES[onValue + 3], // normalized days
+ (BigInteger) TEST_VALUES[onValue + 4], // hours
+ (BigInteger) NORM_VALUES[onValue + 4], // normalized hours
+ (BigInteger) TEST_VALUES[onValue + 5], // minutes
+ (BigInteger) NORM_VALUES[onValue + 5], // normalized minutes
+ (BigDecimal) TEST_VALUES[onValue + 6], // seconds
+ (BigDecimal) NORM_VALUES[onValue + 6], // normalized seconds
+ ((Long) TEST_VALUES[onValue + 7]).longValue(), // durationInMilliSeconds,
+ ((Long) NORM_VALUES[onValue + 7]).longValue(), // normalized
+ // durationInMilliSeconds,
+ (String) TEST_VALUES[onValue + 8], // lexicalRepresentation
+ (String) NORM_VALUES[onValue + 8]); // normalized
+ // lexicalRepresentation
+
+ newDurationDayTimeTester(((Boolean) TEST_VALUES[onValue]).booleanValue(), // isPositive,
+ ((Boolean) NORM_VALUES[onValue]).booleanValue(), // normalized
+ // isPositive,
+ BigInteger.ZERO, // years,
+ BigInteger.ZERO, // normalized years,
+ BigInteger.ZERO, // months
+ BigInteger.ZERO, // normalized months
+ (BigInteger) TEST_VALUES[onValue + 3], // days
+ (BigInteger) NORM_VALUES[onValue + 3], // normalized days
+ (BigInteger) TEST_VALUES[onValue + 4], // hours
+ (BigInteger) NORM_VALUES[onValue + 4], // normalized hours
+ (BigInteger) TEST_VALUES[onValue + 5], // minutes
+ (BigInteger) NORM_VALUES[onValue + 5], // normalized minutes
+ (BigDecimal) TEST_VALUES[onValue + 6], // seconds
+ (BigDecimal) NORM_VALUES[onValue + 6], // normalized seconds
+ ((Long) TEST_VALUES[onValue + 7]).longValue(), // durationInMilliSeconds,
+ ((Long) NORM_VALUES[onValue + 7]).longValue(), // normalized
+ // durationInMilliSeconds,
+ (String) TEST_VALUES[onValue + 8], // lexicalRepresentation
+ (String) NORM_VALUES[onValue + 8]); // normalized
+ // lexicalRepresentation
+ }
+ }
+
+ private void newDurationTester(boolean isPositive, boolean normalizedIsPositive, BigInteger years, BigInteger normalizedYears, BigInteger months,
+ BigInteger normalizedMonths, BigInteger days, BigInteger normalizedDays, BigInteger hours, BigInteger normalizedHours, BigInteger minutes,
+ BigInteger normalizedMinutes, BigDecimal seconds, BigDecimal normalizedSeconds, long durationInMilliSeconds, long normalizedDurationInMilliSeconds,
+ String lexicalRepresentation, String normalizedLexicalRepresentation) {
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+
+ // create 4 Durations using the 4 different constructors
+
+ Duration durationBigInteger = datatypeFactory.newDuration(isPositive, years, months, days, hours, minutes, seconds);
+ durationAssertEquals(durationBigInteger, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(),
+ normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(),
+ normalizedDurationInMilliSeconds, normalizedLexicalRepresentation);
+
+ Duration durationInt = datatypeFactory.newDuration(isPositive, years.intValue(), months.intValue(), days.intValue(), hours.intValue(),
+ minutes.intValue(), seconds.intValue());
+ durationAssertEquals(durationInt, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(),
+ normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(),
+ normalizedDurationInMilliSeconds, normalizedLexicalRepresentation);
+
+ Duration durationMilliseconds = datatypeFactory.newDuration(durationInMilliSeconds);
+ durationAssertEquals(durationMilliseconds, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(),
+ normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(),
+ normalizedDurationInMilliSeconds, normalizedLexicalRepresentation);
+
+ Duration durationLexical = datatypeFactory.newDuration(lexicalRepresentation);
+ durationAssertEquals(durationLexical, DatatypeConstants.DURATION, normalizedIsPositive, normalizedYears.intValue(), normalizedMonths.intValue(),
+ normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(),
+ normalizedDurationInMilliSeconds, normalizedLexicalRepresentation);
+ }
+
+ private void newDurationDayTimeTester(boolean isPositive, boolean normalizedIsPositive, BigInteger years, BigInteger normalizedYears, BigInteger months,
+ BigInteger normalizedMonths, BigInteger days, BigInteger normalizedDays, BigInteger hours, BigInteger normalizedHours, BigInteger minutes,
+ BigInteger normalizedMinutes, BigDecimal seconds, BigDecimal normalizedSeconds, long durationInMilliSeconds, long normalizedDurationInMilliSeconds,
+ String lexicalRepresentation, String normalizedLexicalRepresentation) {
+
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+
+ // create 4 dayTime Durations using the 4 different constructors
+
+ Duration durationDayTimeBigInteger = datatypeFactory.newDurationDayTime(isPositive, days, hours, minutes, seconds.toBigInteger());
+ durationAssertEquals(durationDayTimeBigInteger, DatatypeConstants.DURATION_DAYTIME, normalizedIsPositive, normalizedYears.intValue(),
+ normalizedMonths.intValue(), normalizedDays.intValue(), normalizedHours.intValue(), normalizedMinutes.intValue(), normalizedSeconds.intValue(),
+ normalizedDurationInMilliSeconds, normalizedLexicalRepresentation);
+
+ /*
+ * Duration durationDayTimeInt = datatypeFactory.newDurationDayTime(
+ * isPositive, days.intValue(), hours.intValue(), minutes.intValue(),
+ * seconds.intValue()); Duration durationDayTimeMilliseconds =
+ * datatypeFactory.newDurationDayTime( durationInMilliSeconds); Duration
+ * durationDayTimeLexical = datatypeFactory.newDurationDayTime(
+ * lexicalRepresentation);
+ * Duration durationYearMonthBigInteger =
+ * datatypeFactory.newDurationYearMonth( isPositive, years, months);
+ * Duration durationYearMonthInt = datatypeFactory.newDurationYearMonth(
+ * isPositive, years.intValue(), months.intValue()); Duration
+ * durationYearMonthMilliseconds = datatypeFactory.newDurationYearMonth(
+ * durationInMilliSeconds); Duration durationYearMonthLexical =
+ * datatypeFactory.newDurationYearMonth( lexicalRepresentation) ;
+ */
+
+ }
+
+ private void durationAssertEquals(Duration duration, QName xmlSchemaType, boolean isPositive, int years, int months, int days, int hours, int minutes,
+ int seconds, long milliseconds, String lexical) {
+
+ final TimeZone GMT = TimeZone.getTimeZone("GMT");
+ final GregorianCalendar EPOCH = new GregorianCalendar(GMT);
+ EPOCH.clear();
+
+ if (DEBUG) {
+ System.out.println("Testing Duration: " + duration.toString());
+ }
+
+ // sign
+ if (DEBUG) {
+ boolean actual = (duration.getSign() == 1) ? true : false;
+ System.out.println("sign:");
+ System.out.println(" expected: \"" + isPositive + "\"");
+ System.out.println(" actual: \"" + actual + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("years:");
+ System.out.println(" expected: \"" + years + "\"");
+ System.out.println(" actual: \"" + duration.getYears() + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("months:");
+ System.out.println(" expected: \"" + months + "\"");
+ System.out.println(" actual: \"" + duration.getMonths() + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("days:");
+ System.out.println(" expected: \"" + days + "\"");
+ System.out.println(" actual: \"" + duration.getDays() + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("hours:");
+ System.out.println(" expected: \"" + hours + "\"");
+ System.out.println(" actual: \"" + duration.getHours() + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("minutes:");
+ System.out.println(" expected: \"" + minutes + "\"");
+ System.out.println(" actual: \"" + duration.getMinutes() + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("seconds:");
+ System.out.println(" expected: \"" + seconds + "\"");
+ System.out.println(" actual: \"" + duration.getSeconds() + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("milliseconds:");
+ System.out.println(" expected: \"" + milliseconds + "\"");
+ System.out.println(" actual: \"" + duration.getTimeInMillis(EPOCH) + "\"");
+ }
+
+ if (DEBUG) {
+ System.out.println("lexical:");
+ System.out.println(" expected: \"" + lexical + "\"");
+ System.out.println(" actual: \"" + duration.toString() + "\"");
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/FactoryFindTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/FactoryFindTest.java
new file mode 100644
index 00000000000..e9e84bd61a3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/FactoryFindTest.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test Classloader for DatatypeFactory.
+ */
+public class FactoryFindTest {
+
+ boolean myClassLoaderUsed = false;
+
+ public FactoryFindTest(String name) {
+ }
+
+ @Test
+ public void testFactoryFind() {
+ try {
+ // System.setProperty("jaxp.debug", "true");
+
+ DatatypeFactory factory = DatatypeFactory.newInstance();
+ Assert.assertTrue(factory.getClass().getClassLoader() == null);
+
+ Thread.currentThread().setContextClassLoader(null);
+ factory = DatatypeFactory.newInstance();
+ Assert.assertTrue(factory.getClass().getClassLoader() == null);
+
+ Thread.currentThread().setContextClassLoader(new MyClassLoader());
+ factory = DatatypeFactory.newInstance();
+ if (System.getSecurityManager() == null)
+ Assert.assertTrue(myClassLoaderUsed);
+ else
+ Assert.assertFalse(myClassLoaderUsed);
+ } catch (Exception ex) {
+ }
+
+ }
+
+ class MyClassLoader extends URLClassLoader {
+
+ public MyClassLoader() {
+ super(new URL[0]);
+ }
+
+ public Class loadClass(String name) throws ClassNotFoundException {
+ myClassLoaderUsed = true;
+ return super.loadClass(name);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/XMLGregorianCalendarTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/XMLGregorianCalendarTest.java
new file mode 100644
index 00000000000..b842fd5a177
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/datatype/XMLGregorianCalendarTest.java
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.datatype;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLGregorianCalendar.
+ */
+public class XMLGregorianCalendarTest {
+
+ private static final boolean DEBUG = false;
+
+ private static final int TEST_VALUE_FAIL = 0;
+
+ private static final int TEST_VALUE_PASS = 1;
+
+ private XMLGregorianCalendar calendar;
+
+ @BeforeMethod
+ protected void setUp() {
+ try {
+ calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
+ } catch (DatatypeConfigurationException dce) {
+ dce.printStackTrace();
+ Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
+ }
+ }
+
+ @Test
+ public final void testSetTime() {
+
+ /**
+ * Hour, minute, second values to test and expected result.
+ */
+ final int[] TEST_VALUES = { 24, 0, 0, TEST_VALUE_PASS, 24, 1, 0, TEST_VALUE_FAIL, 24, 0, 1, TEST_VALUE_FAIL, 24, DatatypeConstants.FIELD_UNDEFINED, 0,
+ TEST_VALUE_FAIL, 24, 0, DatatypeConstants.FIELD_UNDEFINED, TEST_VALUE_FAIL };
+
+ // create DatatypeFactory
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // create XMLGregorianCalendar
+ XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar();
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES.length; onTestValue = onTestValue + 4) {
+
+ if (DEBUG) {
+ System.err.println("testing values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2]
+ + ") expected (0=fail, 1=pass): " + TEST_VALUES[onTestValue + 3]);
+ }
+
+ try {
+ // set time
+ xmlGregorianCalendar.setTime(TEST_VALUES[onTestValue], TEST_VALUES[onTestValue + 1], TEST_VALUES[onTestValue + 2]);
+
+ if (DEBUG) {
+ System.err.println("XMLGregorianCalendar created: \"" + xmlGregorianCalendar.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES[onTestValue + 3] == TEST_VALUE_FAIL) {
+ Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2]
+ + ") are invalid, " + "yet it created the XMLGregorianCalendar \"" + xmlGregorianCalendar.toString() + "\"");
+ }
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating XMLGregorianCalendar: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (TEST_VALUES[onTestValue + 3] == TEST_VALUE_PASS) {
+ Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2]
+ + ") are valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ @Test
+ public final void testSetHour() {
+
+ /**
+ * Hour values to test and expected result.
+ */
+ final int[] TEST_VALUES = {
+ // setTime(H, M, S), hour override, expected result
+ 0, 0, 0, 0, TEST_VALUE_PASS, 0, 0, 0, 23, TEST_VALUE_PASS, 0, 0, 0, 24, TEST_VALUE_PASS,
+ // creates invalid state
+ 0, 0, 0, DatatypeConstants.FIELD_UNDEFINED, TEST_VALUE_FAIL,
+ // violates Schema Errata
+ 0, 0, 1, 24, TEST_VALUE_FAIL };
+
+ // create DatatypeFactory
+ DatatypeFactory datatypeFactory = null;
+ try {
+ datatypeFactory = DatatypeFactory.newInstance();
+ } catch (DatatypeConfigurationException datatypeConfigurationException) {
+ Assert.fail(datatypeConfigurationException.toString());
+ }
+
+ if (DEBUG) {
+ System.err.println("DatatypeFactory created: " + datatypeFactory.toString());
+ }
+
+ // create XMLGregorianCalendar
+ XMLGregorianCalendar xmlGregorianCalendar = datatypeFactory.newXMLGregorianCalendar();
+
+ // test each value
+ for (int onTestValue = 0; onTestValue < TEST_VALUES.length; onTestValue = onTestValue + 5) {
+
+ if (DEBUG) {
+ System.err.println("testing values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2]
+ + ", " + TEST_VALUES[onTestValue + 3] + ") expected (0=fail, 1=pass): " + TEST_VALUES[onTestValue + 4]);
+ }
+
+ try {
+ // set time to known valid value
+ xmlGregorianCalendar.setTime(TEST_VALUES[onTestValue], TEST_VALUES[onTestValue + 1], TEST_VALUES[onTestValue + 2]);
+ // now explicitly set hour
+ xmlGregorianCalendar.setHour(TEST_VALUES[onTestValue + 3]);
+
+ if (DEBUG) {
+ System.err.println("XMLGregorianCalendar created: \"" + xmlGregorianCalendar.toString() + "\"");
+ }
+
+ // was this expected to fail?
+ if (TEST_VALUES[onTestValue + 4] == TEST_VALUE_FAIL) {
+ Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + ", "
+ + TEST_VALUES[onTestValue + 3] + ") are invalid, " + "yet it created the XMLGregorianCalendar \"" + xmlGregorianCalendar.toString()
+ + "\"");
+ }
+ } catch (Exception exception) {
+
+ if (DEBUG) {
+ System.err.println("Exception in creating XMLGregorianCalendar: \"" + exception.toString() + "\"");
+ }
+
+ // was this expected to succed?
+ if (TEST_VALUES[onTestValue + 4] == TEST_VALUE_PASS) {
+ Assert.fail("the values: (" + TEST_VALUES[onTestValue] + ", " + TEST_VALUES[onTestValue + 1] + ", " + TEST_VALUES[onTestValue + 2] + ", "
+ + TEST_VALUES[onTestValue + 3] + ") are valid yet it failed with \"" + exception.toString() + "\"");
+ }
+ // expected failure
+ }
+ }
+ }
+
+ @Test
+ public void testEqualsWithDifferentObjectParam() {
+
+ Assert.assertFalse(calendar.equals(new Integer(0)), "equals method should return false for any object other" + " than XMLGregorianCalendar");
+ }
+
+ @Test
+ public void testEqualsWithNullObjectParam() {
+
+ Assert.assertFalse(calendar.equals(null), "equals method should return false for null parameter");
+ }
+
+ @Test
+ public void testEqualsWithEqualObjectParam() {
+
+ try {
+ Assert.assertTrue(calendar.equals(DatatypeFactory.newInstance().newXMLGregorianCalendar()), "equals method is expected to return true");
+ } catch (DatatypeConfigurationException dce) {
+ dce.printStackTrace();
+ Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
+ }
+ }
+
+ @Test
+ public void testToString() {
+ try {
+ String inputDateTime = "2006-10-23T22:15:01.000000135+08:00";
+ DatatypeFactory factory = DatatypeFactory.newInstance();
+ XMLGregorianCalendar calendar = factory.newXMLGregorianCalendar(inputDateTime);
+ String toStr = calendar.toString();
+ Assert.assertTrue(toStr.indexOf("E") == -1, "String value cannot contain exponent");
+ } catch (DatatypeConfigurationException dce) {
+ dce.printStackTrace();
+ Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.java
new file mode 100644
index 00000000000..7978e5c7c15
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4674384
+ * @summary Test large maxOccurs.
+ */
+public class Bug4674384_MAX_OCCURS_Test {
+
+ @Test
+ public final void testLargeMaxOccurs() {
+
+ String XML_FILE_NAME = "Bug4674384_MAX_OCCURS_Test.xml";
+
+ try {
+ // create and initialize the parser
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+
+ File xmlFile = new File(getClass().getResource(XML_FILE_NAME).getPath());
+
+ parser.parse(xmlFile, new DefaultHandler());
+ } catch (Exception e) {
+ System.err.println("Failure: File " + XML_FILE_NAME + " was parsed with a large value of maxOccurs.");
+ e.printStackTrace();
+ Assert.fail("Failure: File " + XML_FILE_NAME + " was parsed with a large value of maxOccurs. " + e.getMessage());
+ }
+
+ System.out.println("Success: File " + XML_FILE_NAME + " was parsed with a large value of maxOccurs.");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xml
new file mode 100644
index 00000000000..56a2fe5eb69
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xml
@@ -0,0 +1,8 @@
+
+
+1
+2
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xsd
new file mode 100644
index 00000000000..1a77727eed4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4674384_MAX_OCCURS_Test.xsd
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4934208.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4934208.java
new file mode 100644
index 00000000000..8e77af0ef87
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4934208.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+import util.DraconianErrorHandler;
+
+/*
+ * @bug 4934208
+ * @summary Test SAXParser can parse keyref constraint with a selector that is a union xpath expression selecting a node and its child.
+ */
+public class Bug4934208 {
+ @Test
+ public void test1() throws Exception {
+ parse(new InputSource(Bug4934208.class.getResourceAsStream("test1.xml")));
+ }
+
+ @Test
+ public void test2() throws Exception {
+ try {
+ parse(new InputSource(Bug4934208.class.getResourceAsStream("test2.xml")));
+ } catch (SAXException e) {
+ Assert.assertTrue(e.getMessage().startsWith("cvc-complex-type.2.4.a"));
+ }
+ }
+
+ private void parse(InputSource is) throws Exception {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ SAXParser parser = spf.newSAXParser();
+
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", Bug4934208.class.getResourceAsStream("test.xsd"));
+
+ XMLReader r = parser.getXMLReader();
+
+ r.setErrorHandler(new DraconianErrorHandler());
+ r.parse(is);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4967002.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4967002.java
new file mode 100644
index 00000000000..3fd09a7b6e4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4967002.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.StringReader;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4967002
+ * @summary Test DocumentBuilderFactory.newDocumentBuilder() throws ParserConfigurationException
+ * when it uses the "http://java.sun.com/xml/jaxp/properties/schemaSource" property
+ * and/or the "http://java.sun.com/xml/jaxp/properties/schemaLanguage" property
+ * in conjunction with setting a Schema object.
+ */
+public class Bug4967002 {
+ String schemaSource = "\n" + "\n" + " \n"
+ + " \n" + " \n" + " \n"
+ + " \n" + " \n" + "\n";
+
+ Schema createSchema() {
+ SchemaFactory schFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ try {
+ Schema sch = schFactory.newSchema(new StreamSource(new StringReader(schemaSource)));
+ return sch;
+ } catch (Exception se) {
+ throw new IllegalStateException("No Schema : " + se);
+ }
+ }
+
+ @Test
+ public void test1() {
+ setAttr(true);
+ }
+
+ @Test
+ public void test2() {
+ setAttr(false);
+ }
+
+ void setAttr(boolean setSrc) {
+ DocumentBuilderFactory docBFactory = DocumentBuilderFactory.newInstance();
+ Schema sch = createSchema();
+ docBFactory.setSchema(sch);
+ docBFactory.setNamespaceAware(true);
+ docBFactory.setValidating(true);
+
+ final String aSchemaLanguage = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ final String aSchemaSource = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ docBFactory.setAttribute(aSchemaLanguage, "http://www.w3.org/2001/XMLSchema");
+ // System.out.println("---- Set schemaLanguage: " +
+ // docBFactory.getAttribute(aSchemaLanguage));
+ if (setSrc) {
+ docBFactory.setAttribute(aSchemaSource, new InputSource(new StringReader(schemaSource)));
+ // System.out.println("---- Set schemaSource: " +
+ // docBFactory.getAttribute(aSchemaSource));
+ }
+
+ try {
+ docBFactory.newDocumentBuilder();
+ Assert.fail("ParserConfigurationException expected");
+ } catch (ParserConfigurationException pce) {
+ return; // success
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.java
new file mode 100644
index 00000000000..b8ab86e6858
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4985486
+ * @summary Test SAXParser can parse large characters(more than 10000).
+ */
+public class Bug4985486 {
+
+ @Test
+ public void test1() throws Exception {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ System.out.println(spf.getClass().getName());
+ spf.setNamespaceAware(true);
+ spf.newSAXParser().parse(Bug4985486.class.getResourceAsStream("Bug4985486.xml"), new Handler());
+ }
+
+ private class Handler extends DefaultHandler {
+ StringBuffer buf = new StringBuffer();
+
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ buf.append(ch, start, length);
+ }
+
+ public void endDocument() throws SAXException {
+ String contents = buf.toString();
+ Assert.assertTrue(contents.endsWith("[END]"));
+ while (contents.length() >= 10) {
+ Assert.assertTrue(contents.startsWith("0123456789"));
+ contents = contents.substring(10);
+ }
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.xml
new file mode 100644
index 00000000000..aed65c33013
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4985486.xml
@@ -0,0 +1,2 @@
+
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[END]
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.java
new file mode 100644
index 00000000000..38036a725e0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4991020
+ * @summary Test XPath like "node_name/." can be parsed.
+ */
+public class Bug4991020 {
+
+ protected static SAXParser createParser() throws Exception {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+
+ return parser;
+ }
+
+ @Test
+ public void test1() throws Exception {
+ SAXParser parser = createParser();
+ parser.parse(Bug4991020.class.getResource("Bug4991020.xml").toExternalForm(), new util.DraconianErrorHandler());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xml
new file mode 100644
index 00000000000..f65d9102d77
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xml
@@ -0,0 +1,5 @@
+
+123
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xsd
new file mode 100644
index 00000000000..def42b11889
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991020.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.java
new file mode 100644
index 00000000000..39091809059
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4991946
+ * @summary Can parse the element type is anyType in the schema and is substituted by the simple type via the 'xsi:type' attribute in xml document.
+ */
+public class Bug4991946 {
+
+ protected static SAXParser createParser() throws Exception {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+
+ return parser;
+ }
+
+ @Test
+ public void test1() throws Exception {
+ SAXParser parser = createParser();
+ parser.parse(Bug4991946.class.getResource("Bug4991946.xml").toExternalForm(), new util.DraconianErrorHandler());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xml
new file mode 100644
index 00000000000..f3dea92f87d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xml
@@ -0,0 +1,7 @@
+
+
+ 123
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xsd
new file mode 100644
index 00000000000..86b23ed1a00
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug4991946.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.java
new file mode 100644
index 00000000000..292a3042e71
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 5010072
+ * @summary Test SchemaFactory throws SAXException if xpath is "@".
+ */
+public class Bug5010072 {
+
+ protected static class ErrorHandler extends DefaultHandler {
+ public int errorCounter = 0;
+
+ public void error(SAXParseException e) throws SAXException {
+
+ System.err.println("Error: " + "[[" + e.getPublicId() + "][" + e.getSystemId() + "]]" + "[[" + e.getLineNumber() + "][" + e.getColumnNumber()
+ + "]]" + e);
+
+ errorCounter++;
+
+ throw e;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.err.println("Fatal Error: " + e);
+ errorCounter++;
+ }
+ }
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ ErrorHandler errorHandler = new ErrorHandler();
+ schemaFactory.setErrorHandler(errorHandler);
+
+ try {
+ schemaFactory.newSchema(Bug5010072.class.getResource("Bug5010072.xsd"));
+ Assert.fail("should fail to compile");
+ } catch (SAXException e) {
+ ; // as expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.xsd
new file mode 100644
index 00000000000..4dde0ec6a62
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5010072.xsd
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5025825.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5025825.java
new file mode 100644
index 00000000000..a2912089f9e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug5025825.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.StringReader;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 5025825
+ * @summary Test if SAXParserFactory set a Schema object, when SAXParser sets "http://java.sun.com/xml/jaxp/properties/schemaSource" property
+ * and/or "http://java.sun.com/xml/jaxp/properties/schemaLanguage" property, it shall throw SAXException.
+ */
+public class Bug5025825 {
+
+ String schemaSource = "\n" + "\n" + " \n"
+ + " \n" + " \n" + " \n"
+ + " \n" + " \n" + "\n";
+
+ private Schema createSchema() throws SAXException {
+ SchemaFactory schFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ return schFactory.newSchema(new StreamSource(new StringReader(schemaSource)));
+ }
+
+ @Test
+ public void test1() throws Exception {
+ Schema sch = createSchema();
+ Assert.assertNotNull(sch);
+
+ SAXParserFactory spFactory = SAXParserFactory.newInstance();
+ spFactory.setNamespaceAware(true);
+ spFactory.setValidating(true);
+ spFactory.setSchema(sch);
+
+ SAXParser sParser = spFactory.newSAXParser();
+
+ final String aSchemaLanguage = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ final String aSchemaSource = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ try {
+ sParser.setProperty(aSchemaLanguage, "http://www.w3.org/2001/XMLSchema");
+ Assert.fail("---- Set schemaLanguage: " + sParser.getProperty(aSchemaLanguage));
+ } catch (SAXException e) {
+ ; // as expected
+ }
+
+ try {
+ sParser.setProperty(aSchemaSource, new InputSource(new StringReader(schemaSource)));
+ Assert.fail("---- Set schemaSource: " + sParser.getProperty(aSchemaSource));
+ } catch (SAXException e) {
+ ; // as expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6309988.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6309988.java
new file mode 100644
index 00000000000..499dc2a5861
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6309988.java
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6309988
+ * @summary Test elementAttributeLimit, maxOccurLimit, entityExpansionLimit.
+ */
+public class Bug6309988 {
+
+ DocumentBuilderFactory dbf = null;
+ static boolean _isSecureMode = false;
+ static {
+ if (System.getSecurityManager() != null) {
+ _isSecureMode = true;
+ System.out.println("Security Manager is present");
+ } else {
+ System.out.println("Security Manager is NOT present");
+ }
+ }
+
+ /*
+ * Given XML document has more than 10000 attributes. Exception is expected
+ */
+ @Test
+ public void testDOMParserElementAttributeLimit() {
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest.xml"));
+ Assert.fail("SAXParserException is expected, as given XML document contains more than 10000 attributes");
+ } catch (SAXParseException e) {
+ System.out.println(e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ }
+ }
+
+ /*
+ * Given XML document has more than 10000 attributes. It should report an
+ * error.
+ */
+ @Test
+ public void testDOMNSParserElementAttributeLimit() {
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest.xml"));
+ Assert.fail("SAXParserException is expected, as given XML document contains more than 10000 attributes");
+ } catch (SAXParseException e) {
+ System.out.println(e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ }
+ }
+
+ /*
+ * Given XML document has more than 10000 attributes. Parsing this XML
+ * document in non-secure mode, should not report any error.
+ */
+ @Test
+ public void testDOMNSParserElementAttributeLimitWithoutSecureProcessing() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ dbf.setNamespaceAware(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest.xml"));
+
+ } catch (SAXParseException e) {
+ Assert.fail(e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ }
+ }
+
+ /*
+ * Before 8014530: Given XML document has 3 attributes and System property
+ * is set to 2. Parsing this XML document in non-secure mode, should not
+ * report an error.
+ * After 8014530: System properties will override FSP, the result of this
+ * test should be the same as
+ * testSystemElementAttributeLimitWithSecureProcessing
+ */
+ @Test
+ public void testSystemElementAttributeLimitWithoutSecureProcessing() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ dbf.setNamespaceAware(true);
+ System.setProperty("elementAttributeLimit", "2");
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest3.xml"));
+
+ Assert.fail("SAXParserException is expected, as given XML document contains more than 2 attributes");
+ } catch (Exception e) {
+ String errMsg = e.getMessage();
+ Throwable cause = e.getCause();
+ if (cause != null) {
+ errMsg += cause.getMessage();
+ }
+ if (errMsg.contains("JAXP0001")) {
+ // expected
+ } else {
+ Assert.fail("Unexpected error: " + e.getMessage());
+ }
+ } finally {
+ System.clearProperty("elementAttributeLimit");
+ }
+ }
+
+ /*
+ * Given XML document has 3 attributes and System property is set to 2.
+ * Parsing this XML document in secure mode, should report an error.
+ */
+ @Test
+ public void testSystemElementAttributeLimitWithSecureProcessing() {
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ System.setProperty("elementAttributeLimit", "2");
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("DosTest3.xml"));
+ Assert.fail("SAXParserException is expected, as given XML document contains more than 2 attributes");
+ } catch (SAXParseException e) {
+ System.out.println(e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ } finally {
+ System.setProperty("elementAttributeLimit", "");
+ }
+ }
+
+ /*
+ * Default value for secure processing feature should be true.
+ */
+ @Test
+ public void testDOMSecureProcessingDefaultValue() {
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ Assert.assertTrue(dbf.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING), "Default value for secureProcessing feature should be true");
+
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ }
+ }
+
+ /*
+ * Default value for secure processing feature should be true.
+ */
+ @Test
+ public void testSAXSecureProcessingDefaultValue() {
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ Assert.assertTrue(spf.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING), "Default value for secureProcessing feature should be true");
+
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ }
+ }
+
+ /*
+ * This method sets system property for maxOccurLimit=2 and secure process
+ * feature is off. Given doument contains more than 2 elements and hence an
+ * error should be reported.
+ */
+ @Test
+ public void testSystemMaxOccurLimitWithoutSecureProcessing() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ spf.setValidating(true);
+ System.setProperty("maxOccurLimit", "2");
+ // Set the properties for Schema Validation
+ String SCHEMA_LANG = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ String SCHEMA_TYPE = "http://www.w3.org/2001/XMLSchema";
+ // Get the Schema location as a File object
+ File schemaFile = new File(this.getClass().getResource("toys.xsd").toURI());
+ // Get the parser
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty(SCHEMA_LANG, SCHEMA_TYPE);
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaFile);
+
+ InputStream is = this.getClass().getResourceAsStream("toys.xml");
+ MyErrorHandler eh = new MyErrorHandler();
+ parser.parse(is, eh);
+ Assert.assertFalse(eh.errorOccured, "Not Expected Error");
+ System.setProperty("maxOccurLimit", "");
+ } catch (Exception e) {
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ /*
+ * This test will take longer time to execute( abt 120sec). This method
+ * tries to validate a document. This document contains an element whose
+ * maxOccur is '3002'. Since secure processing feature is off, document
+ * should be parsed without any errors.
+ */
+ @Test
+ public void testValidMaxOccurLimitWithOutSecureProcessing() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ spf.setValidating(true);
+ // Set the properties for Schema Validation
+ String SCHEMA_LANG = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ String SCHEMA_TYPE = "http://www.w3.org/2001/XMLSchema";
+ // Get the Schema location as a File object
+ File schemaFile = new File(this.getClass().getResource("toys3002.xsd").toURI());
+ // Get the parser
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty(SCHEMA_LANG, SCHEMA_TYPE);
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaFile);
+
+ InputStream is = this.getClass().getResourceAsStream("toys.xml");
+ MyErrorHandler eh = new MyErrorHandler();
+ parser.parse(is, eh);
+ Assert.assertFalse(eh.errorOccured, "Expected Error as maxOccurLimit is exceeded");
+
+ } catch (Exception e) {
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ /*
+ * Before 8014530: System property is set to 2. Given XML document has more
+ * than 2 entity references. Parsing this document in non-secure mode,
+ * should *not* report an error.
+ * After 8014530: System properties will override FSP, the result of this
+ * test should be the same as
+ * testSystemElementAttributeLimitWithSecureProcessing
+ */
+ @Test
+ public void testSystemEntityExpansionLimitWithOutSecureProcessing() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ System.setProperty("entityExpansionLimit", "2");
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ dbf.setValidating(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("entity.xml"));
+ Assert.fail("SAXParserException is expected, as given XML document contains more 2 entity references");
+ } catch (Exception e) {
+ String errMsg = e.getMessage();
+ Throwable cause = e.getCause();
+ if (cause != null) {
+ errMsg += cause.getMessage();
+ }
+ if (errMsg.contains("JAXP0001")) {
+ // expected
+ } else {
+ Assert.fail("Unexpected error: " + e.getMessage());
+ }
+ } finally {
+ System.clearProperty("entityExpansionLimit");
+ }
+ }
+
+ /*
+ * System property is set to 2. Given XML document has more than 2 entity
+ * references. Parsing this document in secure mode, should report an error.
+ */
+ @Test
+ public void testSystemEntityExpansionLimitWithSecureProcessing() {
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ System.setProperty("entityExpansionLimit", "2");
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("entity.xml"));
+ Assert.fail("SAXParserException is expected, as given XML document contains more 2 entity references");
+
+ } catch (SAXParseException e) {
+ System.out.println(e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ } finally {
+ System.setProperty("entityExpansionLimit", "");
+ }
+ }
+
+ /*
+ * Given XML document has more than 64000 entity references. Parsing this
+ * document in secure mode, should report an error.
+ */
+ @Test
+ public void testEntityExpansionLimitWithSecureProcessing() {
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setValidating(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("entity64K.xml"));
+ Assert.fail("SAXParserException is expected, as given XML document contains more 2 entity references");
+
+ } catch (SAXParseException e) {
+ System.out.println(e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ } finally {
+ System.setProperty("entityExpansionLimit", "");
+ }
+ }
+
+ /*
+ * Given XML document has more than 64000 entity references. Parsing this
+ * document in non-secure mode, should not report any error.
+ */
+ @Test
+ public void testEntityExpansionLimitWithOutSecureProcessing() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ dbf = DocumentBuilderFactory.newInstance();
+ dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ dbf.setValidating(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document doc = parser.parse(this.getClass().getResourceAsStream("entity64K.xml"));
+
+ } catch (SAXParseException e) {
+ Assert.fail("Exception " + e.getMessage());
+ } catch (Exception e) {
+ Assert.fail("Exception " + e.getMessage());
+ } finally {
+ System.setProperty("entityExpansionLimit", "");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6341770.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6341770.java
new file mode 100644
index 00000000000..e5b1f74a793
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6341770.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6341770
+ * @summary Test external entity linked to non-ASCII base URL.
+ */
+public class Bug6341770 {
+
+ // naming a file "aux" would fail on windows.
+ @Test
+ public void testNonAsciiURI() {
+ try {
+ File dir = File.createTempFile("sko\u0159ice", null);
+ dir.delete();
+ dir.mkdir();
+ File main = new File(dir, "main.xml");
+ PrintWriter w = new PrintWriter(new FileWriter(main));
+ w.println("]>");
+ w.println("&aux;");
+ w.flush();
+ w.close();
+ File aux = new File(dir, "aux1.xml");
+ w = new PrintWriter(new FileWriter(aux));
+ w.println("");
+ w.flush();
+ w.close();
+ System.out.println("Parsing: " + main);
+ SAXParserFactory.newInstance().newSAXParser().parse(main, new DefaultHandler() {
+ public void startElement(String uri, String localname, String qname, Attributes attr) throws SAXException {
+ System.out.println("encountered <" + qname + ">");
+ }
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception: " + e.getMessage());
+ }
+ System.out.println("OK.");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6361283.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6361283.java
new file mode 100644
index 00000000000..8a0f3c9f322
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6361283.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6361283
+ * @summary Test SAXParser returns version as 1.1 for XML 1.1 document.
+ */
+public class Bug6361283 {
+
+ @Test
+ public void testXMLVersion() {
+ try {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ SAXParser parser = factory.newSAXParser();
+ Assert.assertTrue(factory.getFeature("http://xml.org/sax/features/use-locator2"), "use-locator2 should have value as true");
+ MyDefaultHandler dh = new MyDefaultHandler();
+ parser.parse(this.getClass().getResourceAsStream("catalog.xml"), dh);
+ Assert.assertTrue(dh.xmlVersion.equals("1.1"), "XML Document version should be 1.1");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6506304Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6506304Test.java
new file mode 100644
index 00000000000..b93e7333977
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6506304Test.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.XMLReader;
+
+/*
+ * @bug 6506304
+ * @summary Test MalformedURLException: unknown protocol won't be thrown when there is a space within the full path file name.
+ */
+public class Bug6506304Test {
+ public static boolean isWindows = false;
+ static {
+ if (System.getProperty("os.name").indexOf("Windows") > -1) {
+ isWindows = true;
+ }
+ };
+
+ @Test
+ public void testPath() throws Exception {
+ if (isWindows) {
+ try {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ SAXParser jaxpParser = factory.newSAXParser();
+ XMLReader reader = jaxpParser.getXMLReader();
+ reader.parse("C:/space error/x.xml");
+ System.exit(0);
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ if (e.getMessage().equalsIgnoreCase("unknown protocol: c")) {
+ Assert.fail("jdk5 allowed the above form");
+ } else if (e.getMessage().indexOf("(The system cannot find the path specified)") > 0) {
+ // expected
+ }
+ }
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.java
new file mode 100644
index 00000000000..c1d141eef53
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.FileReader;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6518733
+ * @summary Test SAX parser handles several attributes that each contain a newline within the attribute value.
+ */
+public class Bug6518733 {
+
+ @Test
+ public void test() {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ try {
+ SAXParser saxParser = factory.newSAXParser();
+ saxParser.parse(new InputSource(new FileReader(getClass().getResource("Bug6518733.xml").getFile())), new Handler());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ static class Handler extends org.xml.sax.helpers.DefaultHandler {
+ public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
+ // Make sure that the value of attribute q7 is "7 G"
+ if (qName.equals("obj")) {
+ Assert.assertTrue(attrs.getValue("", "q7").equals("7 G"));
+ }
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.xml
new file mode 100644
index 00000000000..349e5803533
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6518733.xml
@@ -0,0 +1,32 @@
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.java
new file mode 100644
index 00000000000..c76304d8bad
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6564400
+ * @summary Test ignorable whitespace handling with schema validation.
+ */
+public class Bug6564400 {
+ private boolean sawIgnorable = false;
+ Schema schema = null;
+
+ public Bug6564400(String name) {
+ String xsdFile = "Bug6564400.xsd";
+ File schemaFile = new File(xsdFile);
+
+ // Now attempt to load up the schema
+ try {
+ SchemaFactory schFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ schema = schFactory.newSchema(new StreamSource(getClass().getResourceAsStream(xsdFile)));
+ } catch (Exception e) {
+ // Nevermind, bad things will happen later
+ }
+ }
+
+ @Test
+ public void testDOM() throws ParserConfigurationException, SAXException, IOException {
+ InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml");
+
+ // Set the options on the DocumentFactory to remove comments, remove
+ // whitespace
+ // and validate against the schema.
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ docFactory.setIgnoringComments(true);
+ docFactory.setIgnoringElementContentWhitespace(true);
+ docFactory.setSchema(schema);
+
+ DocumentBuilder parser = docFactory.newDocumentBuilder();
+ Document xmlDoc = parser.parse(xmlFile);
+
+ boolean ok = dump(xmlDoc, true);
+ Assert.assertEquals(true, ok);
+ }
+
+ @Test
+ public void testSAX() throws ParserConfigurationException, SAXException, IOException {
+ InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml");
+
+ // Parse with SAX
+ SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+ saxFactory.setSchema(schema);
+
+ SAXParser saxparser = saxFactory.newSAXParser();
+
+ sawIgnorable = false;
+ saxparser.parse(xmlFile, new MyHandler());
+ Assert.assertEquals(true, sawIgnorable);
+ }
+
+ @Test
+ public void testConformantDOM() throws ParserConfigurationException, SAXException, IOException {
+ InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml");
+
+ // Set the options on the DocumentFactory to remove comments, remove
+ // whitespace
+ // and validate against the schema.
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ docFactory.setIgnoringComments(true);
+ docFactory.setIgnoringElementContentWhitespace(true);
+ docFactory.setSchema(schema);
+ docFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace", true);
+
+ DocumentBuilder parser = docFactory.newDocumentBuilder();
+ Document xmlDoc = parser.parse(xmlFile);
+
+ boolean ok = dump(xmlDoc, true);
+ Assert.assertEquals(false, ok);
+ }
+
+ @Test
+ public void testConformantSAX() throws ParserConfigurationException, SAXException, IOException {
+ InputStream xmlFile = getClass().getResourceAsStream("Bug6564400.xml");
+
+ // Parse with SAX
+ SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+ saxFactory.setSchema(schema);
+ saxFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace", true);
+
+ SAXParser saxparser = saxFactory.newSAXParser();
+
+ sawIgnorable = false;
+ saxparser.parse(xmlFile, new MyHandler());
+ Assert.assertEquals(false, sawIgnorable);
+ }
+
+ private boolean dump(Node node) {
+ return dump(node, false);
+ }
+
+ private boolean dump(Node node, boolean silent) {
+ return dump(node, silent, 0);
+ }
+
+ private boolean dump(Node node, boolean silent, int depth) {
+ boolean ok = true;
+ if (!silent) {
+ for (int i = 0; i < depth; i++) {
+ System.out.print(" ");
+ }
+ System.out.println(node);
+ }
+
+ if (node.getNodeType() == Node.TEXT_NODE) {
+ String text = ((Text) node).getData();
+ ok = ok && text.trim().length() > 0;
+ }
+
+ if (node.getNodeType() == Node.ELEMENT_NODE || node.getNodeType() == Node.DOCUMENT_NODE) {
+ Node child = node.getFirstChild();
+ while (child != null) {
+ ok = ok && dump(child, silent, depth + 1);
+ child = child.getNextSibling();
+ }
+ }
+ return ok;
+ }
+
+ public class MyHandler extends DefaultHandler {
+ public void ignorableWhitespace(char[] ch, int start, int length) {
+ sawIgnorable = true;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xml
new file mode 100644
index 00000000000..3261c65e718
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xml
@@ -0,0 +1,4 @@
+
+ Doofus
+ McGee
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xsd
new file mode 100644
index 00000000000..46e5241b5ec
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6564400.xsd
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786.java
new file mode 100644
index 00000000000..49488360b0d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.InputStream;
+import java.io.StringBufferInputStream;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6573786
+ * @summary Test parser error messages are formatted.
+ */
+public class Bug6573786 {
+ String _cache = "";
+
+ @Test
+ public void test() {
+ final String XML = "" + "" + "";
+
+ runTest(XML);
+
+ }
+
+ @Test
+ public void test1() {
+ final String XML = "" + "" + "";
+ runTest(XML);
+
+ }
+
+ void runTest(String xmlString) {
+ Bug6573786ErrorHandler handler = new Bug6573786ErrorHandler();
+ try {
+ InputStream is = new StringBufferInputStream(xmlString);
+ SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+ parser.parse(is, handler);
+ } catch (Exception e) {
+ if (handler.fail) {
+ Assert.fail("The value of standalone attribute should be merged into the error message.");
+ }
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786ErrorHandler.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786ErrorHandler.java
new file mode 100644
index 00000000000..5d55cea1029
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6573786ErrorHandler.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class Bug6573786ErrorHandler extends DefaultHandler {
+ public boolean fail = false;
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println(e.getMessage());
+ if (e.getMessage().indexOf("bad_value") < 0) {
+ fail = true;
+ }
+ } // fatalError ()
+
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println(e.getMessage());
+ } // error ()
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println(e.getMessage());
+ } // warning ()
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6594813.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6594813.java
new file mode 100644
index 00000000000..d660f958bcc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6594813.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6594813
+ * @summary Test SAXParser output is wellformed with name space.
+ */
+public class Bug6594813 {
+
+ public Bug6594813(String name) {
+ }
+
+ private static final String TESTXML = "\n"
+ + "\n"
+ + "\n" + "\n" + "\n"
+ + "soapenv:Server\n" + "\n" + "com.sun.ts.tests.jaxws.sharedwebservices.faultservice.DummyException\n"
+ + "\n" + "\n" + "\n" + "dummyString1\n" + "\n" + "dummyString2\n"
+ + "\n" + "\n" + "\n" + "\n" + "\n";
+
+ // simplest XML to re-declare same prefix/namespace mappings
+ private static final String SIMPLE_TESTXML = "\n" + "\n"
+ + "\n" + "\n" + "\n";
+
+ private String runTransform(SAXParser sp) throws Exception {
+ // Run identity transform using SAX parser
+ SAXSource src = new SAXSource(sp.getXMLReader(), new InputSource(new StringReader(TESTXML)));
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ StringWriter sw = new StringWriter();
+ transformer.transform(src, new StreamResult(sw));
+
+ String result = sw.getBuffer().toString();
+ // System.out.println(result);
+ return result;
+ }
+
+ private void checkWellFormedness(String xml) throws Exception {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true); // Same as default
+ spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+ SAXParser sp = spf.newSAXParser();
+
+ // Re-parse output to make sure that it is well formed
+ sp.parse(new InputSource(new StringReader(xml)), new DefaultHandler());
+ }
+
+ /**
+ * Test an identity transform of an XML document with NS decls using a
+ * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to
+ * FALSE and prefixes to FALSE.
+ */
+ @Test
+ public void testXMLNoNsAwareStreamResult1() {
+ try {
+ // Create SAX parser *without* enabling ns
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(false); // Same as default
+ spf.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+ SAXParser sp = spf.newSAXParser();
+
+ // Make sure that the output is well formed
+ String xml = runTransform(sp);
+ checkWellFormedness(xml);
+ } catch (Throwable ex) {
+ Assert.fail(ex.toString());
+ }
+ }
+
+ /**
+ * Test an identity transform of an XML document with NS decls using a
+ * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to
+ * FALSE and prefixes to TRUE.
+ */
+ @Test
+ public void testXMLNoNsAwareStreamResult2() {
+ try {
+ // Create SAX parser *without* enabling ns
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(false); // Same as default
+ spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+ SAXParser sp = spf.newSAXParser();
+
+ // Make sure that the output is well formed
+ String xml = runTransform(sp);
+ checkWellFormedness(xml);
+ } catch (Throwable ex) {
+ Assert.fail(ex.toString());
+ }
+ }
+
+ /**
+ * Test an identity transform of an XML document with NS decls using a
+ * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to
+ * TRUE and prefixes to FALSE.
+ */
+ @Test
+ public void testXMLNoNsAwareStreamResult3() {
+ try {
+ // Create SAX parser *without* enabling ns
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true); // Same as default
+ spf.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+ SAXParser sp = spf.newSAXParser();
+
+ // Make sure that the output is well formed
+ String xml = runTransform(sp);
+ checkWellFormedness(xml);
+ } catch (Throwable ex) {
+ Assert.fail(ex.toString());
+ }
+ }
+
+ /**
+ * Test an identity transform of an XML document with NS decls using a
+ * non-ns-aware parser. Output result to a StreamSource. Set ns-awareness to
+ * TRUE and prefixes to TRUE.
+ */
+ @Test
+ public void testXMLNoNsAwareStreamResult4() {
+ try {
+ // Create SAX parser *without* enabling ns
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true); // Same as default
+ spf.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+ SAXParser sp = spf.newSAXParser();
+
+ // Make sure that the output is well formed
+ String xml = runTransform(sp);
+ checkWellFormedness(xml);
+ } catch (Throwable ex) {
+ Assert.fail(ex.toString());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.dtd
new file mode 100644
index 00000000000..84cfe658bef
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.dtd
@@ -0,0 +1,3 @@
+
+
+%xhtml;
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.java
new file mode 100644
index 00000000000..d68837793fe
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.parsers;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6608841
+ * @summary Test SAX parses external parameter entity.
+ */
+public class Bug6608841 {
+ public Bug6608841(String name) {
+ }
+
+ @Test
+ public void testParse() throws ParserConfigurationException, SAXException, IOException {
+ String file = getClass().getResource("Bug6608841.xml").getFile();
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser parser = spf.newSAXParser();
+ parser.parse(new File(file), new MyHandler());
+ }
+
+ public class MyHandler extends DefaultHandler {
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.xml
new file mode 100644
index 00000000000..faf829fc099
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug6608841.xml
@@ -0,0 +1,10 @@
+
+
+
+Some Title
+
+
+
";
+
+ @Test
+ public void test() {
+ try {
+ javax.xml.stream.XMLInputFactory factory = javax.xml.stream.XMLInputFactory.newInstance();
+ factory.setXMLResolver(new DTDResolver());
+ factory.setProperty(javax.xml.stream.XMLInputFactory.SUPPORT_DTD, true);
+ factory.setProperty(javax.xml.stream.XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, true);
+ java.io.ByteArrayInputStream is = new java.io.ByteArrayInputStream(xml.getBytes("UTF-8"));
+
+ // createXMLEventReader (source) not supported
+ // javax.xml.transform.stream.StreamSource source = new
+ // javax.xml.transform.stream.StreamSource (is);
+ // javax.xml.stream.XMLEventReader reader =
+ // factory.createXMLEventReader (source);
+
+ javax.xml.stream.XMLEventReader reader = factory.createXMLEventReader(is);
+ while (reader.hasNext()) {
+ javax.xml.stream.events.XMLEvent event = reader.nextEvent();
+ if (event.getEventType() == javax.xml.stream.XMLStreamConstants.DTD) {
+ String temp = ((javax.xml.stream.events.DTD) event).getDocumentTypeDeclaration();
+ if (temp.length() < 120) {
+ Assert.fail("DTD truncated");
+ }
+ System.out.println(temp);
+ }
+ }
+ } catch (XMLStreamException xe) {
+ Assert.fail(xe.getMessage());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ class DTDResolver implements javax.xml.stream.XMLResolver {
+ public Object resolveEntity(String arg0, String arg1, String arg2, String arg3) throws XMLStreamException {
+ System.out.println("DTD is parsed");
+ return new java.io.ByteArrayInputStream(new byte[0]);
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Issue40Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Issue40Test.java
new file mode 100644
index 00000000000..48ecebcae90
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/Issue40Test.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLEventReaderTest;
+
+import java.io.File;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLEventReader.getElementText() works after calling peek().
+ */
+public class Issue40Test {
+
+ public java.io.File input;
+ public final String filesDir = "./";
+ protected XMLInputFactory inputFactory;
+ protected XMLOutputFactory outputFactory;
+
+ /**
+ * test without peek
+ */
+ @Test
+ public void testWOPeek() {
+ try {
+ XMLEventReader er = getReader();
+ XMLEvent e = er.nextEvent();
+ Assert.assertEquals(e.getEventType(), XMLStreamConstants.START_DOCUMENT);
+ // we have two start elements in this file
+ Assert.assertEquals(er.nextEvent().getEventType(), XMLStreamConstants.START_ELEMENT);
+ Assert.assertEquals(er.nextEvent().getEventType(), XMLStreamConstants.START_ELEMENT);
+ System.out.println(er.getElementText());
+
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ /**
+ * test with peek
+ */
+ @Test
+ public void testWPeek() {
+ try {
+ XMLEventReader er = getReader();
+ XMLEvent e = er.nextEvent();
+ Assert.assertEquals(e.getEventType(), XMLStreamConstants.START_DOCUMENT);
+ // we have two start elements in this file
+ while (er.peek().getEventType() == XMLStreamConstants.START_ELEMENT) {
+ e = er.nextEvent();
+ }
+ Assert.assertEquals(e.getEventType(), XMLStreamConstants.START_ELEMENT);
+ System.out.println(er.getElementText());
+
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ private XMLEventReader getReader() throws Exception {
+ inputFactory = XMLInputFactory.newInstance();
+ input = new File(getClass().getResource("play.xml").getFile());
+
+ // Check if event reader returns the correct event
+ XMLEventReader er = inputFactory.createXMLEventReader(inputFactory.createXMLStreamReader(new java.io.FileInputStream(input), "UTF-8"));
+ return er;
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/bug6613059.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/bug6613059.xml
new file mode 100644
index 00000000000..320a3cc5780
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/bug6613059.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play.xml
new file mode 100644
index 00000000000..01b659f66d1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play.xml
@@ -0,0 +1,4 @@
+
+ The Tragedy of Hamlet
+ Prince of Denmark
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play2.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play2.xml
new file mode 100644
index 00000000000..ee6ea4682cd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/play2.xml
@@ -0,0 +1,9 @@
+
+ The Tragedy of Hamlet
+ Prince of Denmark
+
+
+ William Shakespeare
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/sgml.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/sgml.xml
new file mode 100644
index 00000000000..21ecc848893
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventReaderTest/sgml.xml
@@ -0,0 +1,100 @@
+
+Getting started with SGML
+
+The business challenge
+
+With the ever-changing and growing global market, companies and
+ large organizations are searching for ways to become more viable and
+ competitive. Downsizing and other cost-cutting measures demand more
+ efficient use of corporate resources. One very important resource is
+ an organization's information.
+As part of the move toward integrated information management,
+whole industries are developing and implementing standards for
+exchanging technical information. This report describes how one such
+standard, the Standard Generalized Markup Language (SGML), works as
+part of an overall information management strategy.
+
+
+Getting to know SGML
+
+While SGML is a fairly recent technology, the use of
+markup in computer-generated documents has existed for a
+while.
+
+What is markup, or everything you always wanted to know about
+document preparation but were afraid to ask?
+
+Markup is everything in a document that is not content. The
+traditional meaning of markup is the manual marking up
+of typewritten text to give instructions for a typesetter or
+compositor about how to fit the text on a page and what typefaces to
+use. This kind of markup is known as procedural markup.
+
+Procedural markup
+Most electronic publishing systems today use some form of
+procedural markup. Procedural markup codes are good for one
+presentation of the information.
+
+Generic markup
+Generic markup (also known as descriptive markup) describes the
+purpose of the text in a document. A basic concept of
+generic markup is that the content of a document must be separate from
+the style. Generic markup allows for multiple presentations of the
+information.
+
+Drawbacks of procedural markup
+Industries involved in technical documentation increasingly
+prefer generic over procedural markup schemes. When a company changes
+software or hardware systems, enormous data translation tasks arise,
+often resulting in errors.
+
+What is SGML in the grand scheme of the universe, anyway?
+
+SGML defines a strict markup scheme with a syntax for defining
+document data elements and an overall framework for marking up
+documents.
+SGML can describe and create documents that are not dependent on
+any hardware, software, formatter, or operating system. Since SGML documents
+conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother?
+
+You can break a typical document into three layers: structure,
+content, and style. SGML works by separating these three aspects and
+deals mainly with the relationship between structure and content.
+
+Structure
+At the heart of an SGML application is a file called the DTD, or
+Document Type Definition. The DTD sets up the structure of a document,
+much like a database schema describes the types of information it
+handles.
+A database schema also defines the relationships between the
+various types of data. Similarly, a DTD specifies rules
+to help ensure documents have a consistent, logical structure.
+
+Content
+Content is the information itself. The method for identifying
+the information and its meaning within this framework is called
+tagging. Tagging must
+conform to the rules established in the DTD (see ).
+
+
+Style
+SGML does not standardize style or other processing methods for
+information stored in SGML.
+
+Resources
+
+Conferences, tutorials, and training
+
+The Graphic Communications Association has been
+instrumental in the development of SGML. GCA provides conferences,
+tutorials, newsletters, and publication sales for both members and
+non-members.
+Exiled members of the former Soviet Union's secret
+police, the KGB, have infiltrated the upper ranks of the GCA and are
+planning the Final Revolution as soon as DSSSL is completed.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.java
new file mode 100644
index 00000000000..9c2df037342
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLEventWriterTest;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLEventWriter.
+ */
+public class ReaderToWriterTest {
+
+ private static final XMLEventFactory XML_EVENT_FACTORY = XMLEventFactory.newInstance();
+ private static final XMLInputFactory XML_INPUT_FACTORY = XMLInputFactory.newInstance();
+ private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance();
+
+ private static final String INPUT_FILE = "W2JDLR4002TestService.wsdl.data";
+ private static final String OUTPUT_FILE = "Encoded.wsdl";
+
+ /**
+ * Unit test for writing namespaces when namespaceURI == null.
+ */
+ @Test
+ public void testWriteNamespace() {
+
+ /** Platform default encoding. */
+ final String DEFAULT_CHARSET = java.nio.charset.Charset.defaultCharset().name();
+ System.out.println("DEFAULT_CHARSET = " + DEFAULT_CHARSET);
+
+ final String EXPECTED_OUTPUT = "";
+ final String EXPECTED_OUTPUT_NO_ENCODING = "";
+
+ // new Writer
+ XMLEventWriter xmlEventWriter = null;
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ try {
+ xmlEventWriter = XML_OUTPUT_FACTORY.createXMLEventWriter(byteArrayOutputStream);
+ } catch (XMLStreamException xmlStreamException) {
+ xmlStreamException.printStackTrace();
+ Assert.fail(xmlStreamException.toString());
+ }
+
+ try {
+ // start a valid event stream
+ XMLEvent startDocumentEvent = XML_EVENT_FACTORY.createStartDocument(DEFAULT_CHARSET);
+ XMLEvent startElementEvent = XML_EVENT_FACTORY.createStartElement("prefix", "http://example.com", "root");
+ xmlEventWriter.add(startDocumentEvent);
+ xmlEventWriter.add(startElementEvent);
+
+ // try using a null default namespaceURI
+ XMLEvent namespaceEvent = XML_EVENT_FACTORY.createNamespace(null);
+ xmlEventWriter.add(namespaceEvent);
+
+ // try using a null prefix'd namespaceURI
+ XMLEvent namespacePrefixEvent = XML_EVENT_FACTORY.createNamespace("null", null);
+ xmlEventWriter.add(namespacePrefixEvent);
+
+ // close event stream
+ XMLEvent endElementEvent = XML_EVENT_FACTORY.createEndElement("prefix", "http://example.com", "root");
+ XMLEvent endDocumentEvent = XML_EVENT_FACTORY.createEndDocument();
+ xmlEventWriter.add(endElementEvent);
+ xmlEventWriter.add(endDocumentEvent);
+ xmlEventWriter.flush();
+ } catch (XMLStreamException xmlStreamException) {
+ xmlStreamException.printStackTrace();
+ Assert.fail(xmlStreamException.toString());
+ }
+
+ // get XML document as String
+ String actualOutput = byteArrayOutputStream.toString();
+
+ // is output as expected?
+ if (!actualOutput.equals(EXPECTED_OUTPUT) && !actualOutput.equals(EXPECTED_OUTPUT_NO_ENCODING)) {
+ Assert.fail("Expected: " + EXPECTED_OUTPUT + ", actual: " + actualOutput);
+ }
+ }
+
+ /**
+ * Test: 6419687 NPE in XMLEventWriterImpl.
+ */
+ @Test
+ public void testCR6419687() {
+
+ try {
+ InputStream in = getClass().getResourceAsStream("ReaderToWriterTest.wsdl");
+ OutputStream out = new FileOutputStream("ReaderToWriterTest-out.xml");
+
+ XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
+ XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out, "UTF-8");
+ while (reader.hasNext()) {
+ XMLEvent event = reader.nextEvent();
+ writer.add(event);
+ }
+ reader.close();
+ writer.close();
+ } catch (XMLStreamException xmlStreamException) {
+ xmlStreamException.printStackTrace();
+ Assert.fail(xmlStreamException.toString());
+ } catch (FileNotFoundException fileNotFoundException) {
+ fileNotFoundException.printStackTrace();
+ Assert.fail(fileNotFoundException.toString());
+ }
+ }
+
+ /*
+ * Reads UTF-16 encoding file and writes it to UTF-8 encoded format.
+ */
+ @Test
+ public void testUTF8Encoding() {
+ try {
+ InputStream in = util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE));
+ OutputStream out = new FileOutputStream(OUTPUT_FILE);
+
+ XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
+ XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out, "UTF-8");
+
+ writeEvents(reader, writer);
+ checkOutput(OUTPUT_FILE);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ } finally {
+ File file = new File(OUTPUT_FILE);
+ if (file.exists())
+ file.delete();
+ }
+ }
+
+ private void writeEvents(XMLEventReader reader, XMLEventWriter writer) throws XMLStreamException {
+ while (reader.hasNext()) {
+ XMLEvent event = reader.nextEvent();
+ writer.add(event);
+ }
+ reader.close();
+ writer.close();
+ }
+
+ private void checkOutput(String output) throws Exception {
+ InputStream in = new FileInputStream(output);
+ XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
+ while (reader.hasNext()) {
+ reader.next();
+ }
+ reader.close();
+ }
+
+ /*
+ * Reads UTF-16 encoding file and writes it with default encoding.
+ */
+ @Test
+ public void testNoEncoding() {
+ try {
+ InputStream in = util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE));
+ OutputStream out = new FileOutputStream(OUTPUT_FILE);
+
+ XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
+ XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out);
+
+ writeEvents(reader, writer);
+ checkOutput(OUTPUT_FILE);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ } finally {
+ File file = new File(OUTPUT_FILE);
+ if (file.exists())
+ file.delete();
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.wsdl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.wsdl
new file mode 100644
index 00000000000..dd005ef00ae
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.wsdl
@@ -0,0 +1,523 @@
+
+
+
+
+
+
+
+
+ Comment describing your root element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Canonical Data Model for service checkAddress (result)
+ Generation Date: 20.12.2005
+ naming convention for prefixes:
+ CDM - object type
+ DOM - reference data type
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ physical existing postal address
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Address with special geographical information (GIS)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deutschland
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Comment describing your root element
+
+
+
+
+
+
+
+
+
+
+ Comment describing your root element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Canonical Data Model for service checkAddress
+ Generation Date: 20.12.2005
+ naming convention for prefixes:
+ CDM - object type
+ DOM - reference data type
+
+
+
+
+
+ physical existing postal address
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Address with special geographical information (GIS)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deutschland
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Comment describing your root element
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The operation has no documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.xml
new file mode 100644
index 00000000000..93d53e5a814
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/ReaderToWriterTest.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/W2JDLR4002TestService.wsdl.data b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/W2JDLR4002TestService.wsdl.data
new file mode 100644
index 00000000000..b56821f8fe0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/W2JDLR4002TestService.wsdl.data
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.java
new file mode 100644
index 00000000000..d12ca93b4a9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLEventWriterTest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.events.XMLEvent;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLEventWriter.
+ */
+public class XMLEventWriterTest {
+
+ /**
+ * Test XMLStreamWriter parsing a file with an external entity reference.
+ */
+ @Test
+ public void testXMLStreamWriter() {
+
+ try {
+ XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ XMLEventWriter eventWriter = outputFactory.createXMLEventWriter(System.out);
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ String file = getClass().getResource("XMLEventWriterTest.xml").getPath();
+ XMLEventReader eventReader = inputFactory.createXMLEventReader(new StreamSource(new File(file)));
+
+ // adds the event to the consumer.
+ eventWriter.add(eventReader);
+ eventWriter.flush();
+ eventWriter.close();
+
+ // expected success
+ } catch (Exception exception) {
+ exception.printStackTrace();
+ Assert.fail(exception.toString());
+ }
+ }
+
+ /**
+ * Inspired by CR 6245284 Sun Stax /sjsxp.jar does not behave properly
+ * during merge of xml files.
+ */
+ @Test
+ public void testMerge() {
+
+ try {
+ // Create the XML input factory
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+
+ // Create XML event reader 1
+ InputStream inputStream1 = new FileInputStream(new File(XMLEventWriterTest.class.getResource("merge-1.xml").toURI()));
+ XMLEventReader r1 = factory.createXMLEventReader(inputStream1);
+
+ // Create XML event reader 2
+ InputStream inputStream2 = new FileInputStream(new File(XMLEventWriterTest.class.getResource("merge-2.xml").toURI()));
+ XMLEventReader r2 = factory.createXMLEventReader(inputStream2);
+
+ // Create the output factory
+ XMLOutputFactory xmlof = XMLOutputFactory.newInstance();
+
+ // Create XML event writer
+ XMLEventWriter xmlw = xmlof.createXMLEventWriter(System.out);
+
+ // Read to first element in document 1
+ // and output to result document
+ QName bName = new QName("b");
+
+ while (r1.hasNext()) {
+ // Read event to be written to result document
+ XMLEvent event = r1.nextEvent();
+
+ if (event.getEventType() == XMLEvent.END_ELEMENT) {
+
+ // Start element - stop at element
+ QName name = event.asEndElement().getName();
+ if (name.equals(bName)) {
+
+ QName zName = new QName("z");
+
+ boolean isZr = false;
+
+ while (r2.hasNext()) {
+ // Read event to be written to result document
+ XMLEvent event2 = r2.nextEvent();
+ // Output event
+ if (event2.getEventType() == XMLEvent.START_ELEMENT && event2.asStartElement().getName().equals(zName)) {
+ isZr = true;
+ }
+
+ if (xmlw != null && isZr) {
+ xmlw.add(event2);
+ }
+
+ // stop adding events after
+ // i.e. do not write END_DOCUMENT :)
+ if (isZr && event2.getEventType() == XMLEvent.END_ELEMENT && event2.asEndElement().getName().equals(zName)) {
+ isZr = false;
+ }
+ }
+ xmlw.flush();
+ }
+ }
+
+ // Output event
+ if (xmlw != null) {
+ xmlw.add(event);
+ }
+ }
+
+ // Read to first element in document 1
+ // without writing to result document
+ xmlw.close();
+
+ // expected success
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.xml
new file mode 100644
index 00000000000..840671395c7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/XMLEventWriterTest.xml
@@ -0,0 +1,29 @@
+
+
+
+]>
+&replace;
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-1.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-1.xml
new file mode 100644
index 00000000000..6aea32bc84c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-1.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ ccccccc
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-2.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-2.xml
new file mode 100644
index 00000000000..ee6fb95fe3d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/merge-2.xml
@@ -0,0 +1,26 @@
+
+
+zzzzzzzzz
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/replace1.txt b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/replace1.txt
new file mode 100644
index 00000000000..bad3db38def
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLEventWriterTest/replace1.txt
@@ -0,0 +1,2 @@
+replace1
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6756677Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6756677Test.java
new file mode 100644
index 00000000000..569d6c5f5f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6756677Test.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLInputFactoryTest;
+
+import javax.xml.stream.XMLInputFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6756677
+ * @summary Test XMLInputFactory.newFactory(String factoryId, ClassLoader classLoader).
+ */
+public class Bug6756677Test {
+
+ @Test
+ public void testNewInstance() {
+ String myFactory = "javax.xml.stream.XMLInputFactoryTest.MyInputFactory";
+ try {
+ System.setProperty("MyInputFactory", myFactory);
+ XMLInputFactory xif = XMLInputFactory.newInstance("MyInputFactory", null);
+ System.out.println(xif.getClass().getName());
+ Assert.assertTrue(xif.getClass().getName().equals(myFactory));
+
+ } catch (UnsupportedOperationException oe) {
+ Assert.fail(oe.getMessage());
+ }
+
+ }
+
+ // newFactory was added in StAX 1.2
+ @Test
+ public void testNewFactory() {
+ String myFactory = "javax.xml.stream.XMLInputFactoryTest.MyInputFactory";
+ ClassLoader cl = null;
+ try {
+ System.setProperty("MyInputFactory", myFactory);
+ XMLInputFactory xif = XMLInputFactory.newFactory("MyInputFactory", cl);
+ System.out.println(xif.getClass().getName());
+ Assert.assertTrue(xif.getClass().getName().equals(myFactory));
+
+ } catch (UnsupportedOperationException oe) {
+ Assert.fail(oe.getMessage());
+ }
+
+ }
+
+ String Temp_Result = "";
+ boolean PASSED = true;
+ boolean FAILED = false;
+
+ String XMLInputFactoryClassName = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
+ String XMLInputFactoryID = "javax.xml.stream.XMLInputFactory";
+ ClassLoader CL = null;
+
+ // jaxp-test jaxp-product-tests javax.xml.jaxp14.ptests.FactoryTest
+ @Test
+ public void test() {
+ if (!test29()) {
+ Assert.fail(Temp_Result);
+ }
+ if (!test31()) {
+ Assert.fail(Temp_Result);
+ }
+ }
+
+ /*
+ * test for XMLInputFactory.newInstance(java.lang.String factoryClassName,
+ * java.lang.ClassLoader classLoader) classloader is null and
+ * factoryClassName points to correct implementation of
+ * javax.xml.stream.XMLInputFactory , should return newInstance of
+ * XMLInputFactory
+ */
+ @Test
+ public boolean test29() {
+ try {
+ System.setProperty(XMLInputFactoryID, XMLInputFactoryClassName);
+ XMLInputFactory xif = XMLInputFactory.newInstance(XMLInputFactoryID, CL);
+ if (xif instanceof XMLInputFactory) {
+ System.out.println(" test29() passed");
+ return PASSED;
+ } else {
+ System.out.println(" test29() failed");
+ Temp_Result = "test29() failed: xif not an instance of XMLInputFactory ";
+ return FAILED;
+ }
+ } catch (javax.xml.stream.FactoryConfigurationError fce) {
+ System.out.println("Failed : FactoryConfigurationError in test29 " + fce);
+ Temp_Result = "test29() failed ";
+ return FAILED;
+ } catch (Exception e) {
+ System.out.println("Failed : Exception in test29 " + e);
+ Temp_Result = "test29() failed ";
+ return FAILED;
+ }
+ }
+
+ /*
+ * test for XMLInputFactory.newInstance(java.lang.String factoryClassName,
+ * java.lang.ClassLoader classLoader) classloader is
+ * default(Class.getClassLoader()) and factoryClassName points to correct
+ * implementation of javax.xml.stream.XMLInputFactory , should return
+ * newInstance of XMLInputFactory
+ */
+ @Test
+ public boolean test31() {
+ try {
+ Bug6756677Test test3 = new Bug6756677Test();
+ ClassLoader cl = (test3.getClass()).getClassLoader();
+ System.setProperty(XMLInputFactoryID, XMLInputFactoryClassName);
+ XMLInputFactory xif = XMLInputFactory.newInstance(XMLInputFactoryID, cl);
+ if (xif instanceof XMLInputFactory) {
+ System.out.println(" test31() passed");
+ return PASSED;
+ } else {
+ System.out.println(" test31() failed");
+ Temp_Result = "test31() failed: xif not an instance of XMLInputFactory ";
+ return FAILED;
+ }
+ } catch (javax.xml.stream.FactoryConfigurationError fce) {
+ System.out.println("Failed : FactoryConfigurationError in test31 " + fce);
+ Temp_Result = "test31() failed ";
+ return FAILED;
+ } catch (Exception e) {
+ System.out.println("Failed : Exception in test31 " + e);
+ Temp_Result = "test31() failed ";
+ return FAILED;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6909759Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6909759Test.java
new file mode 100644
index 00000000000..1c699c83323
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/Bug6909759Test.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLInputFactoryTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6909759
+ * @summary Test createXMLStreamReader with StreamSource.
+ */
+public class Bug6909759Test {
+
+
+ @Test
+ public void testCreateXMLStreamReader() {
+
+ try {
+ StreamSource ss = new StreamSource(getClass().getResourceAsStream("play.xml"));
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ // File file = new File("./tests/XMLStreamReader/sgml.xml");
+ // FileInputStream inputStream = new FileInputStream(file);
+ XMLStreamReader xsr;
+ xsr = xif.createXMLStreamReader(ss);
+
+ while (xsr.hasNext()) {
+ int eventType = xsr.next();
+ }
+
+ } catch (UnsupportedOperationException oe) {
+ Assert.fail("StreamSource should be supported");
+ } catch (XMLStreamException ex) {
+ Assert.fail("fix the test");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/IssueTracker38.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/IssueTracker38.java
new file mode 100644
index 00000000000..f468d7a0f41
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/IssueTracker38.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLInputFactoryTest;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test createXMLEventReader from DOM or SAX source is unsupported.
+ */
+public class IssueTracker38 {
+
+ @Test
+ public void testXMLEventReaderFromDOMSource() throws Exception {
+ try {
+ createEventReaderFromSource(new DOMSource());
+ Assert.fail("Expected UnsupportedOperationException not thrown");
+ } catch (UnsupportedOperationException e) {
+ }
+ }
+
+ @Test
+ public void testXMLStreamReaderFromDOMSource() throws Exception {
+ try {
+ createStreamReaderFromSource(new DOMSource());
+ Assert.fail("Expected UnsupportedOperationException not thrown");
+ } catch (UnsupportedOperationException oe) {
+ }
+ }
+
+ @Test
+ public void testXMLEventReaderFromSAXSource() throws Exception {
+ try {
+ createEventReaderFromSource(new SAXSource());
+ Assert.fail("Expected UnsupportedOperationException not thrown");
+ } catch (UnsupportedOperationException e) {
+ }
+ }
+
+ @Test
+ public void testXMLStreamReaderFromSAXSource() throws Exception {
+ try {
+ createStreamReaderFromSource(new SAXSource());
+ Assert.fail("Expected UnsupportedOperationException not thrown");
+ } catch (UnsupportedOperationException oe) {
+ }
+ }
+
+ private void createEventReaderFromSource(Source source) throws Exception {
+ XMLInputFactory xIF = XMLInputFactory.newInstance();
+ xIF.createXMLEventReader(source);
+ }
+
+ private void createStreamReaderFromSource(Source source) throws Exception {
+ XMLInputFactory xIF = XMLInputFactory.newInstance();
+ xIF.createXMLStreamReader(source);
+ }
+
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/MyInputFactory.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/MyInputFactory.java
new file mode 100644
index 00000000000..581c122585c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/MyInputFactory.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLInputFactoryTest;
+
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.stream.EventFilter;
+import javax.xml.stream.StreamFilter;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLReporter;
+import javax.xml.stream.XMLResolver;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.util.XMLEventAllocator;
+import javax.xml.transform.Source;
+
+public class MyInputFactory extends javax.xml.stream.XMLInputFactory {
+
+ @Override
+ public XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLStreamReader createXMLStreamReader(InputStream stream) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLStreamReader createXMLStreamReader(InputStream stream, String encoding) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLStreamReader createXMLStreamReader(String systemId, InputStream stream) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLStreamReader createXMLStreamReader(String systemId, Reader reader) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(XMLStreamReader reader) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(Source source) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(InputStream stream) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(InputStream stream, String encoding) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createXMLEventReader(String systemId, InputStream stream) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLResolver getXMLResolver() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setXMLResolver(XMLResolver resolver) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLReporter getXMLReporter() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setXMLReporter(XMLReporter reporter) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setProperty(String name, Object value) throws IllegalArgumentException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Object getProperty(String name) throws IllegalArgumentException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isPropertySupported(String name) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setEventAllocator(XMLEventAllocator allocator) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public XMLEventAllocator getEventAllocator() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/play.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/play.xml
new file mode 100644
index 00000000000..2d37d28bb8a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLInputFactoryTest/play.xml
@@ -0,0 +1,6 @@
+
+ The Tragedy of Hamlet
+ Prince of Denmark
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/Bug6846132Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/Bug6846132Test.java
new file mode 100644
index 00000000000..9e5093d35e6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/Bug6846132Test.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLOutputFactoryTest;
+
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.sax.SAXResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6846132
+ * @summary Test createXMLStreamWriter with SAXResult won't throw a NullPointerException.
+ */
+public class Bug6846132Test {
+
+ @Test
+ public void testSAXResult() {
+ DefaultHandler handler = new DefaultHandler();
+
+ final String EXPECTED_OUTPUT = "";
+ try {
+ SAXResult saxResult = new SAXResult(handler);
+ // saxResult.setSystemId("jaxp-ri/unit-test/javax/xml/stream/XMLOutputFactoryTest/cr6846132.xml");
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ XMLStreamWriter writer = ofac.createXMLStreamWriter(saxResult);
+ writer.writeStartDocument("1.0");
+ writer.writeStartElement("root");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ writer.flush();
+ writer.close();
+ } catch (Exception e) {
+ if (e instanceof UnsupportedOperationException) {
+ // expected
+ } else {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+ }
+
+ @Test
+ public void testSAXResult1() {
+ DefaultHandler handler = new DefaultHandler();
+
+ try {
+ SAXResult saxResult = new SAXResult(handler);
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ XMLEventWriter writer = ofac.createXMLEventWriter(saxResult);
+ } catch (Exception e) {
+ if (e instanceof UnsupportedOperationException) {
+ // expected
+ } else {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/DuplicateNSDeclarationTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/DuplicateNSDeclarationTest.java
new file mode 100644
index 00000000000..64517c363ed
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/DuplicateNSDeclarationTest.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLOutputFactoryTest;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test the writing of duplicate namespace declarations when IS_REPAIRING_NAMESPACES is ture.
+ */
+public class DuplicateNSDeclarationTest {
+
+ @Test
+ public void testDuplicateNSDeclaration() {
+
+ // expect only 1 Namespace Declaration
+ final String EXPECTED_OUTPUT = "" + "" + "";
+
+ // have XMLOutputFactory repair Namespaces
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ ofac.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+
+ // send output to a Stream
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ StreamResult sr = new StreamResult(buffer);
+ XMLStreamWriter w = null;
+
+ // write a duplicate Namespace Declaration
+ try {
+ w = ofac.createXMLStreamWriter(sr);
+ w.writeStartDocument();
+ w.writeStartElement("ns1", "foo", "http://example.com/");
+ w.writeNamespace("ns1", "http://example.com/");
+ w.writeNamespace("ns1", "http://example.com/");
+ w.writeEndElement();
+ w.writeEndDocument();
+ w.close();
+ } catch (XMLStreamException xmlStreamException) {
+ xmlStreamException.printStackTrace();
+ Assert.fail(xmlStreamException.toString());
+ }
+
+ // debugging output for humans
+ System.out.println();
+ System.out.println("actual: \"" + buffer.toString() + "\"");
+ System.out.println("expected: \"" + EXPECTED_OUTPUT + "\"");
+
+ // are results as expected?
+ Assert.assertEquals(EXPECTED_OUTPUT, buffer.toString());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/StreamResultTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/StreamResultTest.java
new file mode 100644
index 00000000000..368c80c1b0d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLOutputFactoryTest/StreamResultTest.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLOutputFactoryTest;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test create XMLWriter with variant Result.
+ */
+public class StreamResultTest {
+
+ @Test
+ public void testStreamResult() {
+ final String EXPECTED_OUTPUT = "";
+ try {
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ StreamResult sr = new StreamResult(buffer);
+ XMLStreamWriter writer = ofac.createXMLStreamWriter(sr);
+ writer.writeStartDocument("1.0");
+ writer.writeStartElement("root");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ writer.close();
+ Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public void testStreamWriterWithStAXResultNStreamWriter() {
+ final String EXPECTED_OUTPUT = "";
+
+ try {
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ XMLStreamWriter writer = ofac.createXMLStreamWriter(buffer);
+ StAXResult res = new StAXResult(writer);
+ writer = ofac.createXMLStreamWriter(res);
+ writer.writeStartDocument("1.0");
+ writer.writeStartElement("root");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ writer.close();
+ Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public void testEventWriterWithStAXResultNStreamWriter() {
+ String encoding = "";
+ if (System.getProperty("file.encoding").equals("UTF-8")) {
+ encoding = " encoding=\"UTF-8\"";
+ }
+ final String EXPECTED_OUTPUT = "";
+
+ try {
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ XMLStreamWriter swriter = ofac.createXMLStreamWriter(buffer);
+ StAXResult res = new StAXResult(swriter);
+ XMLEventWriter writer = ofac.createXMLEventWriter(res);
+
+ XMLEventFactory efac = XMLEventFactory.newInstance();
+ writer.add(efac.createStartDocument(null, "1.0"));
+ writer.add(efac.createStartElement("", "", "root"));
+ writer.add(efac.createEndElement("", "", "root"));
+ writer.add(efac.createEndDocument());
+ writer.close();
+
+ Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public void testEventWriterWithStAXResultNEventWriter() {
+ String encoding = "";
+ if (System.getProperty("file.encoding").equals("UTF-8")) {
+ encoding = " encoding=\"UTF-8\"";
+ }
+ final String EXPECTED_OUTPUT = "";
+
+ try {
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ XMLEventWriter writer = ofac.createXMLEventWriter(buffer);
+ StAXResult res = new StAXResult(writer);
+ writer = ofac.createXMLEventWriter(res);
+
+ XMLEventFactory efac = XMLEventFactory.newInstance();
+ writer.add(efac.createStartDocument(null, "1.0"));
+ writer.add(efac.createStartElement("", "", "root"));
+ writer.add(efac.createEndElement("", "", "root"));
+ writer.add(efac.createEndDocument());
+ writer.close();
+
+ Assert.assertEquals(buffer.toString(), EXPECTED_OUTPUT);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public void testStreamWriterWithStAXResultNEventWriter() throws Exception {
+ try {
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ XMLEventWriter writer = ofac.createXMLEventWriter(buffer);
+ StAXResult res = new StAXResult(writer);
+ XMLStreamWriter swriter = ofac.createXMLStreamWriter(res);
+ Assert.fail("Expected an Exception as XMLStreamWriter can't be created " + "with a StAXResult which has EventWriter.");
+ } catch (Exception e) {
+ System.out.println(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.java
new file mode 100644
index 00000000000..9d4ca307fff
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLResolverTest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLResolver;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLResolver.
+ */
+public class XMLResolverTest {
+
+ @Test
+ public void testXMLResolver() {
+ try {
+ XMLInputFactory xifactory = XMLInputFactory.newInstance();
+ xifactory.setProperty(XMLInputFactory.RESOLVER, new MyStaxResolver());
+ File file = new File(getClass().getResource("XMLResolverTest.xml").getFile());
+ String systemId = file.toURI().toString();
+ InputStream entityxml = new FileInputStream(file);
+ XMLStreamReader streamReader = xifactory.createXMLStreamReader(systemId, entityxml);
+ while (streamReader.hasNext()) {
+ int eventType = streamReader.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ eventType = streamReader.next();
+ if (eventType == XMLStreamConstants.CHARACTERS) {
+ String text = streamReader.getText();
+ Assert.assertTrue(text.contains("replace2"));
+ }
+ }
+ }
+ } catch (XMLStreamException ex) {
+
+ if (ex.getNestedException() != null) {
+ ex.getNestedException().printStackTrace();
+ }
+ // ex.printStackTrace() ;
+ } catch (Exception io) {
+ io.printStackTrace();
+ }
+ }
+
+ class MyStaxResolver implements XMLResolver {
+
+ public MyStaxResolver() {
+
+ }
+
+ public Object resolveEntity(String publicId, String systemId, String baseURI, String namespace) throws javax.xml.stream.XMLStreamException {
+
+ Object object = null;
+ try {
+ object = new FileInputStream(getClass().getResource("replace2.txt").getFile());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return object;
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.xml
new file mode 100644
index 00000000000..6d1d62f6da0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/XMLResolverTest.xml
@@ -0,0 +1,13 @@
+
+
+
+
+]>
+&replace;
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace1.txt b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace1.txt
new file mode 100644
index 00000000000..bad3db38def
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace1.txt
@@ -0,0 +1,2 @@
+replace1
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace2.txt b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace2.txt
new file mode 100644
index 00000000000..c80a0962715
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLResolverTest/replace2.txt
@@ -0,0 +1,2 @@
+replace2
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamExceptionTest/ExceptionTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamExceptionTest/ExceptionTest.java
new file mode 100644
index 00000000000..a64d93f1dd8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamExceptionTest/ExceptionTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamExceptionTest;
+
+import java.io.IOException;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamException contains the message of the wrapped exception.
+ */
+public class ExceptionTest {
+
+ @Test
+ public void testException() {
+
+ final String EXPECTED_OUTPUT = "Test XMLStreamException";
+ try {
+ Exception ex = new IOException("Test XMLStreamException");
+ throw new XMLStreamException(ex);
+ } catch (XMLStreamException e) {
+ Assert.assertTrue(e.getMessage().contains(EXPECTED_OUTPUT), "XMLStreamException does not contain the message " + "of the wrapped exception");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481615.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481615.java
new file mode 100644
index 00000000000..25bc88d22d6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481615.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamFilterTest;
+
+import java.io.StringReader;
+
+import javax.xml.stream.StreamFilter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6481615
+ * @summary Test Filtered XMLStreamReader can return the event type if current state is START_ELEMENT.
+ */
+public class Bug6481615 {
+
+ static final String XML = "" + "";
+
+ private XMLInputFactory factory = XMLInputFactory.newInstance();
+
+ @Test
+ public void test() {
+ try {
+ XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(XML));
+ reader.next(); // advance to START_ELEMENT
+ XMLStreamReader filter = factory.createFilteredReader(reader, new Filter());
+ Assert.assertTrue(filter.getEventType() != -1);
+ } catch (Exception e) {
+ e.printStackTrace();
+ // Assert.fail("Unexpected Exception: " + e.getMessage());
+ }
+ }
+
+ class Filter implements StreamFilter {
+
+ public boolean accept(XMLStreamReader reader) {
+ return true;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481678.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481678.java
new file mode 100644
index 00000000000..1f697b775a5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/Bug6481678.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamFilterTest;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.EventFilter;
+import javax.xml.stream.StreamFilter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6481678
+ * @summary Test Filtered XMLStreamReader parses namespace correctly.
+ */
+public class Bug6481678 {
+
+ String rootElement = "fruits";
+ String childElement = "varieties";
+ String prefixApple = "a";
+ String namespaceURIApple = "apple.fruit";
+ String prefixOrange = "o";
+ String namespaceURIOrange = "orange.fruit";
+ String namespaceURIBanana = "banana.fruit";
+
+ TypeFilter filter;
+ XMLInputFactory factory;
+ InputStream is;
+
+ /** Creates a new instance of NamespaceTest */
+ public Bug6481678(java.lang.String testName) {
+ init();
+ }
+
+ private void init() {
+ factory = XMLInputFactory.newInstance();
+ factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ filter = createFilter();
+ }
+
+ String getXML() {
+ StringBuffer sbuffer = new StringBuffer();
+ sbuffer.append("");
+ sbuffer.append("<" + rootElement + " state=\"WA\"");
+ sbuffer.append(" xmlns:" + prefixApple + "=\"" + namespaceURIApple + "\"");
+ sbuffer.append(" xmlns:" + prefixOrange + "=\"" + namespaceURIOrange + "\"");
+ sbuffer.append(" xmlns=\"" + namespaceURIBanana + "\">");
+ sbuffer.append("<" + prefixApple + ":" + childElement + ">");
+ sbuffer.append("<" + prefixApple + ":fuji/>");
+ sbuffer.append("<" + prefixApple + ":gala/>");
+ sbuffer.append("" + prefixApple + ":" + childElement + ">");
+ sbuffer.append("" + rootElement + ">");
+ // System.out.println("XML = " + sbuffer.toString()) ;
+ return sbuffer.toString();
+ }
+
+ public TypeFilter createFilter() {
+
+ TypeFilter f = new TypeFilter();
+
+ f.addType(XMLEvent.START_ELEMENT);
+ f.addType(XMLEvent.END_ELEMENT);
+ f.addType(XMLEvent.PROCESSING_INSTRUCTION);
+ f.addType(XMLEvent.CHARACTERS);
+ f.addType(XMLEvent.COMMENT);
+ f.addType(XMLEvent.SPACE);
+ f.addType(XMLEvent.START_DOCUMENT);
+ f.addType(XMLEvent.END_DOCUMENT);
+ return f;
+ }
+
+ /*
+ * testcase for cr6481678 in our current impl (using cache), the reader
+ * would read from cache when getters are called before next() is. refter to
+ * testRootElementNamespace.
+ */
+ @Test
+ public void testReadingNamespace() {
+ is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ try {
+ XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter);
+
+ while (sr.hasNext()) {
+ int eventType = sr.getEventType();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(rootElement)) {
+ Assert.assertTrue(sr.getNamespacePrefix(0).equals(prefixApple) && sr.getNamespaceURI(0).equals(namespaceURIApple));
+ }
+ }
+ eventType = sr.next();
+ }
+ } catch (Exception ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+ @Test
+ public void testRootElementNamespace() {
+ is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ try {
+ XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter);
+
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(rootElement)) {
+ Assert.assertTrue(sr.getNamespacePrefix(0).equals(prefixApple) && sr.getNamespaceURI(0).equals(namespaceURIApple));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+ @Test
+ public void testChildElementNamespace() {
+ is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ try {
+ XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(childElement)) {
+ QName qname = sr.getName();
+ Assert.assertTrue(qname.getPrefix().equals(prefixApple) && qname.getNamespaceURI().equals(namespaceURIApple)
+ && qname.getLocalPart().equals(childElement));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+ @Test
+ public void testNamespaceContext() {
+ is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ try {
+ XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(childElement)) {
+ NamespaceContext context = sr.getNamespaceContext();
+ Assert.assertTrue(context.getPrefix(namespaceURIApple).equals(prefixApple));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+ @Test
+ public void testNamespaceCount() {
+ is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ try {
+ XMLStreamReader sr = factory.createFilteredReader(factory.createXMLStreamReader(is), (StreamFilter) filter);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(rootElement)) {
+ int count = sr.getNamespaceCount();
+ Assert.assertTrue(count == 3);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+ class TypeFilter implements EventFilter, StreamFilter {
+
+ protected boolean[] types = new boolean[20];
+
+ public TypeFilter() {
+ }
+
+ public void addType(int type) {
+ types[type] = true;
+ }
+
+ public boolean accept(XMLEvent e) {
+ return types[e.getEventType()];
+ }
+
+ public boolean accept(XMLStreamReader r) {
+ return types[r.getEventType()];
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.java
new file mode 100644
index 00000000000..5625f78177f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamFilterTest;
+
+import javax.xml.stream.StreamFilter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test Filtered XMLStreamReader hasNext() always return the correct value if repeat to call it.
+ */
+public class HasNextTest {
+
+ private static String INPUT_FILE = "HasNextTest.xml";
+
+ private HasNextTypeFilter createFilter() {
+
+ HasNextTypeFilter f = new HasNextTypeFilter();
+
+ f.addType(XMLEvent.START_ELEMENT);
+ f.addType(XMLEvent.END_ELEMENT);
+ f.addType(XMLEvent.PROCESSING_INSTRUCTION);
+ f.addType(XMLEvent.CHARACTERS);
+ f.addType(XMLEvent.COMMENT);
+ f.addType(XMLEvent.SPACE);
+ f.addType(XMLEvent.START_DOCUMENT);
+ f.addType(XMLEvent.END_DOCUMENT);
+ return f;
+ }
+
+ private XMLStreamReader createStreamReader(HasNextTypeFilter f) {
+
+ try {
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ factory = XMLInputFactory.newInstance();
+ return factory.createFilteredReader(factory.createXMLStreamReader(this.getClass().getResourceAsStream(INPUT_FILE)), (StreamFilter) f);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Unexpected Exception: " + e.getMessage());
+ return null;
+ }
+ }
+
+ private void checkHasNext(XMLStreamReader r1) throws XMLStreamException {
+
+ // try asking 3 times, insure all results are the same
+ boolean hasNext_1 = r1.hasNext();
+ boolean hasNext_2 = r1.hasNext();
+ boolean hasNext_3 = r1.hasNext();
+
+ System.out.println("XMLStreamReader.hasNext() (1): " + hasNext_1);
+ System.out.println("XMLStreamReader.hasNext() (2): " + hasNext_2);
+ System.out.println("XMLStreamReader.hasNext() (3): " + hasNext_3);
+
+ Assert.assertTrue((hasNext_1 == hasNext_2) && (hasNext_1 == hasNext_3),
+ "XMLStreamReader.hasNext() returns inconsistent values for each subsequent call: " + hasNext_1 + ", " + hasNext_2 + ", " + hasNext_3);
+ }
+
+ @Test
+ public void testFilterUsingNextTag() {
+
+ try {
+ HasNextTypeFilter f = createFilter();
+ XMLStreamReader r1 = createStreamReader(f);
+
+ while (r1.hasNext()) {
+ try {
+ r1.nextTag();
+ } catch (Exception e) {
+ System.err.println("Expected Exception: " + e.getMessage());
+ e.printStackTrace();
+ }
+
+ checkHasNext(r1);
+ }
+
+ } catch (XMLStreamException e) {
+ System.err.println("Unexpected Exception: " + e.getMessage());
+ e.printStackTrace();
+ Assert.fail("Unexpected Exception: " + e.toString());
+ } catch (Exception e) {
+ // if this is END_DOCUMENT, it is expected
+ if (e.toString().indexOf("END_DOCUMENT") != -1) {
+ // expected
+ System.err.println("Expected Exception:");
+ e.printStackTrace();
+ } else {
+ // unexpected
+ System.err.println("Unexpected Exception: " + e.getMessage());
+ e.printStackTrace();
+ Assert.fail("Unexpected Exception: " + e.toString());
+ }
+ }
+ }
+
+ @Test
+ public void testFilterUsingNext() {
+
+ try {
+ HasNextTypeFilter f = createFilter();
+ XMLStreamReader r1 = createStreamReader(f);
+
+ while (r1.hasNext()) {
+ r1.next();
+ checkHasNext(r1);
+ }
+
+ } catch (Exception e) {
+ // unexpected
+ System.err.println("Unexpected Exception: " + e.getMessage());
+ e.printStackTrace();
+ Assert.fail("Unexpected Exception: " + e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.xml
new file mode 100644
index 00000000000..7b91e3cc71b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTest.xml
@@ -0,0 +1,9 @@
+
+this is some text
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTypeFilter.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTypeFilter.java
new file mode 100644
index 00000000000..95b3f505a27
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamFilterTest/HasNextTypeFilter.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamFilterTest;
+
+import javax.xml.stream.EventFilter;
+import javax.xml.stream.StreamFilter;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.XMLEvent;
+
+public class HasNextTypeFilter implements EventFilter, StreamFilter {
+
+ protected boolean[] types = new boolean[20];
+
+ public HasNextTypeFilter() {
+ }
+
+ public void addType(int type) {
+ types[type] = true;
+ }
+
+ public boolean accept(XMLEvent e) {
+ return types[e.getEventType()];
+ }
+
+ public boolean accept(XMLStreamReader r) {
+ return types[r.getEventType()];
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BOMTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BOMTest.java
new file mode 100644
index 00000000000..eb7c3b44770
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BOMTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6218794
+ * @summary Test XMLStreamReader parses BOM UTF-8 and BOM UTF-16 big endian stream.
+ */
+public class BOMTest {
+ // UTF-8 BOM test file
+ private static final String INPUT_FILE1 = "UTF8-BOM.xml.data";
+ // UTF-16 Big Endian test file
+ private static final String INPUT_FILE2 = "UTF16-BE.wsdl.data";
+
+ @Test
+ public void testBOM() {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+ try {
+ XMLStreamReader re = ifac.createXMLStreamReader(this.getClass().getResource(INPUT_FILE1).toExternalForm(),
+ util.BOMInputStream.createStream("UTF-8", this.getClass().getResourceAsStream(INPUT_FILE1)));
+ while (re.hasNext()) {
+ int event = re.next();
+ }
+ XMLStreamReader re2 = ifac.createXMLStreamReader(this.getClass().getResource(INPUT_FILE2).toExternalForm(),
+ util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE2)));
+ while (re2.hasNext()) {
+
+ int event = re2.next();
+
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6388460.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6388460.java
new file mode 100644
index 00000000000..4d6b58ad41a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6388460.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 6388460
+ * @summary Test StAX parser can parse UTF-16 wsdl.
+ */
+public class Bug6388460 {
+
+ @Test
+ public void test() {
+ try {
+
+ Source source = new StreamSource(util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream("Hello.wsdl.data")),
+ this.getClass().getResource("Hello.wsdl.data").toExternalForm());
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer();
+ transformer.transform(source, new StreamResult(baos));
+ System.out.println(new String(baos.toByteArray()));
+ ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
+ InputSource inSource = new InputSource(bis);
+
+ XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
+ xmlInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(inSource.getSystemId(), inSource.getByteStream());
+ while (reader.hasNext()) {
+ reader.next();
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace(System.err);
+ Assert.fail("Exception occured: " + ex.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6472982Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6472982Test.java
new file mode 100644
index 00000000000..830718fe175
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6472982Test.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6472982
+ * @summary Test XMLStreamReader.getNamespaceContext().getPrefix("") won't throw IllegalArgumentException.
+ */
+public class Bug6472982Test {
+ String namespaceURI = "foobar.com";
+ String rootElement = "foo";
+ String childElement = "foochild";
+ String prefix = "a";
+
+ @Test
+ public void testNamespaceContext() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ XMLStreamReader sr = xif.createXMLStreamReader(is);
+ NamespaceContext context = sr.getNamespaceContext();
+ Assert.assertTrue(context.getPrefix("") == null);
+
+ } catch (IllegalArgumentException iae) {
+ Assert.fail("NamespacePrefix#getPrefix() should not throw an IllegalArgumentException for empty uri. ");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ String getXML() {
+ StringBuffer sbuffer = new StringBuffer();
+ sbuffer.append("");
+ sbuffer.append("<" + rootElement + " xmlns:");
+ sbuffer.append(prefix);
+ sbuffer.append("=\"" + namespaceURI + "\">");
+ sbuffer.append("<" + prefix + ":" + childElement + ">");
+ sbuffer.append("blahblah");
+ sbuffer.append("" + prefix + ":" + childElement + ">");
+ sbuffer.append("" + rootElement + ">");
+ // System.out.println("XML = " + sbuffer.toString()) ;
+ return sbuffer.toString();
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322.xml
new file mode 100644
index 00000000000..6cb07c7f317
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322.xml
@@ -0,0 +1,4 @@
+
+
+ Hello World!
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322Test.java
new file mode 100644
index 00000000000..fe0da552cc8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6767322Test.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6767322
+ * @summary Test XMLStreamReader.getVersion() returns null if a version isn't declared.
+ */
+public class Bug6767322Test {
+ private static final String INPUT_FILE = "Bug6767322.xml";
+
+ @Test
+ public void testVersionSet() {
+ try {
+ XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE));
+
+ String version = r.getVersion();
+ System.out.println("Bug6767322.xml: " + version);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testVersionNotSet() {
+ try {
+ String xmlText = "Version not declared";
+ XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(xmlText.getBytes()));
+ String version = r.getVersion();
+ System.out.println("Version for text \"" + xmlText + "\": " + version);
+ if (version != null) {
+ Assert.fail("getVersion should return null");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6847819Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6847819Test.java
new file mode 100644
index 00000000000..c9211c06781
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Bug6847819Test.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+
+/*
+ * @bug 6847819
+ * @summary Test StAX parser shall throw XMLStreamException for illegal xml declaration.
+ */
+public class Bug6847819Test {
+
+ @Test
+ public void testIllegalDecl() throws XMLStreamException {
+ String xml = "abc]]>xyz";
+ String msg = "illegal declaration";
+ try {
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ inputFactory.createXMLStreamReader(new StringReader(xml));
+ Assert.fail("Expected an exception for " + msg);
+ } catch (XMLStreamException ex) { // good
+ System.out.println("Expected failure: '" + ex.getMessage() + "' " + "(matching message: '" + msg + "')");
+ } catch (Exception ex2) { // ok; iff links to XMLStreamException
+ Throwable t = ex2;
+ while (t.getCause() != null && !(t instanceof XMLStreamException)) {
+ t = t.getCause();
+ }
+ if (t instanceof XMLStreamException) {
+ System.out.println("Expected failure: '" + ex2.getMessage() + "' " + "(matching message: '" + msg + "')");
+ }
+ if (t == ex2) {
+ Assert.fail("Expected an XMLStreamException (either direct, or getCause() of a primary exception) for " + msg + ", got: " + ex2);
+ }
+ Assert.fail("Expected an XMLStreamException (either direct, or getCause() of a primary exception) for " + msg + ", got: " + ex2 + " (root: " + t + ")");
+ }
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BugTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BugTest.java
new file mode 100644
index 00000000000..2499a07db4a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/BugTest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test StAX parser can parse xml without declaration.
+ */
+public class BugTest {
+
+ @Test
+ public static void test1() throws Exception {
+ XMLInputFactory xif = XMLInputFactory.newInstance(); // new
+ // com.sun.xml.stream.ZephyrParserFactory();
+ XMLStreamReader r = xif.createXMLStreamReader(new StringReader(""));
+ Assert.assertEquals(XMLStreamConstants.START_DOCUMENT, r.getEventType());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DefaultAttributeTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DefaultAttributeTest.java
new file mode 100644
index 00000000000..33e8c5b9353
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DefaultAttributeTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.util.Iterator;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.StartElement;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test StAX parses namespace and attribute.
+ */
+public class DefaultAttributeTest {
+
+ private static final String INPUT_FILE = "ExternalDTD.xml";
+
+ @Test
+ public void testStreamReader() {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+ XMLOutputFactory ofac = XMLOutputFactory.newInstance();
+
+ try {
+ ifac.setProperty(ifac.IS_REPLACING_ENTITY_REFERENCES, new Boolean(false));
+
+ XMLStreamReader re = ifac.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE));
+
+ while (re.hasNext()) {
+ int event = re.next();
+ if (event == XMLStreamConstants.START_ELEMENT && re.getLocalName().equals("bookurn")) {
+ Assert.assertTrue(re.getAttributeCount() == 0, "No attributes are expected for ");
+ Assert.assertTrue(re.getNamespaceCount() == 2, "Two namespaces are expected for ");
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testEventReader() {
+ try {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+ XMLEventReader read = ifac.createXMLEventReader(this.getClass().getResource(INPUT_FILE).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE));
+ while (read.hasNext()) {
+ XMLEvent event = read.nextEvent();
+ if (event.isStartElement()) {
+ StartElement startElement = event.asStartElement();
+ if (startElement.getName().getLocalPart().equals("bookurn")) {
+ Iterator iterator = startElement.getNamespaces();
+ int count = 0;
+ while (iterator.hasNext()) {
+ iterator.next();
+ count++;
+ }
+ Assert.assertTrue(count == 2, "Two namespaces are expected for ");
+
+ Iterator attributes = startElement.getAttributes();
+ count = 0;
+ while (attributes.hasNext()) {
+ iterator.next();
+ count++;
+ }
+ Assert.assertTrue(count == 0, "Zero attributes are expected for ");
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DoubleXmlnsTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DoubleXmlnsTest.java
new file mode 100644
index 00000000000..da73bd6cc91
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/DoubleXmlnsTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test double namespaces and nested namespaces.
+ */
+public class DoubleXmlnsTest {
+
+ @Test
+ public void testDoubleNS() throws Exception {
+
+ final String INVALID_XML = "";
+
+ try {
+ XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(INVALID_XML));
+
+ while (xsr.hasNext()) {
+ xsr.next();
+ }
+
+ Assert.fail("Wellformedness error expected: " + INVALID_XML);
+ } catch (XMLStreamException e) {
+ ; // this is expected
+ }
+ }
+
+ @Test
+ public void testNestedNS() throws Exception {
+
+ final String VALID_XML = "";
+
+ try {
+ XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(VALID_XML));
+
+ while (xsr.hasNext()) {
+ xsr.next();
+ }
+
+ // expected success
+ } catch (XMLStreamException e) {
+ e.printStackTrace();
+
+ Assert.fail("Wellformedness error is not expected: " + VALID_XML + ", " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDoubleXmlns() throws Exception {
+
+ final String INVALID_XML = "";
+
+ try {
+ XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(INVALID_XML));
+
+ while (xsr.hasNext()) {
+ xsr.next();
+ }
+
+ Assert.fail("Wellformedness error expected :" + INVALID_XML);
+ } catch (XMLStreamException e) {
+ ; // this is expected
+ }
+ }
+
+ @Test
+ public void testNestedXmlns() throws Exception {
+
+ final String VALID_XML = "";
+
+ try {
+ XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(VALID_XML));
+
+ while (xsr.hasNext()) {
+ xsr.next();
+ }
+
+ // expected success
+ } catch (XMLStreamException e) {
+ e.printStackTrace();
+ Assert.fail("Wellformedness error is not expected: " + VALID_XML + ", " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd
new file mode 100644
index 00000000000..6fbfdfeb67b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd.bak b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd.bak
new file mode 100644
index 00000000000..6fbfdfeb67b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.dtd.bak
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml
new file mode 100644
index 00000000000..c4fab83ca91
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml
@@ -0,0 +1,19 @@
+
+
+]>
+
+
+ The Publishers
+
+ Alfred Publishing
+ 15535 Morrison
+ South Oaks CA 91403
+ &max;
+
+ eXtensible Markup Language
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml.bak b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml.bak
new file mode 100644
index 00000000000..c4fab83ca91
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/ExternalDTD.xml.bak
@@ -0,0 +1,19 @@
+
+
+]>
+
+
+ The Publishers
+
+ Alfred Publishing
+ 15535 Morrison
+ South Oaks CA 91403
+ &max;
+
+ eXtensible Markup Language
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Hello.wsdl.data b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Hello.wsdl.data
new file mode 100644
index 00000000000..15db4aa7ebf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Hello.wsdl.data
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.java
new file mode 100644
index 00000000000..dcd2d39b2bb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6440324
+ * @summary Test StAX can accept non-existent DTD if IS_VALIDATING if false.
+ */
+public class IsValidatingTest {
+
+ /**
+ * File with non-existent DTD.
+ */
+ private static final String INPUT_FILE = "IsValidatingTest.xml";
+ /**
+ * File with internal subset and non-existent DTD.
+ */
+ private static final String INPUT_FILE_INTERNAL_SUBSET = "IsValidatingTestInternalSubset.xml";
+
+ /**
+ * Test StAX with IS_VALIDATING = false and a non-existent DTD.
+ * Test should pass.
+ *
+ * Try to parse an XML file that references a a non-existent DTD.
+ * Desired behavior:
+ * If IS_VALIDATING == false, then continue processing.
+ *
+ * Note that an attempt is made to read the DTD even if IS_VALIDATING == false.
+ * This is not required for DTD validation, but for entity resolution.
+ * The XML specification allows the optional reading of an external DTD
+ * even for non-validating processors.
+ *
+ */
+ @Test
+ public void testStAXIsValidatingFalse() {
+
+ XMLStreamReader reader = null;
+ Boolean isValidating = null;
+ String propertyValues = null;
+ boolean dtdEventOccured = false;
+
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
+
+ try {
+ reader = xif.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(), this.getClass().getResourceAsStream(INPUT_FILE));
+
+ isValidating = (Boolean) reader.getProperty(XMLInputFactory.IS_VALIDATING);
+ propertyValues = "IS_VALIDATING=" + isValidating;
+
+ while (reader.hasNext()) {
+ int e = reader.next();
+ if (e == XMLEvent.DTD) {
+ dtdEventOccured = true;
+ System.out.println("testStAXIsValidatingFalse(): " + "reader.getText() with Event == DTD: " + reader.getText());
+ }
+ }
+
+ // expected success
+
+ // should have see DTD Event
+ if (!dtdEventOccured) {
+ Assert.fail("Unexpected failure: did not see DTD event");
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ System.err.println("Exception with reader.getEventType(): " + reader.getEventType());
+ e.printStackTrace();
+ Assert.fail("Unexpected failure with " + propertyValues + ", " + e.toString());
+ }
+ }
+
+ /**
+ * Test StAX with IS_VALIDATING = false, an internal subset and a
+ * non-existent DTD.
+ *
+ * Test should pass.
+ */
+ @Test
+ public void testStAXIsValidatingFalseInternalSubset() {
+
+ XMLStreamReader reader = null;
+ Boolean isValidating = null;
+ String propertyValues = null;
+ boolean dtdEventOccured = false;
+ boolean entityReferenceEventOccured = false;
+
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
+ xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
+
+ try {
+ reader = xif.createXMLStreamReader(this.getClass().getResource(INPUT_FILE).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE_INTERNAL_SUBSET));
+
+ isValidating = (Boolean) reader.getProperty(XMLInputFactory.IS_VALIDATING);
+ propertyValues = "IS_VALIDATING=" + isValidating;
+
+ while (reader.hasNext()) {
+ int e = reader.next();
+ if (e == XMLEvent.DTD) {
+ dtdEventOccured = true;
+ System.out.println("testStAXIsValidatingFalseInternalSubset(): " + "reader.getText() with Event == DTD: " + reader.getText());
+ } else if (e == XMLEvent.ENTITY_REFERENCE) {
+ // expected ENTITY_REFERENCE values?
+ if (reader.getLocalName().equals("foo") && reader.getText().equals("bar")) {
+ entityReferenceEventOccured = true;
+ }
+
+ System.out.println("testStAXIsValidatingFalseInternalSubset(): " + "reader.get(LocalName, Text)() with Event " + " == ENTITY_REFERENCE: "
+ + reader.getLocalName() + " = " + reader.getText());
+ }
+ }
+
+ // expected success
+
+ // should have see DTD Event
+ if (!dtdEventOccured) {
+ Assert.fail("Unexpected failure: did not see DTD event");
+ }
+
+ // should have seen an ENITY_REFERENCE Event
+ if (!entityReferenceEventOccured) {
+ Assert.fail("Unexpected failure: did not see ENTITY_REFERENCE event");
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ System.err.println("Exception with reader.getEventType(): " + reader.getEventType());
+ e.printStackTrace();
+ Assert.fail("Unexpected failure with " + propertyValues + ", " + e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.xml
new file mode 100644
index 00000000000..cc50489b199
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTest.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+ Hello World!
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTestInternalSubset.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTestInternalSubset.xml
new file mode 100644
index 00000000000..1de5c8446d6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IsValidatingTestInternalSubset.xml
@@ -0,0 +1,32 @@
+
+
+
+
+]>
+
+ Hello &foo; World!
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue44Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue44Test.java
new file mode 100644
index 00000000000..47ed0bc9ff9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue44Test.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6631262
+ * @summary Test XMLStreamReader.getName() shall throw IllegalStateException if current event is not start/end element.
+ */
+public class Issue44Test {
+
+ @Test
+ public void testStartElement() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ // File file = new File("./tests/XMLStreamReader/sgml.xml");
+ // FileInputStream inputStream = new FileInputStream(file);
+ XMLStreamReader xsr = xif.createXMLStreamReader(this.getClass().getResourceAsStream("sgml.xml"));
+
+ xsr.getName();
+ } catch (IllegalStateException ise) {
+ // expected
+ System.out.println(ise.getMessage());
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue47Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue47Test.java
new file mode 100644
index 00000000000..736971d1f5a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Issue47Test.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6631265
+ * @summary Test XMLStreamReader.standaloneSet() presents if input document has a value for "standalone" attribute in xml declaration.
+ */
+public class Issue47Test {
+
+ @Test
+ public void testStandaloneSet() {
+ final String xml = "";
+
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ XMLStreamReader r = xif.createXMLStreamReader(new StringReader(xml));
+ Assert.assertTrue(!r.standaloneSet() && !r.isStandalone());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStandaloneSet1() {
+ final String xml = "";
+
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ XMLStreamReader r = xif.createXMLStreamReader(new StringReader(xml));
+ Assert.assertTrue(r.standaloneSet() && !r.isStandalone());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStandaloneSet2() {
+ final String xml = "";
+
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ XMLStreamReader r = xif.createXMLStreamReader(new StringReader(xml));
+ AssertJUnit.assertTrue(r.standaloneSet() && r.isStandalone());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker24.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker24.java
new file mode 100644
index 00000000000..0d2f723fcd1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker24.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test no prefix is represented by "", not null.
+ */
+public class IssueTracker24 {
+
+ @Test
+ public void testInconsistentGetPrefixBehaviorWhenNoPrefix() throws Exception {
+ String xml = "";
+
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLStreamReader r = factory.createXMLStreamReader(new StringReader(xml));
+ r.require(XMLStreamReader.START_DOCUMENT, null, null);
+ r.next();
+ r.require(XMLStreamReader.START_ELEMENT, null, "root");
+ Assert.assertEquals(r.getPrefix(), "", "prefix should be empty string");
+ r.next();
+ r.require(XMLStreamReader.START_ELEMENT, null, "child");
+ r.next();
+ r.next();
+ r.require(XMLStreamReader.START_ELEMENT, null, "anotherchild");
+ Assert.assertEquals(r.getPrefix(), "", "prefix should be empty string");
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker35.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker35.java
new file mode 100644
index 00000000000..2f93c9810b6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker35.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test StAX parse xsd document including external DTD.
+ */
+public class IssueTracker35 {
+
+ @Test
+ public void testSkippingExternalDTD() throws Exception {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ try(
+ InputStream is= getClass().getResourceAsStream("XMLSchema.xsd");
+ ) {
+ XMLStreamReader reader = xif.createXMLStreamReader(getClass().getResource("XMLSchema.xsd").getFile(), is);
+ int e;
+ while ((e = reader.next()) == XMLStreamConstants.COMMENT);
+
+ Assert.assertEquals(e, XMLStreamConstants.DTD, "should be DTD");
+ reader.nextTag();
+ Assert.assertEquals(reader.getLocalName(), "schema", "next tag should be schema");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.java
new file mode 100644
index 00000000000..ed9dc284943
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.function.Consumer;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test it can retrieve attribute with null or empty name space.
+ */
+public class IssueTracker70 {
+
+ static private final File testFile = new File(IssueTracker70.class.getResource("IssueTracker70.xml").getFile());
+
+ @Test
+ public void testGetAttributeValueWithNullNs() throws Exception {
+ testGetAttributeValueWithNs(null, "attribute2", this::checkNull);
+ }
+
+ @Test
+ public void testGetAttributeValueWithEmptyNs() throws Exception {
+ testGetAttributeValueWithNs("", "attribute1", this::checkNull);
+ }
+
+
+ private void testGetAttributeValueWithNs(String nameSpace, String attrName, Consumer checker) throws Exception {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ XMLStreamReader xsr = xif.createXMLStreamReader(new FileInputStream(testFile));
+
+ while (xsr.hasNext()) {
+ xsr.next();
+ if (xsr.isStartElement()) {
+ String v;
+ v = xsr.getAttributeValue(nameSpace, attrName);
+ checker.accept(v);
+ }
+ }
+ }
+
+ private void checkNull(String value)
+ {
+ Assert.assertNotNull(value, "should have attribute value");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.xml
new file mode 100644
index 00000000000..2cfeba3fa48
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/IssueTracker70.xml
@@ -0,0 +1,3 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5.xml
new file mode 100644
index 00000000000..7c4f7dacff5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5Test.java
new file mode 100644
index 00000000000..c58fd03908d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req5Test.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamReader parses namespace declaration within element when NamespaceAware turns off and on.
+ */
+public class Jsr173MR1Req5Test {
+
+ private static final String INPUT_FILE1 = "Jsr173MR1Req5.xml";
+
+ @Test
+ public void testAttributeCountNoNS() {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+
+ try {
+ // Turn off NS awareness to count xmlns as attributes
+ ifac.setProperty("javax.xml.stream.isNamespaceAware", Boolean.FALSE);
+
+ XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE1));
+ while (re.hasNext()) {
+ int event = re.next();
+ if (event == XMLStreamConstants.START_ELEMENT) {
+ // System.out.println("#attrs = " + re.getAttributeCount());
+ Assert.assertTrue(re.getAttributeCount() == 3);
+ }
+ }
+ re.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testAttributeCountNS() {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+
+ try {
+ // Turn on NS awareness to not count xmlns as attributes
+ ifac.setProperty("javax.xml.stream.isNamespaceAware", Boolean.TRUE);
+
+ XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE1));
+ while (re.hasNext()) {
+ int event = re.next();
+ if (event == XMLStreamConstants.START_ELEMENT) {
+ // System.out.println("#attrs = " + re.getAttributeCount());
+ Assert.assertTrue(re.getAttributeCount() == 1);
+ }
+ }
+ re.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8.xml
new file mode 100644
index 00000000000..3bc4dbf5e2c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8Test.java
new file mode 100644
index 00000000000..c39106f24bc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/Jsr173MR1Req8Test.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamReader parses attribute with namespace aware.
+ */
+public class Jsr173MR1Req8Test {
+
+ private static final String INPUT_FILE1 = "Jsr173MR1Req8.xml";
+
+ @Test
+ public void testDefaultAttrNS() {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+
+ try {
+ XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE1));
+ while (re.hasNext()) {
+ int event = re.next();
+ if (event == XMLStreamConstants.START_ELEMENT) {
+ // System.out.println("#attrs = " + re.getAttributeCount());
+ Assert.assertTrue(re.getAttributeCount() == 2);
+ // This works if "" is replaced by null too
+ // System.out.println("attr1 = " + re.getAttributeValue("",
+ // "attr1"));
+ Assert.assertTrue(re.getAttributeValue("", "attr1").equals("pass"));
+ }
+ }
+ re.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/NamespaceTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/NamespaceTest.java
new file mode 100644
index 00000000000..75d32705daf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/NamespaceTest.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test StAX parser processes namespace.
+ */
+public class NamespaceTest {
+
+ String namespaceURI = "foobar.com";
+ String rootElement = "foo";
+ String childElement = "foochild";
+ String prefix = "a";
+
+ // Add test methods here, they have to start with 'test' name.
+ // for example:
+ // public void testHello() {}
+
+ String getXML() {
+ StringBuffer sbuffer = new StringBuffer();
+ sbuffer.append("");
+ sbuffer.append("<" + rootElement + " xmlns:");
+ sbuffer.append(prefix);
+ sbuffer.append("=\"" + namespaceURI + "\">");
+ sbuffer.append("<" + prefix + ":" + childElement + ">");
+ sbuffer.append("blahblah");
+ sbuffer.append("" + prefix + ":" + childElement + ">");
+ sbuffer.append("" + rootElement + ">");
+ // System.out.println("XML = " + sbuffer.toString()) ;
+ return sbuffer.toString();
+ }
+
+ @Test
+ public void testRootElementNamespace() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ XMLStreamReader sr = xif.createXMLStreamReader(is);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(rootElement)) {
+ Assert.assertTrue(sr.getNamespacePrefix(0).equals(prefix) && sr.getNamespaceURI(0).equals(namespaceURI));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testChildElementNamespace() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ XMLStreamReader sr = xif.createXMLStreamReader(is);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(childElement)) {
+ QName qname = sr.getName();
+ Assert.assertTrue(qname.getPrefix().equals(prefix) && qname.getNamespaceURI().equals(namespaceURI)
+ && qname.getLocalPart().equals(childElement));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testNamespaceContext() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ XMLStreamReader sr = xif.createXMLStreamReader(is);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(childElement)) {
+ NamespaceContext context = sr.getNamespaceContext();
+ Assert.assertTrue(context.getPrefix(namespaceURI).equals(prefix));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testNamespaceCount() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ InputStream is = new java.io.ByteArrayInputStream(getXML().getBytes());
+ XMLStreamReader sr = xif.createXMLStreamReader(is);
+ while (sr.hasNext()) {
+ int eventType = sr.next();
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (sr.getLocalName().equals(rootElement)) {
+ int count = sr.getNamespaceCount();
+ Assert.assertTrue(count == 1);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/StreamReaderTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/StreamReaderTest.java
new file mode 100644
index 00000000000..8b7475db66a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/StreamReaderTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamReader.hasName() returns false for ENTITY_REFERENCE.
+ */
+public class StreamReaderTest {
+
+ /**
+ * CR 6631264 / sjsxp Issue 45:
+ * https://sjsxp.dev.java.net/issues/show_bug.cgi?id=45
+ * XMLStreamReader.hasName() should return false for ENTITY_REFERENCE
+ */
+ @Test
+ public void testHasNameOnEntityEvent() throws Exception {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
+ XMLStreamReader r = xif.createXMLStreamReader(this.getClass().getResourceAsStream("ExternalDTD.xml"));
+ while (r.next() != XMLStreamConstants.ENTITY_REFERENCE) {
+ System.out.println("event type: " + r.getEventType());
+ continue;
+ }
+ if (r.hasName()) {
+ System.out.println("hasName returned true on ENTITY_REFERENCE event.");
+ }
+ Assert.assertFalse(r.hasName()); // fails
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/SupportDTDTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/SupportDTDTest.java
new file mode 100644
index 00000000000..7b8e28e8a01
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/SupportDTDTest.java
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.StringReader;
+import java.util.List;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.events.Characters;
+import javax.xml.stream.events.DTD;
+import javax.xml.stream.events.EntityDeclaration;
+import javax.xml.stream.events.EntityReference;
+import javax.xml.stream.events.XMLEvent;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test SUPPORT_DTD and IS_REPLACING_ENTITY_REFERENCES.
+ */
+
+/**
+*
+* SUPPORT_DTD behavior:
+* Regardless of supportDTD, always report a DTD event () and throw an
+* exception if an entity reference is found when supportDTD is false
+*
+* The behavior is related to property IS_REPLACING_ENTITY_REFERENCES.
+*
+* SUPPORT_DTD Replace Entity DTD ENTITY_REFERENCE
+* true (default) true (default) yes, has entities no, return Characters
+* true (default) false yes, has entities yes, can print entity name
+* false true (default) yes, but no entity Exception: Undeclared general entity
+* false false yes, but no entity yes, can print entity name
+*
+* Two patches related:
+* sjsxp issue 9: XMLDocumentScannerImpl.java rev 1.6
+* If the supportDTD property is set to FALSE, external and internal subsets
+* are now ignored, rather than an error being reported. In particular, with
+* this property set to FALSE, no error is reported if an external subset cannot
+* be found. Note that the internal subset is still parsed (and errors could be
+* reported here) but no events are returned by the parser. This fixes SJSXP
+* issue 9 from Java.net.
+* Note: SAX and DOM report fatal errors:
+* If either SAX or DOM is used, turning on http://apache.org/xml/features/disallow-doctype-decl [1] effectively disables DTD,
+* according to the spec: A fatal error is thrown if the incoming document contains a DOCTYPE declaration.
+* The current jaxp implementation actually throws a nullpointexception. A better error message could be used.
+*
+*/
+public class SupportDTDTest {
+ final boolean DEBUG = false;
+ final String _file = "ExternalDTD.xml";
+ final String XML = "" + "\n" + "\n"
+ + "\n" + "\n"
+ + "\n" + "]>" + "&intEnt;";
+
+ final String XML1 = "" + "" + "" + "&mkm;" + "";
+
+ // final String XML1 = "" + "" + ""
+ // + "&mkm;" + "";
+
+ final int ENTITY_INTERNAL_ONLY = 1;
+ final int ENTITY_EXTERNAL_ONLY = 2;
+ final int ENTITY_BOTH = 3;
+
+ boolean _DTDReturned = false;
+ boolean _EntityEventReturned = false;
+ boolean _hasEntityDelaration = false;
+ boolean _exceptionThrown = false;
+
+ /** Creates a new instance of StreamReader */
+ public SupportDTDTest(String name) {
+ }
+
+ void reset() {
+ _DTDReturned = false;
+ _EntityEventReturned = false;
+ _hasEntityDelaration = false;
+ _exceptionThrown = false;
+ }
+
+ // tests 1-4 test internal entities only
+ @Test
+ public void test1() {
+ supportDTD(true, true, ENTITY_INTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(true, _hasEntityDelaration);
+ Assert.assertEquals(false, _EntityEventReturned);
+ }
+
+ @Test
+ public void test2() {
+ supportDTD(true, false, ENTITY_INTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(true, _hasEntityDelaration);
+ Assert.assertEquals(true, _EntityEventReturned);
+ }
+
+ @Test
+ public void test3() {
+ supportDTD(false, true, ENTITY_INTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(false, _hasEntityDelaration);
+ Assert.assertEquals(true, _exceptionThrown);
+ }
+
+ @Test
+ public void test4() {
+ supportDTD(false, false, ENTITY_INTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(false, _hasEntityDelaration);
+ Assert.assertEquals(true, _EntityEventReturned);
+ }
+
+ // tests 5-8 test external entities only
+ @Test
+ public void test5() {
+ supportDTD(true, true, ENTITY_EXTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(true, _hasEntityDelaration);
+ Assert.assertEquals(false, _EntityEventReturned);
+ }
+
+ @Test
+ public void test6() {
+ supportDTD(true, false, ENTITY_EXTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(true, _hasEntityDelaration);
+ Assert.assertEquals(true, _EntityEventReturned);
+ }
+
+ @Test
+ public void test7() {
+ supportDTD(false, true, ENTITY_EXTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(false, _hasEntityDelaration);
+ Assert.assertEquals(true, _exceptionThrown);
+ }
+
+ @Test
+ public void test8() {
+ supportDTD(false, false, ENTITY_EXTERNAL_ONLY);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(false, _hasEntityDelaration);
+ Assert.assertEquals(true, _EntityEventReturned);
+ }
+
+ // tests 9-12 test both internal and external entities
+ @Test
+ public void test9() {
+ supportDTD(true, true, ENTITY_BOTH);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(true, _hasEntityDelaration);
+ Assert.assertEquals(false, _EntityEventReturned);
+ }
+
+ @Test
+ public void test10() {
+ supportDTD(true, false, ENTITY_BOTH);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(true, _hasEntityDelaration);
+ Assert.assertEquals(true, _EntityEventReturned);
+ }
+
+ @Test
+ public void test11() {
+ supportDTD(false, true, ENTITY_BOTH);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(false, _hasEntityDelaration);
+ Assert.assertEquals(true, _exceptionThrown);
+ }
+
+ @Test
+ public void test12() {
+ supportDTD(false, false, ENTITY_BOTH);
+ Assert.assertEquals(true, _DTDReturned);
+ Assert.assertEquals(false, _hasEntityDelaration);
+ Assert.assertEquals(true, _EntityEventReturned);
+ }
+
+ public void supportDTD(boolean supportDTD, boolean replaceEntity, int inputType) {
+ reset();
+ print("\n");
+ print((supportDTD ? "SupportDTD=true" : "SupportDTD=false") + ", " + (replaceEntity ? "replaceEntity=true" : "replaceEntity=false"));
+ try {
+ XMLInputFactory xif = getFactory(supportDTD, replaceEntity);
+ XMLEventReader r = getEventReader(xif, inputType);
+ int eventType = 0;
+ int count = 0;
+ while (r.hasNext()) {
+ XMLEvent event = r.nextEvent();
+ eventType = event.getEventType();
+ print("Event " + ++count + ": " + eventType);
+ switch (eventType) {
+ case XMLStreamConstants.DTD:
+ DisplayEntities((DTD) event);
+ _DTDReturned = true;
+ break;
+ case XMLStreamConstants.ENTITY_REFERENCE:
+ print("Entity Name: " + ((EntityReference) event).getName());
+ _EntityEventReturned = true;
+ break;
+ case XMLStreamConstants.CHARACTERS:
+ print("Text: " + ((Characters) event).getData());
+ }
+ }
+
+ } catch (Exception e) {
+ _exceptionThrown = true;
+ if (DEBUG)
+ e.printStackTrace();
+ }
+ }
+
+ XMLInputFactory getFactory(boolean supportDTD, boolean replaceEntity) {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ xif.setProperty(XMLInputFactory.SUPPORT_DTD, (supportDTD) ? Boolean.TRUE : Boolean.FALSE);
+ xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, (replaceEntity) ? Boolean.TRUE : Boolean.FALSE);
+ // xif.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.TRUE);
+ return xif;
+ }
+
+ private XMLEventReader getEventReader(XMLInputFactory inputFactory, int input) throws Exception {
+ XMLEventReader er = null;
+ if (input == ENTITY_INTERNAL_ONLY) {
+ er = inputFactory.createXMLEventReader(new StringReader(XML));
+ } else if (input == ENTITY_EXTERNAL_ONLY) {
+ er = inputFactory.createXMLEventReader(new StringReader(XML1));
+ } else {
+ File file = new File(this.getClass().getResource(_file).getFile());
+ FileInputStream inputStream = new FileInputStream(file);
+ // XMLStreamReader r = xif.createXMLStreamReader(inputStream);
+ er = inputFactory.createXMLEventReader(inputStream);
+ }
+ return er;
+ }
+
+ void DisplayEntities(DTD event) {
+ List entities = event.getEntities();
+ if (entities == null) {
+ _hasEntityDelaration = false;
+ print("No entity found.");
+ } else {
+ _hasEntityDelaration = true;
+ for (int i = 0; i < entities.size(); i++) {
+ EntityDeclaration entity = (EntityDeclaration) entities.get(i);
+ print(entity.getName());
+ }
+ }
+
+ }
+
+ void print(String s) {
+ if (DEBUG)
+ System.out.println(s);
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF16-BE.wsdl.data b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF16-BE.wsdl.data
new file mode 100644
index 00000000000..b56821f8fe0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF16-BE.wsdl.data
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF8-BOM.xml.data b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF8-BOM.xml.data
new file mode 100644
index 00000000000..00f80fa80e0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/UTF8-BOM.xml.data
@@ -0,0 +1 @@
+ 12345678 person.addressperson.administrativeGenderCodeperson.birthTimeMatthewBarrowperson.name
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/VoiceXMLDTDTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/VoiceXMLDTDTest.java
new file mode 100644
index 00000000000..5e193f667fa
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/VoiceXMLDTDTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test parsing Voice XML DTD.
+ */
+public class VoiceXMLDTDTest {
+
+ private static final String INPUT_FILE1 = "voicexml.xml";
+
+ @Test
+ public void test() {
+ XMLInputFactory ifac = XMLInputFactory.newInstance();
+
+ try {
+ XMLStreamReader re = ifac.createXMLStreamReader(getClass().getResource(INPUT_FILE1).toExternalForm(),
+ this.getClass().getResourceAsStream(INPUT_FILE1));
+ while (re.hasNext()) {
+ int event = re.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XML11Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XML11Test.java
new file mode 100644
index 00000000000..2293aaca37a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XML11Test.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamReaderTest;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test parsing xml 1.1.
+ */
+public class XML11Test {
+
+ @Test
+ public void test() {
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ XMLEventReader reader = xif.createXMLEventReader(this.getClass().getResourceAsStream("xml11.xml.data"));
+ while (reader.hasNext())
+ reader.next();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.dtd
new file mode 100644
index 00000000000..45c04bc8062
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.dtd
@@ -0,0 +1,402 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%xs-datatypes;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.xsd
new file mode 100644
index 00000000000..2e9a2729ec5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/XMLSchema.xsd
@@ -0,0 +1,2534 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]>
+
+
+
+ Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp
+ Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp
+
+
+
+
+
+ The schema corresponding to this document is normative,
+ with respect to the syntactic constraints it expresses in the
+ XML Schema language. The documentation (within <documentation> elements)
+ below, is not normative, but rather highlights important aspects of
+ the W3C Recommendation of which this is a part
+
+
+
+
+ The simpleType element and all of its members are defined
+ towards the end of this schema document
+
+
+
+
+
+ Get access to the xml: attribute groups for xml:lang
+ as declared on 'schema' and 'documentation' below
+
+
+
+
+
+
+
+ This type is extended by almost all schema types
+ to allow attributes from other namespaces to be
+ added to user schemas.
+
+
+
+
+
+
+
+
+
+
+
+
+ This type is extended by all types which allow annotation
+ other than <schema> itself
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This group is for the
+ elements which occur freely at the top level of schemas.
+ All of their types are based on the "annotated" type by extension.
+
+
+
+
+
+
+
+
+
+
+
+
+ This group is for the
+ elements which can self-redefine (see <redefine> below).
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {extension, restriction}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {extension, restriction, list, union}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for maxOccurs
+
+
+
+
+
+
+
+
+
+
+
+ for all particles
+
+
+
+
+
+
+ for element, group and attributeGroup,
+ which both define and reference
+
+
+
+
+
+
+
+ 'complexType' uses this
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This branch is short for
+ <complexContent>
+ <restriction base="xs:anyType">
+ ...
+ </restriction>
+ </complexContent>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Will be restricted to required or forbidden
+
+
+
+
+
+ Not allowed if simpleContent child is chosen.
+ May be overriden by setting on complexContent child.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice is added simply to
+ make this a valid restriction per the REC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overrides any setting on complexType parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice is added simply to
+ make this a valid restriction per the REC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No typeDefParticle group reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {substitution, extension,
+ restriction}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The element element can be used either
+ at the top level to define an element-type binding globally,
+ or within a content model to either reference a globally-defined
+ element or type or declare an element-type binding locally.
+ The ref form is not allowed at the top level.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group type for explicit groups, named top-level groups and
+ group references
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group type for the three kinds of group
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice with min/max is here to
+ avoid a pblm with the Elt:All/Choice/Seq
+ Particle derivation constraint
+
+
+
+
+
+
+
+
+
+ restricted max/min
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Only elements allowed inside
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ simple type for the value of the 'namespace' attr of
+ 'any' and 'anyAttribute'
+
+
+
+ Value is
+ ##any - - any non-conflicting WFXML/attribute at all
+
+ ##other - - any non-conflicting WFXML/attribute from
+ namespace other than targetNS
+
+ ##local - - any unqualified non-conflicting WFXML/attribute
+
+ one or - - any non-conflicting WFXML/attribute from
+ more URI the listed namespaces
+ references
+ (space separated)
+
+ ##targetNamespace or ##local may appear in the above list, to
+ refer to the targetNamespace of the enclosing
+ schema or an absent targetNamespace respectively
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A subset of XPath expressions for use
+in selectors
+ A utility type, not for public
+use
+
+
+
+ The following pattern is intended to allow XPath
+ expressions per the following EBNF:
+ Selector ::= Path ( '|' Path )*
+ Path ::= ('.//')? Step ( '/' Step )*
+ Step ::= '.' | NameTest
+ NameTest ::= QName | '*' | NCName ':' '*'
+ child:: is also allowed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A subset of XPath expressions for use
+in fields
+ A utility type, not for public
+use
+
+
+
+ The following pattern is intended to allow XPath
+ expressions per the same EBNF as for selector,
+ with the following change:
+ Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The three kinds of identity constraints, all with
+ type of or derived from 'keybase'.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ A public identifier, per ISO 8879
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ notations for use within XML Schema schemas
+
+
+
+
+
+
+
+
+ Not the real urType, but as close an approximation as we can
+ get in the XML representation
+
+
+
+
+
+
+
+
+
+ First the built-in primitive datatypes. These definitions are for
+ information only, the real built-in definitions are magic.
+
+
+
+ For each built-in datatype in this schema (both primitive and
+ derived) can be uniquely addressed via a URI constructed
+ as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype
+
+ For example, to address the int datatype, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int
+
+ Additionally, each facet definition element can be uniquely
+ addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the facet
+
+ For example, to address the maxInclusive facet, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#maxInclusive
+
+ Additionally, each facet usage in a built-in datatype definition
+ can be uniquely addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype, followed
+ by a period (".") followed by the name of the facet
+
+ For example, to address the usage of the maxInclusive facet in
+ the definition of int, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NOTATION cannot be used directly in a schema; rather a type
+ must be derived from it by specifying at least one enumeration
+ facet whose value is the name of a NOTATION declared in the
+ schema.
+
+
+
+
+
+
+
+
+
+ Now the derived primitive types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern specifies the content of section 2.12 of XML 1.0e2
+ and RFC 3066 (Revised version of RFC 1766).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 7 from the XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 5 from the XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 4 from the Namespaces in XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #all or (possibly empty) subset of {restriction, union, list}
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Can be restricted to required or forbidden
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Required at the top level
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Forbidden when nested
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ We should use a substitution group for facets, but
+ that's ruled out because it would allow users to
+ add their own, which we're not ready for yet.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ base attribute and simpleType child are mutually
+ exclusive, but one or other is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ itemType attribute and simpleType child are mutually
+ exclusive, but one or other is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ memberTypes attribute must be non-empty or there must be
+ at least one simpleType child
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/datatypes.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/datatypes.dtd
new file mode 100644
index 00000000000..91cfb34135c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/datatypes.dtd
@@ -0,0 +1,203 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/report.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/report.dtd
new file mode 100644
index 00000000000..0de99798748
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/report.dtd
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/sgml.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/sgml.xml
new file mode 100644
index 00000000000..58a1817a1b8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/sgml.xml
@@ -0,0 +1,101 @@
+
+
+Getting started with SGML
+
+The business challenge
+
+With the ever-changing and growing global market, companies and
+ large organizations are searching for ways to become more viable and
+ competitive. Downsizing and other cost-cutting measures demand more
+ efficient use of corporate resources. One very important resource is
+ an organization's information.
+As part of the move toward integrated information management,
+whole industries are developing and implementing standards for
+exchanging technical information. This report describes how one such
+standard, the Standard Generalized Markup Language (SGML), works as
+part of an overall information management strategy.
+
+
+Getting to know SGML
+
+While SGML is a fairly recent technology, the use of
+markup in computer-generated documents has existed for a
+while.
+
+What is markup, or everything you always wanted to know about
+document preparation but were afraid to ask?
+
+Markup is everything in a document that is not content. The
+traditional meaning of markup is the manual marking up
+of typewritten text to give instructions for a typesetter or
+compositor about how to fit the text on a page and what typefaces to
+use. This kind of markup is known as procedural markup.
+
+Procedural markup
+Most electronic publishing systems today use some form of
+procedural markup. Procedural markup codes are good for one
+presentation of the information.
+
+Generic markup
+Generic markup (also known as descriptive markup) describes the
+purpose of the text in a document. A basic concept of
+generic markup is that the content of a document must be separate from
+the style. Generic markup allows for multiple presentations of the
+information.
+
+Drawbacks of procedural markup
+Industries involved in technical documentation increasingly
+prefer generic over procedural markup schemes. When a company changes
+software or hardware systems, enormous data translation tasks arise,
+often resulting in errors.
+
+What is SGML in the grand scheme of the universe, anyway?
+
+SGML defines a strict markup scheme with a syntax for defining
+document data elements and an overall framework for marking up
+documents.
+SGML can describe and create documents that are not dependent on
+any hardware, software, formatter, or operating system. Since SGML documents
+conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother?
+
+You can break a typical document into three layers: structure,
+content, and style. SGML works by separating these three aspects and
+deals mainly with the relationship between structure and content.
+
+Structure
+At the heart of an SGML application is a file called the DTD, or
+Document Type Definition. The DTD sets up the structure of a document,
+much like a database schema describes the types of information it
+handles.
+A database schema also defines the relationships between the
+various types of data. Similarly, a DTD specifies rules
+to help ensure documents have a consistent, logical structure.
+
+Content
+Content is the information itself. The method for identifying
+the information and its meaning within this framework is called
+tagging. Tagging must
+conform to the rules established in the DTD (see ).
+
+
+Style
+SGML does not standardize style or other processing methods for
+information stored in SGML.
+
+Resources
+
+Conferences, tutorials, and training
+
+The Graphic Communications Association has been
+instrumental in the development of SGML. GCA provides conferences,
+tutorials, newsletters, and publication sales for both members and
+non-members.
+Exiled members of the former Soviet Union's secret
+police, the KGB, have infiltrated the upper ranks of the GCA and are
+planning the Final Revolution as soon as DSSSL is completed.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/voicexml.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/voicexml.xml
new file mode 100644
index 00000000000..68116e00089
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/voicexml.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/vxml.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/vxml.dtd
new file mode 100644
index 00000000000..7eb8e8011ee
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/vxml.dtd
@@ -0,0 +1,474 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/xml11.xml.data b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/xml11.xml.data
new file mode 100644
index 00000000000..16069b9dc1f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamReaderTest/xml11.xml.data
@@ -0,0 +1,23 @@
+
+
+
+
+]>
+
+x9 :
+xA :
+
+xD :
+x20 to x7E : ! " # $ % ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
+x85 : Â…
+x2028 : 

+xA0-xD7FF :  ŀ ʀ Ԁ ਀ ဠ⠀ 倀 ꀀ
+xE000-xFFFD : î€î€î€îƒ°î„‘ïŠï¾ï¿¼ï¿½
+x10000-x10FFFF : က0က1á€1ကFဂ7á€1á‚1á‚«1á¼€1á“°5á«°5ᬀ0᳿7á·²9ỿ1á€A0á€08á€ABဟ08ီCDáŠAAá–78á‚«CDჿ05ჿFAჿFF
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/AttributeEscapeTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/AttributeEscapeTest.java
new file mode 100644
index 00000000000..0cd9466dbf3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/AttributeEscapeTest.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test XMLStreamWriter shall escape the illegal characters.
+ */
+public class AttributeEscapeTest {
+
+ /**
+ * XML content for testing the escaping of <, >, &, ', ".
+ */
+ private static final String XML_CONTENT = "Testing escaping: lt=<, gt=>, amp=&, apos=', dquote=\"";
+
+ @Test
+ public void testCR6420953() {
+
+ try {
+ XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ StringWriter sw = new StringWriter();
+ XMLStreamWriter w = xof.createXMLStreamWriter(sw);
+
+ w.writeStartDocument();
+ w.writeStartElement("element");
+
+ w.writeDefaultNamespace(XML_CONTENT);
+ w.writeNamespace("prefix", XML_CONTENT);
+
+ w.writeAttribute("attribute", XML_CONTENT);
+ w.writeAttribute(XML_CONTENT, "attribute2", XML_CONTENT);
+ w.writeAttribute("prefix", XML_CONTENT, "attribute3", XML_CONTENT);
+
+ w.writeCharacters("\n");
+ w.writeCharacters(XML_CONTENT);
+ w.writeCharacters("\n");
+ w.writeCharacters(XML_CONTENT.toCharArray(), 0, XML_CONTENT.length());
+ w.writeCharacters("\n");
+
+ w.writeEndElement();
+ w.writeEndDocument();
+ w.flush();
+
+ System.out.println(sw);
+
+ // make sure that the generated XML parses
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.newDocumentBuilder().parse(new InputSource(new StringReader(sw.toString())));
+ } catch (XMLStreamException xmlStreamException) {
+ xmlStreamException.printStackTrace();
+ Assert.fail(xmlStreamException.toString());
+ } catch (SAXException saxException) {
+ saxException.printStackTrace();
+ Assert.fail(saxException.toString());
+ } catch (ParserConfigurationException parserConfigurationException) {
+ parserConfigurationException.printStackTrace();
+ Assert.fail(parserConfigurationException.toString());
+ } catch (IOException ioException) {
+ ioException.printStackTrace();
+ Assert.fail(ioException.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6452107.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6452107.java
new file mode 100644
index 00000000000..2d45aa2f603
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6452107.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6452107
+ * @summary Test StAX can write ISO-8859-1 encoding XML.
+ */
+public class Bug6452107 {
+
+ /**
+ * Ensure that charset aliases are checked. The encoding ISO-8859-1 is
+ * returned as ISO8859_1 by the underlying writer. Thus, if alias are not
+ * inspected, this test throws an exception.
+ */
+ @Test
+ public void test() {
+ final String ENCODING = "ISO-8859-1";
+
+ try {
+ OutputStream out = new ByteArrayOutputStream();
+ XMLOutputFactory factory = XMLOutputFactory.newInstance();
+ XMLStreamWriter writer = factory.createXMLStreamWriter(out, ENCODING);
+ writer.writeStartDocument(ENCODING, "1.0");
+ } catch (XMLStreamException e) {
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6600882Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6600882Test.java
new file mode 100644
index 00000000000..3b22705100a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6600882Test.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6600882
+ * @summary Test toString(), hashCode() of XMLStreamWriter .
+ */
+public class Bug6600882Test {
+
+
+ @Test
+ public void test() {
+ try {
+ XMLOutputFactory of = XMLOutputFactory.newInstance();
+ XMLStreamWriter w = of.createXMLStreamWriter(new ByteArrayOutputStream());
+ XMLStreamWriter w1 = of.createXMLStreamWriter(new ByteArrayOutputStream());
+ System.out.println(w);
+ Assert.assertTrue(w.equals(w) && w.hashCode() == w.hashCode());
+ Assert.assertFalse(w1.equals(w));
+ } catch (Throwable ex) {
+ Assert.fail(ex.toString());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6675332Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6675332Test.java
new file mode 100644
index 00000000000..a22580670a0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug6675332Test.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import util.BaseStAXUT;
+
+/*
+ * @bug 6675332
+ * @summary Test XMLStreamWriter writeAttribute when IS_REPAIRING_NAMESPACES is true.
+ */
+public class Bug6675332Test extends BaseStAXUT {
+
+ private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance();
+
+ @Test
+ public void test() {
+ final String URL_P1 = "http://p1.org";
+ final String URL_DEF = "urn:default";
+ final String ATTR_VALUE = "'value\"";
+ final String ATTR_VALUE2 = "";
+
+ final String TEXT = " some text\n";
+ XML_OUTPUT_FACTORY.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
+
+ final String EXPECTED_OUTPUT = "";
+ XMLStreamWriter w = null;
+ StringWriter strw = new StringWriter();
+ try {
+ w = XML_OUTPUT_FACTORY.createXMLStreamWriter(strw);
+
+ w.writeStartDocument();
+
+ /*
+ * Calling this method should be optional; but if we call it,
+ * exceptation is that it does properly bind the prefix and URL as
+ * the 'preferred' combination. In this case we'll just try to make
+ * URL bound as the default namespace
+ */
+ w.setDefaultNamespace(URL_DEF);
+ w.writeStartElement(URL_DEF, "test"); // root
+
+ /*
+ * And let's further make element and attribute(s) belong to that
+ * same namespace
+ */
+ w.writeStartElement("", "leaf", URL_DEF); // 1st leaf
+ w.writeAttribute("", URL_DEF, "attr", ATTR_VALUE);
+ w.writeAttribute(URL_DEF, "attr2", ATTR_VALUE);
+ w.writeEndElement();
+
+ // w.writeEmptyElement("", "leaf"); // 2nd leaf; in empty/no
+ // namespace!
+
+ w.writeStartElement(URL_DEF, "leaf"); // 3rd leaf
+ // w.writeAttribute("", "attr2", ATTR_VALUE2); // in empty/no
+ // namespace
+ w.writeEndElement();
+
+ w.writeEndElement(); // root elem
+ w.writeEndDocument();
+ w.close();
+ System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\n");
+ System.out.println(strw.toString());
+
+ // And then let's parse and verify it all:
+ // System.err.println("testAttributes: doc = '"+strw+"'");
+
+ XMLStreamReader sr = constructNsStreamReader(strw.toString());
+ assertTokenType(START_DOCUMENT, sr.getEventType(), sr);
+
+ // root element
+ assertTokenType(START_ELEMENT, sr.next(), sr);
+ Assert.assertEquals("test", sr.getLocalName());
+ Assert.assertEquals(URL_DEF, sr.getNamespaceURI());
+
+ // first leaf:
+ assertTokenType(START_ELEMENT, sr.next(), sr);
+ Assert.assertEquals("leaf", sr.getLocalName());
+ Assert.assertEquals(URL_DEF, sr.getNamespaceURI());
+ System.out.println(sr.getAttributeLocalName(0));
+ System.out.println(sr.getAttributeLocalName(1));
+ Assert.assertEquals(2, sr.getAttributeCount());
+ Assert.assertEquals("attr", sr.getAttributeLocalName(0));
+
+ String uri = sr.getAttributeNamespace(0);
+ if (!URL_DEF.equals(uri)) {
+ Assert.fail("Expected attribute 'attr' to have NS '" + URL_DEF + "', was " + valueDesc(uri) + "; input = '" + strw + "'");
+ }
+ Assert.assertEquals(ATTR_VALUE, sr.getAttributeValue(0));
+ assertTokenType(END_ELEMENT, sr.next(), sr);
+ Assert.assertEquals("leaf", sr.getLocalName());
+ Assert.assertEquals(URL_DEF, sr.getNamespaceURI());
+
+ // 2nd/empty leaf
+ /**
+ * assertTokenType(START_ELEMENT, sr.next(), sr);
+ * assertEquals("leaf", sr.getLocalName()); assertNoNsURI(sr);
+ * assertTokenType(END_ELEMENT, sr.next(), sr); assertEquals("leaf",
+ * sr.getLocalName()); assertNoNsURI(sr);
+ */
+ // third leaf
+ assertTokenType(START_ELEMENT, sr.next(), sr);
+ Assert.assertEquals("leaf", sr.getLocalName());
+ Assert.assertEquals(URL_DEF, sr.getNamespaceURI());
+
+ /*
+ * attr in 3rd leaf, in empty/no namespace assertEquals(1,
+ * sr.getAttributeCount()); assertEquals("attr2",
+ * sr.getAttributeLocalName(0));
+ * assertNoAttrNamespace(sr.getAttributeNamespace(0));
+ * assertEquals(ATTR_VALUE2, sr.getAttributeValue(0));
+ */
+ assertTokenType(END_ELEMENT, sr.next(), sr);
+ Assert.assertEquals("leaf", sr.getLocalName());
+ Assert.assertEquals(URL_DEF, sr.getNamespaceURI());
+
+ // closing root element
+ assertTokenType(END_ELEMENT, sr.next(), sr);
+ Assert.assertEquals("test", sr.getLocalName());
+ Assert.assertEquals(URL_DEF, sr.getNamespaceURI());
+
+ assertTokenType(END_DOCUMENT, sr.next(), sr);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug7037352Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug7037352Test.java
new file mode 100644
index 00000000000..a15b7a6142f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/Bug7037352Test.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 7037352
+ * @summary Test XMLStreamWriter.getNamespaceContext().getPrefix with XML_NS_URI and XMLNS_ATTRIBUTE_NS_URI.
+ */
+public class Bug7037352Test {
+
+ @Test
+ public void test() {
+ try {
+ XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ StreamResult sr = new StreamResult();
+ XMLStreamWriter xsw = xof.createXMLStreamWriter(sr);
+ NamespaceContext nc = xsw.getNamespaceContext();
+ System.out.println(nc.getPrefix(XMLConstants.XML_NS_URI));
+ System.out.println(" expected result: " + XMLConstants.XML_NS_PREFIX);
+ System.out.println(nc.getPrefix(XMLConstants.XMLNS_ATTRIBUTE_NS_URI));
+ System.out.println(" expected result: " + XMLConstants.XMLNS_ATTRIBUTE);
+
+ Assert.assertTrue(nc.getPrefix(XMLConstants.XML_NS_URI) == XMLConstants.XML_NS_PREFIX);
+ Assert.assertTrue(nc.getPrefix(XMLConstants.XMLNS_ATTRIBUTE_NS_URI) == XMLConstants.XMLNS_ATTRIBUTE);
+
+ } catch (Throwable ex) {
+ Assert.fail(ex.toString());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DOMUtil.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DOMUtil.java
new file mode 100644
index 00000000000..674e00dc193
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DOMUtil.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class DOMUtil {
+
+ private static DocumentBuilder db;
+
+ private static String fixNull(String s) {
+ if (s == null)
+ return "";
+ else
+ return s;
+ }
+
+ /**
+ * Creates a new DOM document.
+ */
+ public static Document createDom() {
+ synchronized (DOMUtil.class) {
+ if (db == null) {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ db = dbf.newDocumentBuilder();
+ } catch (ParserConfigurationException e) {
+ throw new FactoryConfigurationError(e);
+ }
+ }
+ return db.newDocument();
+ }
+ }
+
+ public static Node createDOMNode(InputStream inputStream) {
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setValidating(false);
+ try {
+ DocumentBuilder builder = dbf.newDocumentBuilder();
+ try {
+ return builder.parse(inputStream);
+ } catch (SAXException e) {
+ e.printStackTrace(); // To change body of catch statement use
+ // File | Settings | File Templates.
+ } catch (IOException e) {
+ e.printStackTrace(); // To change body of catch statement use
+ // File | Settings | File Templates.
+ }
+ } catch (ParserConfigurationException pce) {
+ IllegalArgumentException iae = new IllegalArgumentException(pce.getMessage());
+ iae.initCause(pce);
+ throw iae;
+ }
+ return null;
+ }
+
+ public static void serializeNode(Element node, XMLStreamWriter writer) throws XMLStreamException {
+ String nodePrefix = fixNull(node.getPrefix());
+ String nodeNS = fixNull(node.getNamespaceURI());
+
+ // See if nodePrefix:nodeNS is declared in writer's NamespaceContext
+ // before writing start element
+ // Writing start element puts nodeNS in NamespaceContext even though
+ // namespace declaration not written
+ boolean prefixDecl = isPrefixDeclared(writer, nodeNS, nodePrefix);
+
+ writer.writeStartElement(nodePrefix, node.getLocalName(), nodeNS);
+
+ if (node.hasAttributes()) {
+ NamedNodeMap attrs = node.getAttributes();
+ int numOfAttributes = attrs.getLength();
+ // write namespace declarations first.
+ // if we interleave this with attribue writing,
+ // Zephyr will try to fix it and we end up getting inconsistent
+ // namespace bindings.
+ for (int i = 0; i < numOfAttributes; i++) {
+ Node attr = attrs.item(i);
+ String nsUri = fixNull(attr.getNamespaceURI());
+ if (nsUri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+ // handle default ns declarations
+ String local = attr.getLocalName().equals(XMLConstants.XMLNS_ATTRIBUTE) ? "" : attr.getLocalName();
+ if (local.equals(nodePrefix) && attr.getNodeValue().equals(nodeNS)) {
+ prefixDecl = true;
+ }
+ // this is a namespace declaration, not an attribute
+ writer.setPrefix(attr.getLocalName(), attr.getNodeValue());
+ writer.writeNamespace(attr.getLocalName(), attr.getNodeValue());
+ }
+ }
+ }
+ // node's namespace is not declared as attribute, but declared on
+ // ancestor
+ if (!prefixDecl) {
+ writer.writeNamespace(nodePrefix, nodeNS);
+ }
+
+ // Write all other attributes which are not namespace decl.
+ if (node.hasAttributes()) {
+ NamedNodeMap attrs = node.getAttributes();
+ int numOfAttributes = attrs.getLength();
+
+ for (int i = 0; i < numOfAttributes; i++) {
+ Node attr = attrs.item(i);
+ String attrPrefix = fixNull(attr.getPrefix());
+ String attrNS = fixNull(attr.getNamespaceURI());
+ if (!attrNS.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+ String localName = attr.getLocalName();
+ if (localName == null) {
+ // TODO: this is really a bug in the caller for not
+ // creating proper DOM tree.
+ // will remove this workaround after plugfest
+ localName = attr.getNodeName();
+ }
+ boolean attrPrefixDecl = isPrefixDeclared(writer, attrNS, attrPrefix);
+ if (!attrPrefix.equals("") && !attrPrefixDecl) {
+ // attr has namespace but namespace decl is there in
+ // ancestor node
+ // So write the namespace decl before writing the attr
+ writer.setPrefix(attr.getLocalName(), attr.getNodeValue());
+ writer.writeNamespace(attrPrefix, attrNS);
+ }
+ writer.writeAttribute(attrPrefix, attrNS, localName, attr.getNodeValue());
+ }
+ }
+ }
+
+ if (node.hasChildNodes()) {
+ NodeList children = node.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ switch (child.getNodeType()) {
+ case Node.PROCESSING_INSTRUCTION_NODE:
+ writer.writeProcessingInstruction(child.getNodeValue());
+ case Node.DOCUMENT_TYPE_NODE:
+ break;
+ case Node.CDATA_SECTION_NODE:
+ writer.writeCData(child.getNodeValue());
+ break;
+ case Node.COMMENT_NODE:
+ writer.writeComment(child.getNodeValue());
+ break;
+ case Node.TEXT_NODE:
+ writer.writeCharacters(child.getNodeValue());
+ break;
+ case Node.ELEMENT_NODE:
+ serializeNode((Element) child, writer);
+ break;
+ }
+ }
+ }
+ writer.writeEndElement();
+ }
+
+ private static boolean isPrefixDeclared(XMLStreamWriter writer, String nsUri, String prefix) {
+ boolean prefixDecl = false;
+ NamespaceContext nscontext = writer.getNamespaceContext();
+ Iterator prefixItr = nscontext.getPrefixes(nsUri);
+ while (prefixItr.hasNext()) {
+ if (prefix.equals(prefixItr.next())) {
+ prefixDecl = true;
+ break;
+ }
+ }
+ return prefixDecl;
+ }
+
+ /**
+ * Gets the first child of the given name, or null.
+ */
+ public static Element getFirstChild(Element e, String nsUri, String local) {
+ for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) {
+ if (n.getNodeType() == Node.ELEMENT_NODE) {
+ Element c = (Element) n;
+ if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri))
+ return c;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DomUtilTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DomUtilTest.java
new file mode 100644
index 00000000000..76d5c981bd3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/DomUtilTest.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test XMLStreamWriter writes a soap message.
+ */
+public class DomUtilTest {
+
+ private XMLOutputFactory staxOut;
+ final File folder = new File(System.getProperty("tempdir") + "/classes/soapmessages");
+ private static final String INPUT_FILE1 = "message_12.xml";
+
+ public void setup() {
+ this.staxOut = XMLOutputFactory.newInstance();
+ staxOut.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
+ }
+
+ @Test
+ public void testSOAPEnvelope1() throws Exception {
+ setup();
+
+ File f = new File(this.getClass().getResource(INPUT_FILE1).getFile());
+ System.out.println("***********" + f.getName() + "***********");
+ DOMSource src = makeDomSource(f);
+ Node node = src.getNode();
+ XMLStreamWriter writer = staxOut.createXMLStreamWriter(new PrintStream(System.out));
+ DOMUtil.serializeNode((Element) node.getFirstChild(), writer);
+ writer.close();
+ assert (true);
+ System.out.println("*****************************************");
+
+ }
+
+ public static DOMSource makeDomSource(File f) throws Exception {
+ InputStream is = new FileInputStream(f);
+ DOMSource domSource = new DOMSource(createDOMNode(is));
+ return domSource;
+ }
+
+ public static void printNode(Node node) {
+ DOMSource source = new DOMSource(node);
+ String msgString = null;
+ try {
+ Transformer xFormer = TransformerFactory.newInstance().newTransformer();
+ xFormer.setOutputProperty("omit-xml-declaration", "yes");
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ Result result = new StreamResult(outStream);
+ xFormer.transform(source, result);
+ outStream.writeTo(System.out);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public static Node createDOMNode(InputStream inputStream) {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setValidating(false);
+ try {
+ DocumentBuilder builder = dbf.newDocumentBuilder();
+ try {
+ return builder.parse(inputStream);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ } catch (ParserConfigurationException pce) {
+ IllegalArgumentException iae = new IllegalArgumentException(pce.getMessage());
+ iae.initCause(pce);
+ throw iae;
+ }
+ return null;
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EmptyElementTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EmptyElementTest.java
new file mode 100644
index 00000000000..475c3edb323
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EmptyElementTest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamWriter writes namespace and attribute after writeEmptyElement.
+ */
+public class EmptyElementTest {
+
+ // expected output
+ private static final String EXPECTED_OUTPUT = "" + ""
+ + "" + "";
+
+ XMLStreamWriter xmlStreamWriter;
+ ByteArrayOutputStream byteArrayOutputStream;
+ XMLOutputFactory xmlOutputFactory;
+
+ @Test
+ public void testWriterOnLinux() throws Exception {
+
+ // setup XMLStreamWriter
+ try {
+ byteArrayOutputStream = new ByteArrayOutputStream();
+ xmlOutputFactory = XMLOutputFactory.newInstance();
+ xmlOutputFactory.setProperty(xmlOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream);
+ } catch (Exception e) {
+ System.err.println("Unexpected Exception: " + e.toString());
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ // create & write a document
+ try {
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement("hello");
+ xmlStreamWriter.writeDefaultNamespace("http://hello");
+ xmlStreamWriter.writeEmptyElement("world");
+ xmlStreamWriter.writeDefaultNamespace("http://world");
+ xmlStreamWriter.writeAttribute("prefixes", "foo bar");
+ xmlStreamWriter.writeEndElement();
+ xmlStreamWriter.writeEndDocument();
+ xmlStreamWriter.flush();
+ String actualOutput = byteArrayOutputStream.toString();
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ System.err.println("Unexpected Exception: " + e.toString());
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EncodingTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EncodingTest.java
new file mode 100644
index 00000000000..d79a2331374
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/EncodingTest.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamWriter writes a document with encoding setting.
+ */
+public class EncodingTest {
+
+ private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance();
+
+ /*
+ * Tests writing a document with UTF-8 encoding, by setting UTF-8 on writer.
+ */
+ @Test
+ public void testWriteStartDocumentUTF8() {
+
+ final String EXPECTED_OUTPUT = "";
+ XMLStreamWriter writer = null;
+ ByteArrayOutputStream byteArrayOutputStream = null;
+
+ try {
+ byteArrayOutputStream = new ByteArrayOutputStream();
+ writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(byteArrayOutputStream, "UTF-8");
+
+ writer.writeStartDocument("UTF-8", "1.0");
+ writer.writeStartElement("root");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ writer.flush();
+
+ String actualOutput = byteArrayOutputStream.toString();
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ }
+
+ /*
+ * Tests writing a document with UTF-8 encoding on default enocding writer.
+ * This scenario should result in an exception as default encoding is ASCII.
+ */
+ @Test
+ public void testWriteStartDocumentUTF8Fail() {
+
+ XMLStreamWriter writer = null;
+ ByteArrayOutputStream byteArrayOutputStream = null;
+
+ // pick a different encoding to use v. default encoding
+ String defaultCharset = java.nio.charset.Charset.defaultCharset().name();
+ String useCharset = "UTF-8";
+ if (useCharset.equals(defaultCharset)) {
+ useCharset = "US-ASCII";
+ }
+
+ System.out.println("defaultCharset = " + defaultCharset + ", useCharset = " + useCharset);
+
+ try {
+ byteArrayOutputStream = new ByteArrayOutputStream();
+ writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(byteArrayOutputStream);
+
+ writer.writeStartDocument(useCharset, "1.0");
+ writer.writeStartElement("root");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ writer.flush();
+
+ Assert.fail("Expected XMLStreamException as default underlying stream encoding of " + defaultCharset
+ + " differs from explicitly specified encoding of " + useCharset);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java
new file mode 100644
index 00000000000..25fd9d0fa0b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java
@@ -0,0 +1,1439 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.sun.xml.internal.stream.writers.XMLStreamWriterImpl;
+
+/*
+ * @summary Test the writing of Namespaces.
+ */
+public class NamespaceTest {
+
+ /** debug output? */
+ private static final boolean DEBUG = true;
+
+ /** Factory to reuse. */
+ XMLOutputFactory xmlOutputFactory = null;
+
+ /** Writer to reuse. */
+ XMLStreamWriter xmlStreamWriter = null;
+
+ /** OutputStream to reuse. */
+ ByteArrayOutputStream byteArrayOutputStream = null;
+
+ @BeforeMethod
+ public void setUp() {
+
+ // want a Factory that repairs Namespaces
+ xmlOutputFactory = XMLOutputFactory.newInstance();
+ xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
+
+ // new OutputStream
+ byteArrayOutputStream = new ByteArrayOutputStream();
+
+ // new Writer
+ try {
+ xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream, "utf-8");
+
+ } catch (XMLStreamException xmlStreamException) {
+ Assert.fail(xmlStreamException.toString());
+ }
+ }
+
+ /**
+ * Reset Writer for reuse.
+ */
+ private void resetWriter() {
+ // reset the Writer
+ try {
+ xmlStreamWriter.flush();
+ xmlStreamWriter.close();
+ ((XMLStreamWriterImpl) xmlStreamWriter).reset();
+ byteArrayOutputStream.reset();
+ ((XMLStreamWriterImpl) xmlStreamWriter).setOutput(new StreamResult(byteArrayOutputStream), "utf-8");
+ } catch (XMLStreamException xmlStreamException) {
+ Assert.fail(xmlStreamException.toString());
+ } catch (IOException ioException) {
+ Assert.fail(ioException.toString());
+ }
+ }
+
+ @Test
+ public void testDoubleXmlNs() {
+ try {
+
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement("foo");
+ xmlStreamWriter.writeNamespace("xml", XMLConstants.XML_NS_URI);
+ xmlStreamWriter.writeAttribute("xml", XMLConstants.XML_NS_URI, "lang", "ja_JP");
+ xmlStreamWriter.writeCharacters("Hello");
+ xmlStreamWriter.writeEndElement();
+ xmlStreamWriter.writeEndDocument();
+
+ xmlStreamWriter.flush();
+ String actualOutput = byteArrayOutputStream.toString();
+
+ if (DEBUG) {
+ System.out.println("testDoubleXmlNs(): actualOutput: " + actualOutput);
+ }
+
+ // there should be no xmlns:xml
+ Assert.assertTrue(actualOutput.split("xmlns:xml").length == 1, "Expected 0 xmlns:xml, actual output: " + actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDuplicateNamespaceURI() throws Exception {
+
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement(new String(""), "localName", new String("nsUri"));
+ xmlStreamWriter.writeNamespace(new String(""), new String("nsUri"));
+ xmlStreamWriter.writeEndElement();
+ xmlStreamWriter.writeEndDocument();
+
+ xmlStreamWriter.flush();
+ String actualOutput = byteArrayOutputStream.toString();
+
+ if (DEBUG) {
+ System.out.println("testDuplicateNamespaceURI(): actualOutput: " + actualOutput);
+ }
+
+ // there must be only 1 xmlns=...
+ Assert.assertTrue(actualOutput.split("xmlns").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput);
+ }
+
+ // TODO: test with both "" & null
+ // NDW: There's no distinction in XML between a "null" namespace URI and one
+ // with a URI of "" (the empty string) so I haven't tried to call out any
+ // such distinctions.
+
+ // ---------------- Current default namespace is "" ----------------
+
+ private void startDocumentEmptyDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
+
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement("root");
+ xmlStreamWriter.writeDefaultNamespace("");
+ }
+
+ private String endDocumentEmptyDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
+
+ xmlStreamWriter.writeEndDocument();
+
+ xmlStreamWriter.flush();
+
+ return byteArrayOutputStream.toString();
+ }
+
+ /**
+ * Current default namespace is "".
+ * writeStartElement("", "localName"", "")
+ * requires no fixup
+ */
+ @Test
+ public void testEmptyDefaultEmptyPrefix() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "" + "requires no fixup" + "" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("", "localName", "");
+ xmlStreamWriter.writeCharacters("requires no fixup");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultEmptyPrefix(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeStartElement("prefix", "localName", "http://example.org/myURI")
+ *
+ * requires no fixup, but should generate a declaration for "prefix":
+ * xmlns:prefix="http://example.org/myURI" if necessary
+ *
+ * necessary to generate a declaration in this test case.
+ */
+ @Test
+ public void testEmptyDefaultSpecifiedPrefix() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + ""
+ + "generate xmlns:prefix" + "" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("prefix", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeCharacters("generate xmlns:prefix");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultSpecifiedPrefix(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeStartElement("prefix", "localName", "http://example.org/myURI")
+ *
+ * requires no fixup, but should generate a declaration for "prefix":
+ * xmlns:prefix="http://example.org/myURI" if necessary
+ *
+ * not necessary to generate a declaration in this test case.
+ */
+ @Test
+ public void testEmptyDefaultSpecifiedPrefixNoDeclarationGeneration() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + ""
+ + "not necessary to generate a declaration" + "" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("prefix", "http://example.org/myURI");
+
+ xmlStreamWriter.writeStartElement("prefix", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeCharacters("not necessary to generate a declaration");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultSpecifiedPrefixNoDeclarationGeneration(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultSpecifiedPrefixNoDeclarationGeneration(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeStartElement("", "localName", "http://example.org/myURI")
+ *
+ * should "fixup" the declaration for the default namespace:
+ * xmlns="http://example.org/myURI"
+ */
+ @Test
+ public void testEmptyDefaultSpecifiedDefault() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "" + "generate xmlns"
+ + "" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeCharacters("generate xmlns");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultSpecifiedDefault(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultSpecifiedDefault(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeAttribute("", "", "attrName", "value")
+ *
+ * requires no fixup
+ */
+ @Test
+ public void testEmptyDefaultEmptyPrefixWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "requires no fixup" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("", "", "attrName", "value");
+ xmlStreamWriter.writeCharacters("requires no fixup");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultEmptyPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultEmptyPrefixWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeAttribute("p", "http://example.org/myURI", "attrName", "value")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/myURI" if necessary
+ *
+ * necessary to generate a declaration in this test case.
+ */
+ @Test
+ public void testEmptyDefaultSpecifiedPrefixWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + ""
+ + "generate xmlns:p=\"http://example.org/myURI\"" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("generate xmlns:p=\"http://example.org/myURI\"");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeAttribute("p", "http://example.org/myURI", "attrName", "value")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/myURI" if necessary
+ *
+ * not necessary to generate a declaration in this test case.
+ */
+ @Test
+ public void testEmptyDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + ""
+ + "not necessary to generate a declaration" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+
+ xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("not necessary to generate a declaration");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeAttribute("", "http://example.org/myURI", "attrName", "value")
+ *
+ * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will
+ * create a namespace declaration on the current StartElement for any
+ * attribute that does not currently have a namespace declaration in scope.
+ * If the StartElement has a uri but no prefix specified a prefix will be
+ * assigned, if the prefix has not been declared in a parent of the current
+ * StartElement it will be declared on the current StartElement. If the
+ * defaultNamespace is bound and in scope and the default namespace matches
+ * the URI of the attribute or StartElement QName no prefix will be
+ * assigned."
+ *
+ * prefix needs to be assigned for this test case.
+ */
+ @Test
+ public void testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = ""
+ + ""
+ + "generate xmlns declaration {generated prefix}=\"http://example.org/myURI\"" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("generate xmlns declaration {generated prefix}=\"http://example.org/myURI\"");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultUnspecifiedPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultUnspecifiedPrefixWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ // there must be one xmlns=
+ Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput);
+
+ // there must be one xmlns:{generated prefix}="..."
+ Assert.assertTrue(actualOutput.split("xmlns:").length == 2, "Expected 1 xmlns:{generated prefix}=\"\", actual output: " + actualOutput);
+
+ // there must be one {generated prefix}:attrName="value"
+ Assert.assertTrue(actualOutput.split(":attrName=\"value\"").length == 2, "Expected 1 {generated prefix}:attrName=\"value\", actual output: "
+ + actualOutput);
+ }
+
+ /**
+ * Current default namespace is "".
+ *
+ * writeAttribute("", "http://example.org/myURI", "attrName", "value")
+ *
+ * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will
+ * create a namespace declaration on the current StartElement for any
+ * attribute that does not currently have a namespace declaration in scope.
+ * If the StartElement has a uri but no prefix specified a prefix will be
+ * assigned, if the prefix has not been declared in a parent of the current
+ * StartElement it will be declared on the current StartElement. If the
+ * defaultNamespace is bound and in scope and the default namespace matches
+ * the URI of the attribute or StartElement QName no prefix will be
+ * assigned."
+ *
+ * no prefix needs to be assigned for this test case
+ */
+ @Test
+ public void testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + ""
+ + "no prefix generation" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+
+ xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("no prefix generation");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ // ---------------- Current default namespace is
+ // "http://example.org/uniqueURI" ----------------
+
+ private void startDocumentSpecifiedDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
+
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement("root");
+ xmlStreamWriter.writeDefaultNamespace("http://example.org/uniqueURI");
+ }
+
+ private String endDocumentSpecifiedDefaultNamespace(XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
+
+ xmlStreamWriter.writeEndDocument();
+
+ xmlStreamWriter.flush();
+
+ return byteArrayOutputStream.toString();
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeElement("", "localName", "")
+ *
+ * should "fixup" the declaration for the default namespace: xmlns=""
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefix() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + ""
+ + "generate xmlns=\"\"" + "" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("", "localName", "");
+ xmlStreamWriter.writeCharacters("generate xmlns=\"\"");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultEmptyPrefix(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultEmptyPrefix(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeStartElement("p", "localName", "http://example.org/myURI")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/myURI" if necessary
+ *
+ * test case where it is necessary to generate a declaration.
+ */
+ @Test
+ public void testSpecifiedDefaultSpecifiedPrefix() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + ""
+ + "" + "generate xmlns:p=\"http://example.org/myURI\"" + "" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeCharacters("generate xmlns:p=\"http://example.org/myURI\"");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultSpecifiedPrefix(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultSpecifiedPrefix(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeStartElement("p", "localName", "http://example.org/myURI")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/myURI" if necessary
+ *
+ * test case where it is not necessary to generate a declaration.
+ */
+ @Test
+ public void testSpecifiedDefaultSpecifiedPrefixNoPrefixGeneration() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "" + "not necessary to generate a declaration" + "" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeCharacters("not necessary to generate a declaration");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixNoPrefixGeneration(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixNoPrefixGeneration(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeStartElement("", "localName", "http://example.org/myURI")
+ *
+ * should "fixup" the declaration for the default namespace:
+ * xmlns="http://example.org/myURI"
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURI() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + ""
+ + "" + "generate xmlns=\"http://example.org/myURI\"" + "" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeCharacters("generate xmlns=\"http://example.org/myURI\"");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURI(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURI(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeAttribute("", "", "attrName", "value")
+ *
+ * requires no fixup
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "requires no fixup"
+ + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("", "", "attrName", "value");
+ xmlStreamWriter.writeCharacters("requires no fixup");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultEmptyPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultEmptyPrefixWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeAttribute("p", "http://example.org/myURI", "attrName", "value")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/myURI" if necessary
+ *
+ * test case where it is necessary to generate a declaration.
+ */
+ @Test
+ public void testSpecifiedDefaultSpecifiedPrefixWriteAttribute() throws Exception { // want
+ // to
+ // test
+
+ final String EXPECTED_OUTPUT = ""
+ + ""
+ + "generate xmlns:p=\"http://example.org/myURI\"" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("generate xmlns:p=\"http://example.org/myURI\"");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeAttribute("p", "http://example.org/myURI", "attrName", "value")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/myURI" if necessary
+ *
+ * test case where it is not necessary to generate a declaration.
+ */
+ @Test
+ public void testSpecifiedDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration() throws Exception {
+
+ final String EXPECTED_OUTPUT = ""
+ + ""
+ + "not necessary to generate a declaration" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+
+ xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("not necessary to generate a declaration");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixWriteAttributeNoDeclarationGeneration(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeAttribute("p", "http://example.org/uniqueURI", "attrName", "value")
+ *
+ * requires no fixup, but should generate a declaration for "p":
+ * xmlns:p="http://example.org/uniqueURI" if necessary. (Note that this will
+ * potentially produce two namespace bindings with the same URI, xmlns="xxx"
+ * and xmlns:p="xxx", but that's perfectly legal.)
+ */
+ @Test
+ public void testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "requires no fixup"
+ + "";
+ final String EXPECTED_OUTPUT_2 = ""
+ + "" + "requires no fixup"
+ + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("p", "http://example.org/uniqueURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("requires no fixup");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute: expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute: expectedOutput: " + EXPECTED_OUTPUT_2);
+ System.out.println("testSpecifiedDefaultSpecifiedPrefixSpecifiedNamespaceURIWriteAttribute: actualOutput: " + actualOutput);
+ }
+
+ Assert.assertTrue(actualOutput.equals(EXPECTED_OUTPUT) || actualOutput.equals(EXPECTED_OUTPUT_2), "Expected: " + EXPECTED_OUTPUT + "\n" + "Actual: "
+ + actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeAttribute("", "http://example.org/myURI", "attrName", "value")
+ *
+ * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will
+ * create a namespace declaration on the current StartElement for any
+ * attribute that does not currently have a namespace declaration in scope.
+ * If the StartElement has a uri but no prefix specified a prefix will be
+ * assigned, if the prefix has not been declared in a parent of the current
+ * StartElement it will be declared on the current StartElement. If the
+ * defaultNamespace is bound and in scope and the default namespace matches
+ * the URI of the attribute or StartElement QName no prefix will be
+ * assigned."
+ *
+ * test case where prefix needs to be assigned.
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + ""
+ + "generate xmlns declaration {generated prefix}=\"http://example.org/myURI\"" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("generate xmlns declaration {generated prefix}=\"http://example.org/myURI\"");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ // there must be one xmlns=
+ Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput);
+
+ // there must be one xmlns:{generated prefix}="..."
+ Assert.assertTrue(actualOutput.split("xmlns:").length == 2, "Expected 1 xmlns:{generated prefix}=\"\", actual output: " + actualOutput);
+
+ // there must be one {generated prefix}:attrName="value"
+ Assert.assertTrue(actualOutput.split(":attrName=\"value\"").length == 2, "Expected 1 {generated prefix}:attrName=\"value\", actual output: "
+ + actualOutput);
+ }
+
+ /**
+ * Current default namespace is "http://example.org/uniqueURI".
+ *
+ * writeAttribute("", "http://example.org/myURI", "attrName", "value")
+ *
+ * XMLOutputFactory (Javadoc) : "If a writer isRepairingNamespaces it will
+ * create a namespace declaration on the current StartElement for any
+ * attribute that does not currently have a namespace declaration in scope.
+ * If the StartElement has a uri but no prefix specified a prefix will be
+ * assigned, if the prefix has not been declared in a parent of the current
+ * StartElement it will be declared on the current StartElement. If the
+ * defaultNamespace is bound and in scope and the default namespace matches
+ * the URI of the attribute or StartElement QName no prefix will be
+ * assigned."
+ *
+ * test case where no prefix needs to be assigned.
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "no prefix needs to be assigned" + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+
+ xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeCharacters("no prefix needs to be assigned");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultEmptyPrefixSpecifiedNamespaceURIWriteAttributeNoPrefixGeneration(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ // --------------- Serializations, sequences ---------------
+
+ // Unfortunately, the nature of the StAX API makes it possible for the
+ // programmer to generate events that cannot be serialized in XML.
+
+ /**
+ * Current default namespace is "".
+ *
+ * write*("p", "myuri", ...); write*("p", "otheruri", ...);
+ *
+ * XMLOutputFactory (Javadoc) (If repairing of namespaces is enabled): "If
+ * element and/or attribute names in the same start or empty-element tag are
+ * bound to different namespace URIs and are using the same prefix then the
+ * element or the first occurring attribute retains the original prefix and
+ * the following attributes have their prefixes replaced with a new prefix
+ * that is bound to the namespace URIs of those attributes."
+ */
+ @Test
+ public void testSamePrefixDifferentURI() throws Exception {
+
+ /**
+ * writeAttribute("p", "http://example.org/URI-ONE", "attr1", "value");
+ * writeAttribute("p", "http://example.org/URI-TWO", "attr2", "value");
+ */
+ final String EXPECTED_OUTPUT = "" + ""
+ + " xmlns:{generated prefix}=\"http://example.org/URI-TWO\"" + " {generated prefix}:attr2=\"value\">"
+ + "remap xmlns declaration {generated prefix}=\"http://example.org/URI-TWO\"" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-ONE", "attr1", "value");
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attr2", "value");
+ xmlStreamWriter.writeCharacters("remap xmlns declaration {generated prefix}=\"http://example.org/URI-TWO\"");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput);
+ }
+
+ // there must be 1 xmlns=
+ Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput);
+
+ // there must be 2 xmlns:
+ Assert.assertTrue(actualOutput.split("xmlns:").length == 3, "Expected 2 xmlns:, actual output: " + actualOutput);
+
+ // there must be 2 :attr
+ Assert.assertTrue(actualOutput.split(":attr").length == 3, "Expected 2 :attr, actual output: " + actualOutput);
+
+ /**
+ * writeStartElement("p", "localName", "http://example.org/URI-ONE");
+ * writeAttribute("p", "http://example.org/URI-TWO", "attrName",
+ * "value");
+ */
+ final String EXPECTED_OUTPUT_2 = "" + "" + "" + "" + "";
+
+ // reset to known state
+ resetWriter();
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/URI-ONE");
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value");
+
+ actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT_2);
+ System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput);
+ }
+
+ // there must be 1 xmlns=
+ Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput);
+
+ // there must be 2 xmlns:
+ Assert.assertTrue(actualOutput.split("xmlns:").length == 3, "Expected 2 xmlns:, actual output: " + actualOutput);
+
+ // there must be 2 p:localName
+ Assert.assertTrue(actualOutput.split("p:localName").length == 3, "Expected 2 p:localName, actual output: " + actualOutput);
+
+ // there must be 1 :attrName
+ Assert.assertTrue(actualOutput.split(":attrName").length == 2, "Expected 1 :attrName, actual output: " + actualOutput);
+
+ /**
+ * writeNamespace("p", "http://example.org/URI-ONE");
+ * writeAttribute("p", "http://example.org/URI-TWO", "attrName",
+ * "value");
+ */
+ final String EXPECTED_OUTPUT_3 = "" + "" + "";
+
+ // reset to known state
+ resetWriter();
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeNamespace("p", "http://example.org/URI-ONE");
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value");
+
+ actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT_3);
+ System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput);
+ }
+
+ // there must be 1 xmlns=
+ Assert.assertTrue(actualOutput.split("xmlns=").length == 2, "Expected 1 xmlns=, actual output: " + actualOutput);
+
+ // there must be 2 xmlns:
+ Assert.assertTrue(actualOutput.split("xmlns:").length == 3, "Expected 2 xmlns:, actual output: " + actualOutput);
+
+ // there must be 1 :attrName
+ Assert.assertTrue(actualOutput.split(":attrName").length == 2, "Expected a :attrName, actual output: " + actualOutput);
+
+ /**
+ * writeNamespace("xmlns", ""); writeStartElement("", "localName",
+ * "http://example.org/URI-TWO");
+ */
+ final String EXPECTED_OUTPUT_4 = "" + "" + ""
+ + "xmlns declaration =\"http://example.org/URI-TWO\"" + "";
+
+ // reset to known state
+ resetWriter();
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ // writeNamespace("xmlns", ""); already done by
+ // startDocumentEmptyDefaultNamespace above
+ xmlStreamWriter.writeStartElement("", "localName", "http://example.org/URI-TWO");
+ xmlStreamWriter.writeCharacters("remap xmlns declaration {generated prefix}=\"http://example.org/URI-TWO\"");
+
+ actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSamePrefixDifferentURI(): expectedOutput: " + EXPECTED_OUTPUT_4);
+ System.out.println("testSamePrefixDifferentURI(): actualOutput: " + actualOutput);
+ }
+
+ // there must be 2 xmlns=
+ Assert.assertTrue(actualOutput.split("xmlns=").length == 3, "Expected 2 xmlns=, actual output: " + actualOutput);
+
+ // there must be 0 xmlns:
+ Assert.assertTrue(actualOutput.split("xmlns:").length == 1, "Expected 0 xmlns:, actual output: " + actualOutput);
+
+ // there must be 0 :localName
+ Assert.assertTrue(actualOutput.split(":localName").length == 1, "Expected 0 :localName, actual output: " + actualOutput);
+ }
+
+ // ---------------- Misc ----------------
+
+ /**
+ * The one case where you don't have to worry about fixup is on attributes
+ * that do not have a prefix. Irrespective of the current namespace
+ * bindings,
+ *
+ * writeAttribute("", "", "attrName", "value")
+ *
+ * is always correct and never requires fixup.
+ */
+ @Test
+ public void testEmptyDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "never requires fixup" + "";
+
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("", "", "attrName", "value");
+ xmlStreamWriter.writeCharacters("never requires fixup");
+
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testEmptyDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testEmptyDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute() throws Exception {
+
+ final String EXPECTED_OUTPUT = "" + "" + "never requires fixup"
+ + "";
+
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ xmlStreamWriter.writeAttribute("", "", "attrName", "value");
+ xmlStreamWriter.writeCharacters("never requires fixup");
+
+ String actualOutput = endDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+
+ if (DEBUG) {
+ System.out.println("testSpecifiedDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): expectedOutput: " + EXPECTED_OUTPUT);
+ System.out.println("testSpecifiedDefaultEmptyPrefixEmptyNamespaceURIWriteAttribute(): actualOutput: " + actualOutput);
+ }
+
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ }
+
+ /*--------------- Negative tests with isRepairingNamespaces as FALSE ---------------------- */
+
+ private void setUpForNoRepair() {
+
+ xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.FALSE);
+
+ // new Writer
+ try {
+ xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream);
+
+ } catch (XMLStreamException xmlStreamException) {
+ xmlStreamException.printStackTrace();
+ Assert.fail(xmlStreamException.toString());
+ }
+ }
+
+ /*
+ * Tries to assign default namespace to empty URI and again to a different
+ * uri in element and attribute. Expects XMLStreamException .
+ * writeNamespace("",""); writeAttribute("", "http://example.org/myURI",
+ * "attrName", "value");
+ */
+ @Test
+ public void testEmptyDefaultEmptyPrefixSpecifiedURIWriteAttributeNoRepair() {
+ try {
+ setUpForNoRepair();
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value");
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * Tries to assign default namespace to different uris in element and
+ * attribute and expects XMLStreamException.
+ * writeNamespace("","http://example.org/uniqueURI"); writeAttribute("",
+ * "http://example.org/myURI", "attrName", "value");
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixSpecifiedURIWriteAttributeNoRepair() {
+ try {
+ setUpForNoRepair();
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+ xmlStreamWriter.writeAttribute("", "http://example.org/uniqueURI", "attrName", "value");
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * Tries to assign default namespace to same uri twice in element and
+ * attribute and expects XMLStreamException.
+ * writeNamespace("","http://example.org/uniqueURI"); writeAttribute("",
+ * "http://example.org/uniqueURI", "attrName", "value");
+ */
+ @Test
+ public void testSpecifiedDefaultEmptyPrefixSpecifiedDifferentURIWriteAttributeNoRepair() {
+ try {
+ setUpForNoRepair();
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+ xmlStreamWriter.writeAttribute("", "http://example.org/myURI", "attrName", "value");
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * Tries to assign prefix 'p' to different uris to attributes of the same
+ * element and expects XMLStreamException. writeAttribute("p",
+ * "http://example.org/URI-ONE", "attr1", "value"); writeAttribute("p",
+ * "http://example.org/URI-TWO", "attr2", "value");
+ */
+ @Test
+ public void testSamePrefixDiffrentURIWriteAttributeNoRepair() {
+ try {
+ setUpForNoRepair();
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-ONE", "attr1", "value");
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attr2", "value");
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * Tries to assign prefix 'p' to different uris in element and attribute and
+ * expects XMLStreamException.
+ * writeStartElement("p","localName","http://example.org/URI-ONE")
+ * writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value")
+ */
+ @Test
+ public void testSamePrefixDiffrentURIWriteElemAndWriteAttributeNoRepair() {
+ try {
+ setUpForNoRepair();
+ startDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/URI-ONE");
+ xmlStreamWriter.writeAttribute("p", "http://example.org/URI-TWO", "attrName", "value");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * Tries to write following and expects a StreamException.
+ */
+ @Test
+ public void testDefaultNamespaceDiffrentURIWriteElementNoRepair() {
+ try {
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ setUpForNoRepair();
+ startDocumentSpecifiedDefaultNamespace(xmlStreamWriter);
+ xmlStreamWriter.writeNamespace("", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /*--------------------------------------------------------------------------
+ Miscelleneous tests for writeStartElement() & writeAttribute() methods
+ in case of NOREPAIR
+ --------------------------------------------------------------------------*/
+
+ private void startDocument(XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement("root");
+ }
+
+ @Test
+ public void testSpecifiedPrefixSpecifiedURIWriteElementNoRepair() {
+
+ final String EXPECTED_OUTPUT = "" + "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Caught an unexpected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSpecifiedPrefixSpecifiedURIWriteAttributeNoRepair() {
+
+ final String EXPECTED_OUTPUT = "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeAttribute("p", "http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Caught an unexpected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSpecifiedPrefixSpecifiedURISpecifiedNamespcaeWriteElementNoRepair() {
+
+ final String EXPECTED_OUTPUT = "" + "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Caught an unexpected exception" + e.getMessage());
+ }
+ }
+
+ /*
+ * writeStartElement("p","localName", "http://example.org/myURI")
+ * writeNamespace("p","http://example.org/uniqueURI") This sequence of calls
+ * should generate an error as prefix 'p' is binded to different namespace
+ * URIs in same namespace context and repairing is disabled.
+ */
+
+ @Test
+ public void testSpecifiedPrefixSpecifiedURISpecifiedDifferentNamespcaeWriteElementNoRepair() {
+
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("p", "http://example.org/uniqueURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.fail("XMLStreamException is expected as 'p' is rebinded to a different URI in same namespace context");
+ } catch (Exception e) {
+ System.out.println("Caught an expected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testEmptyPrefixEmptyURIWriteAttributeNoRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("localName");
+ xmlStreamWriter.writeAttribute("", "", "attrName", "value");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Caught an unexpected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testEmptyPrefixNullURIWriteAttributeNoRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("localName");
+ xmlStreamWriter.writeAttribute(null, null, "attrName", "value");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.fail("XMLStreamException is expected, actualOutput: " + actualOutput);
+ } catch (Exception e) {
+ System.out.println("PASS: caught an expected exception" + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testDoubleXmlNsNoRepair() {
+ try {
+ // reset to known state
+ setUpForNoRepair();
+
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartElement("foo");
+ xmlStreamWriter.writeNamespace("xml", XMLConstants.XML_NS_URI);
+ xmlStreamWriter.writeAttribute("xml", XMLConstants.XML_NS_URI, "lang", "ja_JP");
+ xmlStreamWriter.writeCharacters("Hello");
+ xmlStreamWriter.writeEndElement();
+ xmlStreamWriter.writeEndDocument();
+
+ xmlStreamWriter.flush();
+ String actualOutput = byteArrayOutputStream.toString();
+
+ if (DEBUG) {
+ System.out.println("testDoubleXmlNsNoRepair(): actualOutput: " + actualOutput);
+ }
+
+ // there should be no xmlns:xml
+ Assert.assertTrue(actualOutput.split("xmlns:xml").length == 1, "Expected 0 xmlns:xml, actual output: " + actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSpecifiedURIWriteAttributeNoRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeAttribute("http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ System.out.println("Caught an expected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSpecifiedURIWriteAttributeWithRepair() {
+ final String EXPECTED_OUTPUT = "" + ""
+ + "" + "";
+ try {
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("p", "localName", "http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+ xmlStreamWriter.writeAttribute("http://example.org/myURI", "attrName", "value");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSpecifiedDefaultInDifferentElementsNoRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + ""
+ + "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.writeStartElement("localName");
+ xmlStreamWriter.writeDefaultNamespace("http://example.org/myURI");
+ xmlStreamWriter.writeStartElement("child");
+ xmlStreamWriter.writeDefaultNamespace("http://example.org/uniqueURI");
+ xmlStreamWriter.writeEndElement();
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ /*------------- Tests for setPrefix() and setDefaultNamespace() methods --------------------*/
+
+ @Test
+ public void testSetPrefixWriteNamespaceNoRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.setPrefix("p", "http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ System.out.println("Caught an expected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSetPrefixWriteNamespaceWithRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "";
+ try {
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.setPrefix("p", "http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("p", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ System.out.println("Caught an expected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSetDefaultNamespaceWriteNamespaceNoRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "";
+ try {
+ setUpForNoRepair();
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.setDefaultNamespace("http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ System.out.println("Caught an expected exception" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSetDefaultNamespaceWriteNamespaceWithRepair() {
+ final String EXPECTED_OUTPUT = "" + "" + "";
+ try {
+ startDocument(xmlStreamWriter);
+ xmlStreamWriter.setDefaultNamespace("http://example.org/myURI");
+ xmlStreamWriter.writeNamespace("", "http://example.org/myURI");
+ xmlStreamWriter.writeEndElement();
+ String actualOutput = endDocumentEmptyDefaultNamespace(xmlStreamWriter);
+ System.out.println("actualOutput: " + actualOutput);
+ Assert.assertEquals(EXPECTED_OUTPUT, actualOutput);
+ } catch (Exception e) {
+ System.out.println("Caught an expected exception" + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NullUriDetectionTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NullUriDetectionTest.java
new file mode 100644
index 00000000000..9dbb40cec11
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NullUriDetectionTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6391922
+ * @summary Test XMLStreamWriter can writeDefaultNamespace(null).
+ */
+public class NullUriDetectionTest {
+ @Test
+ public void test1() throws Exception {
+ XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ xof.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
+
+ StringWriter sw = new StringWriter();
+ XMLStreamWriter w = xof.createXMLStreamWriter(sw);
+ w.writeStartDocument();
+ w.writeStartElement("foo", "bar", "zot");
+ w.writeDefaultNamespace(null);
+ w.writeCharacters("---");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/SqeLinuxTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/SqeLinuxTest.java
new file mode 100644
index 00000000000..fa53214f633
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/SqeLinuxTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamWriter can output multiple declarations if IS_REPAIRING_NAMESPACES is false.
+ */
+public class SqeLinuxTest {
+
+ // note that expected output will have multiple declarations,
+ // StAX does not do well formedness checking
+ private static final String EXPECTED_OUTPUT = "" + ""
+ + "" + "";
+
+ XMLStreamWriter xmlStreamWriter;
+ ByteArrayOutputStream byteArrayOutputStream;
+ XMLOutputFactory xmlOutputFactory;
+
+ @Test
+ public void testWriterOnLinux() throws Exception {
+
+ // setup XMLStreamWriter
+ try {
+ byteArrayOutputStream = new ByteArrayOutputStream();
+ xmlOutputFactory = XMLOutputFactory.newInstance();
+ xmlOutputFactory.setProperty(xmlOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(false));
+ xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream, "ASCII");
+ } catch (Exception e) {
+ System.err.println("Unexpected Exception: " + e.toString());
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ // create & write a document
+ try {
+ xmlStreamWriter.writeStartDocument();
+ xmlStreamWriter.writeStartDocument("wStDoc_ver");
+ xmlStreamWriter.writeStartDocument("ASCII", "wStDoc_ver2");
+ xmlStreamWriter.writeStartDocument(null, null);
+
+ // orignal SQE test used reset() before flush()
+ // believe this is false as reset() throws away output before
+ // flush() writes any cached output
+ // it is valid for a XMLStreamWriter to write its output at any
+ // time, flush() just garuntees it
+ // byteArrayOutputStream.reset();
+ xmlStreamWriter.flush();
+ Assert.assertEquals(EXPECTED_OUTPUT, byteArrayOutputStream.toString());
+ } catch (Exception e) {
+ System.err.println("Unexpected Exception: " + e.toString());
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/UnprefixedNameTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/UnprefixedNameTest.java
new file mode 100644
index 00000000000..c4174cf10fa
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/UnprefixedNameTest.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6394074
+ * @summary Test XMLStreamWriter namespace prefix with writeDefaultNamespace.
+ */
+public class UnprefixedNameTest {
+
+ @Test
+ public void testUnboundPrefix() throws Exception {
+
+ try {
+ XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ XMLStreamWriter w = xof.createXMLStreamWriter(System.out);
+ // here I'm trying to write
+ //
+ w.writeStartDocument();
+ w.writeStartElement("foo", "bar");
+ w.writeDefaultNamespace("foo");
+ w.writeCharacters("---");
+ w.writeEndElement();
+ w.writeEndDocument();
+ w.close();
+
+ // Unexpected success
+ String FAIL_MSG = "Unexpected success. Expected: " + "XMLStreamException - " + "if the namespace URI has not been bound to a prefix "
+ + "and javax.xml.stream.isPrefixDefaulting has not been " + "set to true";
+ System.err.println(FAIL_MSG);
+ Assert.fail(FAIL_MSG);
+ } catch (XMLStreamException xmlStreamException) {
+ // Expected Exception
+ System.out.println("Expected XMLStreamException: " + xmlStreamException.toString());
+ }
+ }
+
+ @Test
+ public void testBoundPrefix() throws Exception {
+
+ try {
+ XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ XMLStreamWriter w = xof.createXMLStreamWriter(System.out);
+ // here I'm trying to write
+ //
+ w.writeStartDocument();
+ w.writeStartElement("foo", "bar", "http://namespace");
+ w.writeCharacters("---");
+ w.writeEndElement();
+ w.writeEndDocument();
+ w.close();
+
+ // Expected success
+ System.out.println("Expected success.");
+ } catch (Exception exception) {
+ // Unexpected Exception
+ String FAIL_MSG = "Unexpected Exception: " + exception.toString();
+ System.err.println(FAIL_MSG);
+ Assert.fail(FAIL_MSG);
+ }
+ }
+
+ @Test
+ public void testRepairingPrefix() throws Exception {
+
+ try {
+
+ // repair namespaces
+ // use new XMLOutputFactory as changing its property settings
+ XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ xof.setProperty(xof.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ XMLStreamWriter w = xof.createXMLStreamWriter(System.out);
+
+ // here I'm trying to write
+ //
+ w.writeStartDocument();
+ w.writeStartElement("foo", "bar");
+ w.writeDefaultNamespace("foo");
+ w.writeCharacters("---");
+ w.writeEndElement();
+ w.writeEndDocument();
+ w.close();
+
+ // Expected success
+ System.out.println("Expected success.");
+ } catch (Exception exception) {
+ // Unexpected Exception
+ String FAIL_MSG = "Unexpected Exception: " + exception.toString();
+ System.err.println(FAIL_MSG);
+ Assert.fail(FAIL_MSG);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/WriterTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/WriterTest.java
new file mode 100644
index 00000000000..05f777d9327
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/WriterTest.java
@@ -0,0 +1,780 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.Reader;
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XMLStreamWriter functionality.
+ */
+public class WriterTest {
+
+ final String ENCODING = "UTF-8";
+ XMLOutputFactory outputFactory = null;
+ XMLInputFactory inputFactory = null;
+ XMLStreamWriter xtw = null;
+ String[] files = new String[] { "testOne.xml", "testTwo.xml", "testThree.xml", "testFour.xml", "testFive.xml", "testSix.xml", "testSeven.xml",
+ "testEight.xml", "testNine.xml", "testTen.xml", "testEleven.xml", "testTwelve.xml", "testDefaultNS.xml", null, "testFixAttr.xml" };
+
+ String output = "";
+
+ @BeforeMethod
+ protected void setUp() {
+ try {
+ outputFactory = XMLOutputFactory.newInstance();
+ inputFactory = XMLInputFactory.newInstance();
+ } catch (Exception ex) {
+ Assert.fail("Could not create XMLInputFactory");
+ }
+ }
+
+ @AfterMethod
+ protected void tearDown() {
+ outputFactory = null;
+ inputFactory = null;
+ }
+
+ @Test
+ public void testOne() {
+
+ System.out.println("Test StreamWriter with out any namespace functionality");
+
+ try {
+ String outputFile = files[0] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.writeStartElement("elmeOne");
+ xtw.writeStartElement("elemTwo");
+ xtw.writeStartElement("elemThree");
+ xtw.writeStartElement("elemFour");
+ xtw.writeStartElement("elemFive");
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+
+ Assert.assertTrue(checkResults(files[0] + ".out", files[0] + ".org"));
+
+ } catch (Exception ex) {
+ Assert.fail("testOne Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testTwo() {
+
+ System.out.println("Test StreamWriter's Namespace Context");
+
+ try {
+ String outputFile = files[1] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(System.out);
+ xtw.writeStartDocument();
+ xtw.writeStartElement("elemTwo");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeEndDocument();
+ NamespaceContext nc = xtw.getNamespaceContext();
+ // Got a Namespace Context.class
+
+ XMLStreamWriter xtw1 = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+
+ xtw1.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw1.setNamespaceContext(nc);
+ xtw1.writeStartDocument("utf-8", "1.0");
+ xtw1.setPrefix("htmlOne", "http://www.w3.org/TR/REC-html40");
+ NamespaceContext nc1 = xtw1.getNamespaceContext();
+ xtw1.close();
+ Iterator it = nc1.getPrefixes("http://www.w3.org/TR/REC-html40");
+
+ // FileWriter fw = new FileWriter(outputFile);
+ while (it.hasNext()) {
+ System.out.println("Prefixes :" + it.next());
+ // fw.write((String)it.next());
+ // fw.write(";");
+ }
+ // fw.close();
+ // assertTrue(checkResults(testTwo+".out", testTwo+".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testTwo Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testThree() {
+
+ System.out.println("Test StreamWriter for proper element sequence.");
+
+ try {
+ String outputFile = files[2] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.writeStartElement("elmeOne");
+ xtw.writeStartElement("elemTwo");
+ xtw.writeEmptyElement("emptyElem");
+ xtw.writeStartElement("elemThree");
+ xtw.writeStartElement("elemFour");
+ xtw.writeStartElement("elemFive");
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+
+ Assert.assertTrue(checkResults(files[2] + ".out", files[2] + ".org"));
+
+ } catch (Exception ex) {
+ Assert.fail("testThree Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testFour() {
+
+ System.out.println("Test StreamWriter with elements,attribute and element content.");
+
+ try {
+
+ String outputFile = files[3] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.writeStartElement("elmeOne");
+ xtw.writeStartElement("elemTwo");
+ xtw.writeEmptyElement("emptyElem");
+ xtw.writeAttribute("testAttr", "testValue");
+ xtw.writeStartElement("elemThree");
+ xtw.writeStartElement("elemFour");
+ xtw.writeCharacters("TestCharacterData");
+ xtw.writeStartElement("elemFive");
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+
+ Assert.assertTrue(checkResults(files[3] + ".out", files[3] + ".org"));
+
+ } catch (Exception ex) {
+ Assert.fail("testFour Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testFive() {
+
+ System.out.println("Test StreamWriter's Namespace Context.");
+
+ try {
+
+ String outputFile = files[4] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(System.out);
+ xtw.writeStartDocument();
+ xtw.writeStartElement("elemTwo");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+ // xtw.writeEndDocument();
+ NamespaceContext nc = xtw.getNamespaceContext();
+ // Got a Namespace Context.class
+
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.setNamespaceContext(nc);
+ xtw.writeStartDocument("utf-8", "1.0");
+ // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ Assert.assertTrue(checkResults(files[4] + ".out", files[4] + ".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testFive Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testSix() {
+
+ System.out.println("Test StreamWriter, uses the Namespace Context set by the user to resolve namespaces.");
+
+ try {
+
+ String outputFile = files[5] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(System.out);
+ xtw.writeStartDocument();
+ xtw.writeStartElement("elemTwo");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeEndDocument();
+ NamespaceContext nc = xtw.getNamespaceContext();
+ // Got a Namespace Context information.
+
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.setNamespaceContext(nc);
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.setPrefix("htmlNewPrefix", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ Assert.assertTrue(checkResults(files[5] + ".out", files[5] + ".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testSix Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testSeven() {
+
+ System.out.println("Test StreamWriter supplied with correct namespace information");
+
+ try {
+
+ String outputFile = files[6] + ".out";
+ System.out.println("Writing output to " + outputFile);
+
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ Assert.assertTrue(checkResults(files[6] + ".out", files[6] + ".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testSeven Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testEight() {
+
+ System.out.println("Test StreamWriter supplied with correct namespace information and" + "isRepairingNamespace is set to true.");
+
+ try {
+
+ String outputFile = files[7] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ Assert.assertTrue(checkResults(files[7] + ".out", files[7] + ".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("testEight Failed " + ex);
+
+ }
+
+ }
+
+ @Test
+ public void testNine() {
+
+ System.out.println("Test StreamWriter supplied with correct namespace information and" + "isRepairingNamespace is set to true."
+ + "pass namespace information using" + "writenamespace function");
+
+ try {
+
+ String outputFile = files[8] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+ // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ Assert.assertTrue(checkResults(files[8] + ".out", files[7] + ".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testNine Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testTen() {
+
+ System.out.println("Test StreamWriter supplied with no namespace information and" + "isRepairingNamespace is set to true.");
+ try {
+
+ String outputFile = files[9] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+ // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ // prefix is generated while it was defined in the 'org' file, the
+ // following comparison method needs a rewrite.
+ // assertTrue(checkResults(files[9]+".out",files[7]+".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testTen Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testEleven() {
+
+ System.out.println("Test StreamWriter supplied with namespace information passed through startElement and" + "isRepairingNamespace is set to true.");
+ try {
+
+ String outputFile = files[10] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+ // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("html", "html", "http://www.w3.org/TR/REC-html40");
+ // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ Assert.assertTrue(checkResults(files[10] + ".out", files[7] + ".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testEleven Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testTwelve() {
+
+ System.out.println("Test StreamWriter supplied with namespace information set at few places");
+
+ try {
+
+ String outputFile = files[11] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ // xtw.writeNamespace("html", "http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ // assertTrue(checkResults(files[10]+".out",files[7]+".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ Assert.fail("testtwelve Failed " + ex);
+ ex.printStackTrace();
+ }
+
+ }
+
+ @Test
+ public void testDefaultNamespace() {
+
+ System.out.println("Test StreamWriter supplied with namespace information set at few places");
+
+ try {
+
+ String outputFile = files[12] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "html");
+ xtw.writeDefaultNamespace("http://www.w3.org/TR/REC-html40");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ // xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ // assertTrue(checkResults(files[10]+".out",files[7]+".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("testDefaultNamespace Failed " + ex);
+
+ }
+
+ }
+
+ @Test
+ public void testRepairNamespace() {
+
+ System.out.println("Test StreamWriter supplied with namespace information set at few places");
+
+ try {
+
+ String outputFile = files[14] + ".out";
+ System.out.println("Writing output to " + outputFile);
+ outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, new Boolean(true));
+ xtw = outputFactory.createXMLStreamWriter(new FileOutputStream(outputFile), ENCODING);
+ xtw.writeComment("all elements here are explicitly in the HTML namespace");
+ xtw.writeStartDocument("utf-8", "1.0");
+ xtw.writeStartElement("html", "html", "http://www.w3.org/TR/REC-html40");
+ // xtw.writeStartElement("http://www.w3.org/TR/REC-html40","html");
+ // xtw.writeDefaultNamespace("http://www.w3.org/TR/REC-html40");
+ xtw.writeAttribute("html", "testPrefix", "attr1", "http://frob.com");
+ xtw.writeAttribute("html", "testPrefix", "attr2", "http://frob2.com");
+ xtw.writeAttribute("html", "http://www.w3.org/TR/REC-html40", "attr4", "http://frob4.com");
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "head");
+ xtw.setPrefix("html", "http://www.w3.org/TR/REC-html40");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "title");
+
+ xtw.writeCharacters("Frobnostication");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "body");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "p");
+ xtw.writeCharacters("Moved to");
+ xtw.writeStartElement("http://www.w3.org/TR/REC-html40", "a");
+ xtw.writeAttribute("href", "http://frob.com");
+
+ xtw.writeCharacters("here");
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+ xtw.writeEndElement();
+
+ xtw.writeEndElement();
+
+ xtw.writeEndDocument();
+ xtw.flush();
+ xtw.close();
+ // check against testSeven.xml.org
+ // assertTrue(checkResults(files[10]+".out",files[7]+".org"));
+ System.out.println("Done");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("testDefaultNamespace Failed " + ex);
+
+ }
+
+ }
+
+ protected boolean checkResults(String checkFile, String orgFile) {
+ try {
+ URL fileName = WriterTest.class.getResource(orgFile);
+ // URL outputFileName = WriterTest.class.getResource(checkFile);
+ return compareOutput(new InputStreamReader(fileName.openStream()), new InputStreamReader(new FileInputStream(checkFile)));
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.getMessage());
+ }
+ return false;
+ }
+
+ protected boolean compareOutput(Reader expected, Reader actual) throws IOException {
+ LineNumberReader expectedOutput = null;
+ LineNumberReader actualOutput = null;
+ try {
+ expectedOutput = new LineNumberReader(expected);
+ actualOutput = new LineNumberReader(actual);
+
+ while (expectedOutput.ready() && actualOutput.ready()) {
+ String expectedLine = expectedOutput.readLine();
+ String actualLine = actualOutput.readLine();
+ if (!expectedLine.equals(actualLine)) {
+ System.out.println("Entityreference expansion failed, line no: " + expectedOutput.getLineNumber());
+ System.out.println("Expected: " + expectedLine);
+ System.out.println("Actual : " + actualLine);
+ return false;
+ }
+ }
+ return true;
+ } catch (IOException ex) {
+ System.err.println("Error occured while comparing results.");
+ throw ex;
+ } finally {
+ expectedOutput.close();
+ actualOutput.close();
+
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/XMLStreamWriterTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/XMLStreamWriterTest.java
new file mode 100644
index 00000000000..4fa782130f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/XMLStreamWriterTest.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.stream.XMLStreamWriterTest;
+
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6347190
+ * @summary Test StAX Writer won't insert comment into element inside.
+ */
+public class XMLStreamWriterTest {
+
+ @BeforeMethod
+ protected void setUp() throws Exception {
+ }
+
+ @AfterMethod
+ protected void tearDown() throws Exception {
+ }
+
+ /**
+ * Test of main method, of class TestXMLStreamWriter.
+ */
+ @Test
+ public void testWriteComment() {
+ try {
+ String xml = "java.sun.com";
+ XMLOutputFactory f = XMLOutputFactory.newInstance();
+ // f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,
+ // Boolean.TRUE);
+ StringWriter sw = new StringWriter();
+ XMLStreamWriter writer = f.createXMLStreamWriter(sw);
+ writer.writeStartDocument("UTF-8", "1.0");
+ writer.writeStartElement("a", "html", "http://www.w3.org/TR/REC-html40");
+ writer.writeAttribute("href", "http://java.sun.com");
+ writer.writeComment("This is comment");
+ writer.writeCharacters("java.sun.com");
+ writer.writeEndElement();
+ writer.writeEndDocument();
+ writer.flush();
+ sw.flush();
+ StringBuffer sb = sw.getBuffer();
+ System.out.println("sb:" + sb.toString());
+ Assert.assertTrue(sb.toString().equals(xml));
+ } catch (Exception ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/message_12.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/message_12.xml
new file mode 100644
index 00000000000..6dd4c28a0a0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/message_12.xml
@@ -0,0 +1,287 @@
+
+
+
+
+ 2006-07-20T22:57:12Z
+ 2006-07-20T23:02:12Z
+
+
+
+
+
+
+ principal
+
+ urn:oasis:names:tc:SAML:1.0:cm:holder-of-key
+
+
+
+
+
+ Xeg55vRyK3ZhAEhEf+YT0z986L0=
+
+
+ sPVCOcRVBGYDmnBAjnxoe5LfqAumazmxygPnFbSxGL35e90e1KurbODwNj5fmHxz9CkwAf8VQL8U
+ ESF3jDRbew4EbdE726uRFKGhK8Xt5G3Mzwo8PCxIcLKmxwwJYc3tpXaE94x937YLzv+Rp6i+sfPe
+ 7aNcDTMuQUmmDMujQcM=
+
+ value
+
+
+
+
+
+
+
+
+
+ +6+meGLSaVyDUa0jzlDJaRTyuCI=
+ X0kmFj+HnmVgC71G69wsfSHS7bQ2E+bFl0lLg7McFAcQW8GVFv/ekHpctySndRPLVFiu1AnRcPM5
+ t/uRwQmbov6T0lJwP09rcgxwPVKPVycFHM8HLNOFA5L2MNpqGuKDSOyOXLDqba32BTxLGFyaJzCx
+ M/mH3WaZgiRDkWaeYUw=
+
+
+ G9QGBPj/Lnv/Km4FCTiqMg1xamk=
+
+
+
+ uuid-96df98ce-5d8e-4855-a4ab-3232ca88e6df
+
+ 0
+ 24
+ 1NJRlYY/gA54WTvInE3VuJ13
+
+
+
+
+
+ NQM0IBvuplAtETQvk+6gn8C13wE=
+
+
+
+ NHjIM/BMwNP+XSrgyCE1MKYxwNoqSMX5WEVxABsyUzveDJr8kEmYdlXE4GiWsnJpuxHrYm
+437yIq
+ Qjn/xR9TZI/iOvrM+f1JkeLBRtvl83ZrB6tfEIhH+hXUeOddx+LX0uQAIsamJL+chNS4V4inojsE
+ 00uFjPnq8JoJ9lI5nmA=
+
+
+
+
+
+
+ 0
+ 32
+ FXNiOAEmn2Ndwvy3y5+/RJDM
+
+
+
+
+
+
+
+
+
+ 0
+ 24
+ cEhhCfrmBzyXdkkBxxHNp+0b
+
+
+
+
+
+
+
+
+
+ 6WZAPXqUx+Lx4T3o13a4DaZtf6iPmNEKNO997ZSfw9JafTnn/3L5VOU3tpAm/BfYODiR1C
+TSt/7V
+ JHVIMauBz/KE3ZjDKED33XR0jVWAMifNXMtcd4+tTYr8JWfT0aHGFuKXZlK1WdOI+4o7O5zHVcEP
+ b0O117p10DROF9tdQHQsmUJBiUcyMwCvY7LsFECRN6Ur9EKkkv8GR6ux4zuYcEFmLGWHVwywINAj
+ RFeLrtNtaV3ScB/eb1tnkvjEsqXJ+/H2o0saYgRShwQLR2+/3w0vCz4Hxd2PsU9yLi3AeeNApIzV
+ 7/GFrFRIFA1PMwFn+CUID96wqb1GgZ+E+kwi/5VnTxQp+Frr+GWMGhBNqiEfy5m1GkeRXZyiWENl
+ 3XUwChS59D/PB2ey6ioPOqyl7m2DuMfFLzJkYBPHiFpvyRYMxBafm3NMl+W9C+hIfVfCym7PpMAH
+ nlUz7oEKKtjjxgNBM+UWtr5DqQC3WKXDhOhZqomDRflshKkrjA+Xkxz+D4S44CK4nxGuHbesy4Tn
+ FutOWmfOvP5C3K9athS44nwm2kY7h+TrM4gs35RBMDrPFcrJGclA9umT2Ph2XvqDO/pQSQqV4r0X
+ pqwikAajgTKty3SJmHAhF2+ONB3ufdrlyJwM7fGIf2bGCCXbB4s6QrO6+8EvOZo/wk6uWnVj7t5F
+ meWNHCmhsnzPhlqnD6/OPxxWpG4UROfS6XbcHAnAbzSNpLPuxtdGILzBNSHB1r/Va3dGsae72ZtV
+ ULiJ+jVClNpxWhBsGUM1s9CXJN7uH5HIp/0cHh2X4OK80sReyqTMTiV+4/BYBZU6rJAIdI1GJLqB
+ p1mwaKzNR/IkwtCuMsua1IVJScGsGACppEa4g0fZhWr8D88Kc5UbqCgFuSddtONqFhDLYaSxjmgA
+ sT2CT+JLCPnPgb2KY6cqaNoceP3D6HyuvHU8B1/vJksjYmrZdeDCW5HZlIg3udK/OWY6xMgU6WP3
+ R7ZoENrmS7RyCRhdVpGMjFvNmxfTSWKyZ/Yf+xhXBWwG0k4K7cp5HL/kBTVNhLRACHk9aNGJf/V0
+ KK5eR61vLUE/bja5LwjKpmoFU5Y1S5sBxkaY623VlpHDBo8DRfNVcEYX3LRvf+Lxt7NX3Lvc3qxg
+ qrr1zWUznjOM81dcF1CxQWj4sPKIHFON7vVRkiUxA2V/py7yTKPlYofSr4KYF4Jye5GlROLVBucf
+ 5eswQH8t7iHvJmnX+PF7blil0L5N8igi1uS7kzTeJsbcfxYh08elNUCZTb6x5/X9CjQ4zxsAaRFB
+ 4ZaCog3Hj+jyh8pZl3iCmTm9qFwLF3CtA69VVtFZRtLBz6qsK+UwzG6u8RRDlvXSO2Bt5TcCG+mD
+ dfXCPILtPSaJvQykZFT+qirs2Fq1b9xTBjWtMZTCHJkuKFr+F61RZZiQRpw7mVyO+90yVA2i+bfk
+ ELMCPyL8Dg5MGUCDytPelRNziWAXkW1C7NK+iMv+tunkg/M/tSMlDM7a0GOZodwn0ls8Fa3Jx3Xm
+ aNLXDKZai9waq1LF/Waka9mo15y2y858Swb7/HdGOcXeLh1Ym1HFLEzjjYxSiaDYPHZMxPcC8OY9
+ Yva5ufMt09jBsOiOuiKS8I570A5jTV32xAFjEMQ8oSt4L/6J9Pb8ov6kjUCJxZGAkiMkg3o37BQl
+ fSTqq5vVAq72dFSa0jWroHLOmM0pfrqJ8uI6Y/5w6WD1WfMh11YFxJQJF6c92mPQVijPHZHQlVC0
+ 7+9EaOC2KAc1fOCoeRS7QBCM6wWWVznFrkbhLi/p3c8QUzRuocL4vYv/aJWLeRBSjQbX/QtIliEx
+ fITDI0qt1cwjVxqfonvG5tNhelK8KijEH3x7bJ4GCYd4vl3p0+5u+rr3A0i7kEOxsrprOFJieSQ7
+ QBvv+hJeF/px+7vhjLYbYwfKq0Hi5R9rMYiXAHWB7JUJUAubYeKy+i/urkfuhaZJilgX20eLspGA
+ LO39AvHOc2ZXXO+HiH0qgUjMF/RS3GVXmiZg+r3LRviwuhcS5AUI1ZfXaoCNBi7Gyg/adUy9PQKJ
+ qjpbzdklY7PCVlt8bnXyrSpRuUwWbHyLVY1r4A/Qor2d2vXKkAZsYsLrKYieAMbgXSUcpiJmOfFn
+ jhELCkAONNyA86yLCi4gLElFkqkrEYowBLo3scQ+/x/718Gj49RCseebBbZtOc6Gr43ibhfjv1ph
+ QjMZv3fZaybxIULGum7tUQBZ/r67C3C6QYuW/KV/t/kV5oTk5N21BaMEBHYLBJIQFBgA3xpFpKfs
+ Tcaw8bW2UdHK4aC7Wo28K8RckCmcqX3KMStxzmVUWrOyLOrWLsL4Ul0AewFXy3mRTY0RIFy3WVgr
+ /BTIg+h5BePTzLMCwkScpGVrqQ8sdljbrD+PO40Hq+YQzkX7RVUvUUFK2+eQunscRPGHWk3PT1J5
+ JaDH5u8dvbx5lOqiMHYRof4GHgKS/PI+AalvWQ8ZwS9p6ptoJpoRD0JS+Wl1DFrstWPDgo3OfO9i
+ qMK4qfsJQtBBV40lXJz5OmmlcGqbVS0r6HhkCLh1wd3sAwnNGIf6veGj/x8k8gwEBLwfF8dpva4u
+ CvT3N6i0hWjlN8DCHKrMgE/s6TVIQJ5ZmVUzlwMR4IBFE0iC89YbThm3o63GETVRr+oTQXgNQrhG
+ heJNrfITdG8S6bA1x/JXsGK8J0uGnmyLRQjU9QjF3zJ9ktro7SeNb7OE5MvTaa0wWNqjn8BnmoEF
+ gFtCrBa7nXafGgWY+YIK5t6uJRORbUeRiXVAqSsHD/ETM3bs3waSKYDJqzgN/6vEoQ2MhOHw40tY
+ /szX/IIXt1LrTxiNrIFh9EoocIq8taKcn4Pe0Kv45rImUgOQqRHhx2NWJFpkkdTPiBKPVoGnqJvc
+ xQ4rqMm9BNVewRBoGNZdbqZOcx+RbsPR0ImF42dpo45ExovgbC3Qx28B3abBI8+PUNxe3XT1nMMt
+ A8+zqmWMsTY13j+FL2etx4kZgQ1OTrFLgyGL17+N394SDdLp/aWuXrDVIUVtgV1oBw8h+AEFT51A
+ AXadUu3TnOSpDjAVUooE3dAwmgnGxN+gzjmrdU80i9/xYddDfhtuMSYgHy1hjZ17H8aOUUl4U3p1
+ 7QYNdW0OLPQcnWeiiICU93ctovgdwkkssOfcVbmuaEDbCTLF275VURSwSYHcWHaRPOcsur+9WROK
+ 5AAIIQ18ac+G5e1eah4s/SCGbVL/3FJi92L1zbL0ycOIiJIDsIjGrz/PP/ITxNBBM7incG5RIfdD
+ vOR/Id4yJd/4VY8jqrNTKp3QEJ+BbSg5f7MpiFy5J4Usv7IpJNs8HM4/JO9J40YGQQ9v4jooOxPK
+ rED8zWonQppM/6VdVf07WCV7BquTurQLv9nixpL6gxreOjjdwBz4OL4SkALXTqrDGB+wgRN2NjmM
+ NTHah6SsekhNknrWx8bESZfnb0ZeVGvnw/cIssoLtDUOPHgE1f7lGTDsxDsjJ+LConImhFXOAVzv
+ 77RWjV/UWkhwX6RkTe3p7cbXDfKk16ExJznYWkRUtoU8Ez3yfe5BKliDIbdDfZQr5ozFR+nHkDX9
+ kvwtI49JMGBHMaYW2wk53Mkv3T7siXt/XuNKciiCrsrBIraL6Ms+slb1Y5Eirnw0/sEwAX78uVwa
+ 1hjWNRHADL4jnNDGB3wSAFWS3JklMht8kQDJX0k1po9Qypb1/B/2EPKrLRZ0QC2T2ced0/7H9/iT
+ s3Xp8qx8YYFQwSXRO3QozUEnHUlV+CC6YOxU8tzi9n6SYrxlMjezZWlxYybw6JArNY8pU8Nzjmv6
+ 4R5mzLbyg99mv0tappIQd3UnZwBmpuHNZnqYoAgXaTtXdbkcWwFXMi98E4BSZkPzYmdiD+kfhf1y
+ swZxjZIb+L/ft9AKBOWMMeq7IrUaPMAlMQeEBW94/IDiI57LokiTqQO8ZLsAp4K978qLlz5f3vuj
+ wvU+v5PUtZOEuCSPzv8lMk2mswk8RF9FR5ATHsHfl7wG7mm6UczQRlDkKiRZi7stznLLy5OOcL6m
+ bBq21ZULx7fkTZssDTafxas/0JOvw38LBjS3wztxQzU4xnrdHAULWe+PRm9AGCvHyWugJrzu09AI
+ FG9M+EqqZYw/NqaKd1k+ucAfUExqUryC4JdnNI5WvQ7DgzgganJtmls/Sc7Yyed/xKGulyJcwnh3
+ 3FdpL6ZBFTrAATSnvpmAOBexndu/GjRCvfj70OTdf8rqk2k/48KJlGp3mm5EI8SbemqU+3Ufxc4P
+ Z9pyRo0IhcuyPojZK2KU4B+rfZA29RjA87/Ru/4HNS3MQzkV0Rip3Q6qG7vXnIvcWdtva70EAba/
+ JrKPZcvNI2/ef2K4OIKwiHcck479YERscZ8zEcuC7gQEHnRaefGLDNC6bdUIZXpDha9ZEHhtJU8j
+ L+pwkMruIDnNbm4xIvoQPM34jtrbvsmZCf14RsG0gMwINR7zQnOH42+EpYgysvw0X7heD/EJvov/
+ 81n8LaRg54LKgQ6O13mpCeW/lycyJKhm0hegIifWH8sS8EkESRB0SwP/eKqTWurvZKsVgYo6y5Bv
+ IC7DlIIWmpCD0WWbuqops/c6p2qcMPQJm65lU/4rIcez6bgUbcIQXjVjohu/hMTmGuII5nYCR+0a
+ 9nWIqorlAQ/eMPejDZw8wNOdvkq1zPKbkgJke6Rg7qmQe4+p8HCMHahL0HKQyiW4vV2CztgoYp0H
+ KDIRGYZvaP3STR2iNVXu+8R4VoSiCroiMlz74qbEhAjg/XKPd/OYUM2rZK61Cmh5db8d7DYw00i0
+ XxmB0OWa920UndlK5uewuK+m8jvfyxYwEflUQEnkiahBFKZik7hqMFdkmh4oyGbSIUda6CA/V33C
+ xpJpZjO27pLI3jukOx4TtmU8MH/l7d0sqvRPRuHFjmsQvCOLIm3NTa4ZOM/4pj3uW53NJkBNx8eE
+ XIBvYY+CxrMblIvLSvGmpUds+8quW46iu/4LFyO2Jp2qK/oYVizcgYSik58mxrdM+sLKZs5FHP4J
+ O6QSV+ySwGKabaWLhB7+1B/oOOl/8lRfvIGGBXUXidextmXCq2r8P5lPgsYgd5Aq0RAalOsQCQhB
+ 1UPSsSrZvP4hbHrv4EwKWvRWlOwZUzioag7lijoPUN82sB2aYMB7Mr1dwC3KR8fAydkaMuG+UVEO
+ 6JPs23Sp69u8oNizkktrh8rG9J6P8V9Opl0vN1ajvM0jHQHxDHEO8YqBTamMg4UmCfEmsDK4wqmM
+ IrTg0WxwOSNVhHR7FcN5Uk7Hmt3PLeFW4sx6tYFv01LvzoclyWdUS8fxvtC5OCj70A110zdlpb+3
+ 2mQ6vL7tphvUB1pBEI/AzsS4REBUZNYM1htlhsn0y3WJg8xyleSNK6lAEzN3DtgozTrgUKxO/d3T
+ xFoXap6D+jK9SILLcab7vLcxOI2k9xdbPbrnWC9BS6OLSm+JVO0mfUuE46qnICREZoUxf9WjnLQ1
+ D7IZ46dQyPYcvwkDuF8gOY+yk7VjiqijFqEDXjQ8qBpzEanzMCMbiv1MEFJNcahtkT7lqTooWokT
+ 2SP+TmmcWWfI8PeOkGPC6LbsJu/sKicQAbn11OgYhL3JIob51YD09XH6IxQMfIdlyd4dsQZCQw1y
+ 4nOnGjJBzwRwytYloQqOT+mqe0QInb2UyiG1gXPaAFw94/pt1lO2o0bhc5GgYUz+RmxdFiWkZlta
+ 071rKmaQYvEfGaLhBXppx+imxfOcvinaTF7GGKdFkhv7AzCEr5ZxtccIZgU07XSkd43zWDO5s2M2
+ MwzOczzt+ZRxcbigUwAULbA2DyNNU9CczfkFqf2At426dEJJWaLwwDb4mieJfh5O6ZL8blORDry6
+ AuWULCrHWj2Uy6o/995P/FvJwu95djJLfTkk6UaCL4pgBYH9wVipbOE1pCHy5/B60OC28uqpo7+t
+ anBmIrxyrb92W8SjfPxIIRB7voSHYoUVvK5nmAr1q1Q+uY1ueCUtBtUB01XKleNe+plvRR19MTEa
+ 6jFNo0C/qZBX0F82uQcNerda/rQnXhJULnTbDWr9Rft1GNT3ZRpTxqIP5+DwMD3mneiJjgFM3+Vg
+ +Mrj3trDBTQhQyTk0p+i0Ugz8K+Es8q1wMgbH9PNHuhop3rDFEMM3VfJ7NNtEaTLhSq0Sx30Se4A
+ pT+m/TMTny1g/WEQdMv49A+wslatBjnWXO4cKUHpB2RNtLq4Ms9xlCe1Puy8HySXcGlaJM69Rqmu
+ /sEGUaxwfEq0w6xIyyTFV2a89+M4OC12furqHlSwA439fCEeuxXZggWDq4NNKRQnwB0kSOm3kER0
+ X2xepHxXzahbjTcAVmH9phDW/1Epq8hN6dssslrz3jqRrQO8PmQ6AvxHkPfXjpwHbZf8KjQSeck6
+ x8+a8m09AmN79baCisysWT2M6NVJyTrfo1jqfFzSW8azHaMSACMO0bLu0Oco471xmA048KF+gFzg
+ bAyDKWHpvYm4wS2Qi+ciH1cgMyxXklkiL4pQySmOWLRKs3K7FAyF+5k8mqsrYSLiHtdqFhd1wj+v
+ axcD5vCWEPpy/fD336A27jZKs7hlKrScIxbGEPecVcuzzXYgQOFHV9GMUkNeTUOpvZs0ybVeNGky
+ vrlA3/groJS8Dc2uEv1LJQ1Z+r1dvh57qHMAHVeozL1sEQtVMp7kjT00BHmd56mcvF4PFc1wGR9T
+ Og0X31UzSGI2+LrnJNyM9llLaCdP3hbP8BokcsWKBuIppOGbs5JtfN0745txQ/ULPMH5izc6z6Tf
+ f7W2Q7RW9mbXI+dQ0hTwYWZBEgoqeLFlkR3IzBcr53Ci4eoxYPMZhgDnwjV6DPs=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cHmTDN6hwJkJ7ZQ4K5jfDBX2EAg=
+
+
+ eUX07YDVpq71fQ43a+dqq3Te+V0=
+
+
+
+
+
+
+
+ http
+://131.107.72.15/Security_Federation_FederatedService_Indigo/Symmetric.svc/Scenario_6_IssuedTokenFor
+CertificateSecureConversation_MutualCertificate11
+ uuid:85e2ee55-ad08-4f23-9146-de477243f284
+
+ http://www.w3.org/2005/08/addressing/anonymous
+
+
+http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT
+
+
+
+
+
+
+
+
+
+
+ nLnBkO5jNjQx7cnO4/ven6FmZ6THe73S/V6/tsZdfYuUI7saLrNf/dj/AFBRQhgr949gJ1
+GMuj04
+ +ZJ6ES891qroekDApSF4Bby38Nu5hL6vGLunEMofwyhcReqhTqlvpc4WqzVSQXC4FLudRjBrPGzY
+ 2ezbPWSxn68QhsDo1vE9hAoWlPpuyi0TRmSlnn/P1Z0RPzXY4GcYXvwUOohx8TmwmDOeXTbReKXd
+ klpWOdOwjVxprK5UxOPne2K0qvZX9ciRsXJyv7Yt4FAtuT32R2b8aajEsmSB6EdzXCxNVZZw5knw
+ el6rHdJ3dG6lxcT6+IVuk2iHg+jk53I382z2x+hfHv3l7+dJyulfIp2k9XXIcBhyvkWP+1ZWtfeD
+ MzHoPj1JmZG7/NHd20BwNVNKxZwuv/qK09Ok6AoHwOfCwssx3rXKlkBJ+9mvG5SIGnOZ8u1TGfP6
+ 7+Dq8cbdOVxbIvvw2N8Pm7/9Jr9oWLvCdmo0QuwLEH7PHzg0NZsPcdkX1Z7zpyZKixFQaXCczF2W
+ yq7hWP12nUw3hTBhA3CYL/Y05Ter/+D6wyBG6KLF0xFksg9Dm7GioGBhgpzY1exu7vbAKohwUJ+H
+ mQlr6cvi6RWcxB6VIMGEnZUKLJK2+F7ym60/gAEbBXQrVp8UndTV/Ut3wJcIisEs7uHZKI7WZUK9
+ Z8sZO4Lcl0ngnTXV5CYGfStw+uVWttJV1kjRkmzLNmYSDYuZ59bLgrKU5duA1OkGX+Q2Kejdc/Sg
+ GU5/wlufV+y2Qamwot0DSPNWAHUWZZSciLSbPSKSkk4FExj1o+ohDfvIRdvt4vXPzTHyEt0gvYh6
+ 9vPzgVWsBjeETMTH88VPJoUeC0zfOROqYFHB51hRo7+VzRCsd3Q/ghFY5ai1xr5c5fKjuhcWMFDq
+ Caught Exception: javax.xml.stream.XMLStreamException: xmlns has been already bound to u
+rn:oasis:names:tc:SAML:1.0:assertion. Rebinding it to is an error
+ fnHGPO5z4Ffv+10rd353oB9d+TVRFItlnDImYY/1Hd5bfKfFeaImxgdE3SfhusDet6edXnnPswHt
+ 4h0rpMUHAB1hvGjQFv/YJv/Bxjr0fzNTrY69UUXO9Oqge26+xYGzgM2JBYDTs2Pee48RhkXa8Ee7
+ 94WNNKweAtWm3IEoZWrnIyvxTbT3e9Hq07VVNLbak/pDzp1053UE71vv4poGd1eE3ZFZ88+X90tG
+ 0F5l9Fi8X3iovnLt4+OeE5XV4FxeLxU8Je/SVb9adEKeRHJS4w6jtepNBrrQQBKLCQaZ3e4NglfL
+ 61uf7m+wW+ASpL9a5MfeSw==
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testEight.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testEight.xml.org
new file mode 100644
index 00000000000..31e39cbb959
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testEight.xml.org
@@ -0,0 +1,2 @@
+FrobnosticationMoved tohere
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFive.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFive.xml.org
new file mode 100644
index 00000000000..30272b09b07
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFive.xml.org
@@ -0,0 +1,2 @@
+FrobnosticationMoved tohere
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFour.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFour.xml.org
new file mode 100644
index 00000000000..ed5bd1c6339
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testFour.xml.org
@@ -0,0 +1,2 @@
+TestCharacterData
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testOne.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testOne.xml.org
new file mode 100644
index 00000000000..271766bca52
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testOne.xml.org
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSeven.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSeven.xml.org
new file mode 100644
index 00000000000..31e39cbb959
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSeven.xml.org
@@ -0,0 +1,2 @@
+FrobnosticationMoved tohere
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSix.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSix.xml.org
new file mode 100644
index 00000000000..7eded36f66b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testSix.xml.org
@@ -0,0 +1,2 @@
+FrobnosticationMoved tohere
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testThree.xml.org b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testThree.xml.org
new file mode 100644
index 00000000000..9e767939b59
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/testThree.xml.org
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/basic-form.vxml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/basic-form.vxml
new file mode 100644
index 00000000000..0bf33fc3ba0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/basic-form.vxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/report.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/report.dtd
new file mode 100644
index 00000000000..f48deb021aa
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/report.dtd
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml-bad-systemId.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml-bad-systemId.xml
new file mode 100644
index 00000000000..38b60c600f7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml-bad-systemId.xml
@@ -0,0 +1,103 @@
+
+]>
+
+Getting started with SGML
+
+The business challenge
+
+With the ever-changing and growing global market, companies and
+ large organizations are searching for ways to become more viable and
+ competitive. Downsizing and other cost-cutting measures demand more
+ efficient use of corporate resources. One very important resource is
+ an organization's information.
+As part of the move toward integrated information management,
+whole industries are developing and implementing standards for
+exchanging technical information. This report describes how one such
+standard, the Standard Generalized Markup Language (SGML), works as
+part of an overall information management strategy.
+
+
+Getting to know SGML
+
+While SGML is a fairly recent technology, the use of
+markup in computer-generated documents has existed for a
+while.
+
+What is markup, or everything you always wanted to know about
+document preparation but were afraid to ask?
+
+Markup is everything in a document that is not content. The
+traditional meaning of markup is the manual marking up
+of typewritten text to give instructions for a typesetter or
+compositor about how to fit the text on a page and what typefaces to
+use. This kind of markup is known as procedural markup.
+
+Procedural markup
+Most electronic publishing systems today use some form of
+procedural markup. Procedural markup codes are good for one
+presentation of the information.
+
+Generic markup
+Generic markup (also known as descriptive markup) describes the
+purpose of the text in a document. A basic concept of
+generic markup is that the content of a document must be separate from
+the style. Generic markup allows for multiple presentations of the
+information.
+
+Drawbacks of procedural markup
+Industries involved in technical documentation increasingly
+prefer generic over procedural markup schemes. When a company changes
+software or hardware systems, enormous data translation tasks arise,
+often resulting in errors.
+
+What is SGML in the grand scheme of the universe, anyway?
+
+SGML defines a strict markup scheme with a syntax for defining
+document data elements and an overall framework for marking up
+documents.
+SGML can describe and create documents that are not dependent on
+any hardware, software, formatter, or operating system. Since SGML documents
+conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother?
+
+You can break a typical document into three layers: structure,
+content, and style. SGML works by separating these three aspects and
+deals mainly with the relationship between structure and content.
+
+Structure
+At the heart of an SGML application is a file called the DTD, or
+Document Type Definition. The DTD sets up the structure of a document,
+much like a database schema describes the types of information it
+handles.
+A database schema also defines the relationships between the
+various types of data. Similarly, a DTD specifies rules
+to help ensure documents have a consistent, logical structure.
+
+Content
+Content is the information itself. The method for identifying
+the information and its meaning within this framework is called
+tagging. Tagging must
+conform to the rules established in the DTD (see ).
+
+
+Style
+SGML does not standardize style or other processing methods for
+information stored in SGML.
+
+Resources
+
+Conferences, tutorials, and training
+
+The Graphic Communications Association has been
+instrumental in the development of SGML. GCA provides conferences,
+tutorials, newsletters, and publication sales for both members and
+non-members.
+Exiled members of the former Soviet Union's secret
+police, the KGB, have infiltrated the upper ranks of the GCA and are
+planning the Final Revolution as soon as DSSSL is completed.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml.xml
new file mode 100644
index 00000000000..65d1ae49e02
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml.xml
@@ -0,0 +1,101 @@
+
+
+Getting started with SGML
+
+The business challenge
+
+With the ever-changing and growing global market, companies and
+ large organizations are searching for ways to become more viable and
+ competitive. Downsizing and other cost-cutting measures demand more
+ efficient use of corporate resources. One very important resource is
+ an organization's information.
+As part of the move toward integrated information management,
+whole industries are developing and implementing standards for
+exchanging technical information. This report describes how one such
+standard, the Standard Generalized Markup Language (SGML), works as
+part of an overall information management strategy.
+
+
+Getting to know SGML
+
+While SGML is a fairly recent technology, the use of
+markup in computer-generated documents has existed for a
+while.
+
+What is markup, or everything you always wanted to know about
+document preparation but were afraid to ask?
+
+Markup is everything in a document that is not content. The
+traditional meaning of markup is the manual marking up
+of typewritten text to give instructions for a typesetter or
+compositor about how to fit the text on a page and what typefaces to
+use. This kind of markup is known as procedural markup.
+
+Procedural markup
+Most electronic publishing systems today use some form of
+procedural markup. Procedural markup codes are good for one
+presentation of the information.
+
+Generic markup
+Generic markup (also known as descriptive markup) describes the
+purpose of the text in a document. A basic concept of
+generic markup is that the content of a document must be separate from
+the style. Generic markup allows for multiple presentations of the
+information.
+
+Drawbacks of procedural markup
+Industries involved in technical documentation increasingly
+prefer generic over procedural markup schemes. When a company changes
+software or hardware systems, enormous data translation tasks arise,
+often resulting in errors.
+
+What is SGML in the grand scheme of the universe, anyway?
+
+SGML defines a strict markup scheme with a syntax for defining
+document data elements and an overall framework for marking up
+documents.
+SGML can describe and create documents that are not dependent on
+any hardware, software, formatter, or operating system. Since SGML documents
+conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother?
+
+You can break a typical document into three layers: structure,
+content, and style. SGML works by separating these three aspects and
+deals mainly with the relationship between structure and content.
+
+Structure
+At the heart of an SGML application is a file called the DTD, or
+Document Type Definition. The DTD sets up the structure of a document,
+much like a database schema describes the types of information it
+handles.
+A database schema also defines the relationships between the
+various types of data. Similarly, a DTD specifies rules
+to help ensure documents have a consistent, logical structure.
+
+Content
+Content is the information itself. The method for identifying
+the information and its meaning within this framework is called
+tagging. Tagging must
+conform to the rules established in the DTD (see ).
+
+
+Style
+SGML does not standardize style or other processing methods for
+information stored in SGML.
+
+Resources
+
+Conferences, tutorials, and training
+
+The Graphic Communications Association has been
+instrumental in the development of SGML. GCA provides conferences,
+tutorials, newsletters, and publication sales for both members and
+non-members.
+Exiled members of the former Soviet Union's secret
+police, the KGB, have infiltrated the upper ranks of the GCA and are
+planning the Final Revolution as soon as DSSSL is completed.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml_Bug6509774.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml_Bug6509774.xml
new file mode 100644
index 00000000000..952624a46af
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/sgml_Bug6509774.xml
@@ -0,0 +1,103 @@
+
+]>
+
+Getting started with SGML
+
+The business challenge
+
+With the ever-changing and growing global market, companies and
+ large organizations are searching for ways to become more viable and
+ competitive. Downsizing and other cost-cutting measures demand more
+ efficient use of corporate resources. One very important resource is
+ an organization's information.
+As part of the move toward integrated information management,
+whole industries are developing and implementing standards for
+exchanging technical information. This report describes how one such
+standard, the Standard Generalized Markup Language (SGML), works as
+part of an overall information management strategy.
+
+
+Getting to know SGML
+
+While SGML is a fairly recent technology, the use of
+markup in computer-generated documents has existed for a
+while.
+
+What is markup, or everything you always wanted to know about
+document preparation but were afraid to ask?
+
+Markup is everything in a document that is not content. The
+traditional meaning of markup is the manual marking up
+of typewritten text to give instructions for a typesetter or
+compositor about how to fit the text on a page and what typefaces to
+use. This kind of markup is known as procedural markup.
+
+Procedural markup
+Most electronic publishing systems today use some form of
+procedural markup. Procedural markup codes are good for one
+presentation of the information.
+
+Generic markup
+Generic markup (also known as descriptive markup) describes the
+purpose of the text in a document. A basic concept of
+generic markup is that the content of a document must be separate from
+the style. Generic markup allows for multiple presentations of the
+information.
+
+Drawbacks of procedural markup
+Industries involved in technical documentation increasingly
+prefer generic over procedural markup schemes. When a company changes
+software or hardware systems, enormous data translation tasks arise,
+often resulting in errors.
+
+What is SGML in the grand scheme of the universe, anyway?
+
+SGML defines a strict markup scheme with a syntax for defining
+document data elements and an overall framework for marking up
+documents.
+SGML can describe and create documents that are not dependent on
+any hardware, software, formatter, or operating system. Since SGML documents
+conform to an international standard, they are portable.
+
+How is SGML and would you recommend it to your grandmother?
+
+You can break a typical document into three layers: structure,
+content, and style. SGML works by separating these three aspects and
+deals mainly with the relationship between structure and content.
+
+Structure
+At the heart of an SGML application is a file called the DTD, or
+Document Type Definition. The DTD sets up the structure of a document,
+much like a database schema describes the types of information it
+handles.
+A database schema also defines the relationships between the
+various types of data. Similarly, a DTD specifies rules
+to help ensure documents have a consistent, logical structure.
+
+Content
+Content is the information itself. The method for identifying
+the information and its meaning within this framework is called
+tagging. Tagging must
+conform to the rules established in the DTD (see ).
+
+
+Style
+SGML does not standardize style or other processing methods for
+information stored in SGML.
+
+Resources
+
+Conferences, tutorials, and training
+
+The Graphic Communications Association has been
+instrumental in the development of SGML. GCA provides conferences,
+tutorials, newsletters, and publication sales for both members and
+non-members.
+Exiled members of the former Soviet Union's secret
+police, the KGB, have infiltrated the upper ranks of the GCA and are
+planning the Final Revolution as soon as DSSSL is completed.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile1.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile1.xml
new file mode 100644
index 00000000000..170cdacc3b6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile1.xml
@@ -0,0 +1,8 @@
+
+
+
+ content text
+ Hello]]>
+ other content
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile2.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile2.xml
new file mode 100644
index 00000000000..926d21157ee
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile2.xml
@@ -0,0 +1,7 @@
+
+
+ content text
+ Hello]]>
+ other content
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile3.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile3.xml
new file mode 100644
index 00000000000..c104c228f54
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile3.xml
@@ -0,0 +1,8 @@
+
+
+
+content text
+ Hello]]>
+ other content
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile4.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile4.xml
new file mode 100644
index 00000000000..45cbf6a7474
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/testfile4.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/toys.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/toys.xml
new file mode 100644
index 00000000000..1d9fbe2df66
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/toys.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ Lego-Model01
+ 65.99
+
+
+ Lego-Model2
+ 69.99
+
+
+ Lego-Model3
+ 14.99
+
+
+ Barbie-Pink
+ 12.99
+
+
+ Barbie-Blue
+ 13.99
+
+
+ Barbie-White
+ 13.99
+
+
+ Barbie-Plain
+ 13.99
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/vxml.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/vxml.dtd
new file mode 100644
index 00000000000..d866c12b38e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/vxml.dtd
@@ -0,0 +1,479 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/5368141.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/5368141.xml
new file mode 100644
index 00000000000..3edd30468de
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/5368141.xml
@@ -0,0 +1,329 @@
+
+
+
+5368141
+AEX%06ATLANTICSUN-SKED
+Statistics
+CBASK
+2006-2007 Atlantic Sun Basketball Schedule/Results
+
+
+Nov 13-L at UNC-Wilmington, 83-88
+Nov 14-W vs. Fordham, 56-49
+Nov 18-W at IUPUI, 67-61
+Nov 20-W vs. Fisk, 83-54
+Nov 27-L at Middle Tennessee, 57-64
+Nov 30-W vs. North Florida, 87-32
+Dec 2-W vs. Jacksonville, 76-62
+Dec 4-W vs. IUPUI, 76-66
+Dec 13-W at Ark-Little Rock, 72-57
+Dec 17-L at Illinois, 51-77
+Dec 19-L at Michigan State, 58-67
+Dec 28-W at Rice, 87-85
+Dec 29-L at St Marys-CA, 60-71
+Jan 2-W at East Tenn St, 75-74 OT
+Jan 4-W at Kennesaw St, 63-45
+Jan 7-W vs. Mercer, 72-47
+Jan 9-W vs. Stetson, 73-71
+Jan 12-L vs. Lipscomb, 50-55
+Jan 18- at Campbell, 7:00 PM
+Jan 20- at Gardner-Webb, 6:00 PM
+Jan 25- vs. East Tenn St, 7:00 PM
+Jan 27- vs. Kennesaw St, 7:00 PM
+Feb 1- at Stetson, 6:00 PM
+Feb 3- at Mercer, 6:00 PM
+Feb 9- at Lipscomb, 6:30 PM
+Feb 15- vs. Gardner-Webb, 7:00 PM
+Feb 17- vs. Campbell, 7:30 PM
+Feb 22- at Jacksonville, 6:00 PM
+Feb 24- at North Florida, 7:00 PM
+
+
+Nov 11-W vs. UNC-Pembroke, 106-66
+Nov 16-W vs. Coastal Carolina, 83-63
+Nov 20-W vs. UNC-Wilmington, 100-94
+Nov 25-L at Radford, 80-87
+Nov 27-L at Appalachian St, 71-84
+Dec 12-L at San Diego St, 82-119
+Dec 14-L at San Diego, 69-81
+Dec 18-W vs. Radford, 101-88
+Dec 23-L at Virginia Tech, 70-94
+Dec 30-W vs. Ohio Valley, 107-65
+Jan 2-W at North Florida, 78-48
+Jan 4-L at Jacksonville, 71-90
+Jan 6-W vs. Kennesaw St, 88-85 2OT
+Jan 9-L vs. East Tenn St, 76-100
+Jan 13-L at Mercer, 93-94
+Jan 15-L at Stetson, 73-82
+Jan 18- vs. Belmont, 7:00 PM
+Jan 20- vs. Lipscomb, 1:00 PM
+Jan 25- vs. North Florida, 8:00 PM
+Jan 27- vs. Jacksonville, 4:00 PM
+Jan 30- at Gardner-Webb, 7:00 PM
+Feb 2- at Kennesaw St, 7:30 PM
+Feb 5- at East Tenn St, 7:00 PM
+Feb 8- vs. Stetson, 7:00 PM
+Feb 10- vs. Mercer, 7:00 PM
+Feb 15- at Lipscomb, 8:00 PM
+Feb 17- at Belmont, 7:30 PM
+Feb 22- vs. Longwood, 7:00 PM
+Feb 24- vs. Gardner-Webb, 6:00 PM
+
+
+Nov 10-W vs. Virginia-Wise, 90-43
+Nov 13-L at Eastern Ky, 53-70
+Nov 15-W vs. Chattanooga, 71-70 OT
+Nov 19-L at Auburn, 58-64
+Nov 21-L at Morehead State, 56-77
+Nov 24-L vs. Sam Houston St, 61-72
+Nov 25-W at Southern U, 66-52
+Nov 30-W at Mercer, 76-70
+Dec 2-W at Stetson, 75-61
+Dec 5-L at Vanderbilt, 62-104
+Dec 9-W vs. Milligan, 73-47
+Dec 19-W vs. UNC-Asheville, 73-65
+Dec 21-W vs. Radford, 71-51
+Dec 30-L at Tennessee, 88-93
+Jan 2-L vs. Belmont, 74-75 OT
+Jan 4-W vs. Lipscomb, 75-72 OT
+Jan 7-W at Gardner-Webb, 66-63
+Jan 9-W at Campbell, 100-76
+Jan 13-W vs. North Florida, 77-58
+Jan 15-W vs. Jacksonville, 71-59
+Jan 19- vs. Kennesaw St, 7:30 PM
+Jan 25- at Belmont, 7:00 PM
+Jan 27- at Lipscomb, 5:00 PM
+Feb 2- vs. Gardner-Webb, 7:00 PM
+Feb 5- vs. Campbell, 7:00 PM
+Feb 8- at Jacksonville, 7:00 PM
+Feb 10- at North Florida, 4:00 PM
+Feb 17- at Kennesaw St, 7:30 PM
+Feb 23- vs. Stetson, 7:30 PM
+Feb 25- vs. Mercer, 2:00 PM
+
+
+Nov 13-L at Texas Tech, 74-86
+Nov 14-L vs. Akron, 61-89
+Nov 19-L at North Carolina, 50-103
+Nov 21-L vs. UNC Greensboro, 67-79
+Nov 24-L at NC State, 76-88
+Nov 29-W vs. Ferrum, 70-53
+Dec 5-L at Georgia, 67-96
+Dec 9-W vs. Western Carolina, 74-73 O
+Dec 16-L at High Point, 51-65
+Dec 19-L at Wake Forest, 60-92
+Dec 27-L at Wisconsin, 40-98
+Jan 2-L at Jacksonville, 64-73
+Jan 4-W at North Florida, 72-52
+Jan 7-L vs. East Tenn St, 63-66
+Jan 10-L vs. Kennesaw St, 60-77
+Jan 13-W at Stetson, 77-64
+Jan 15-L at Mercer, 74-85
+Jan 18- vs. Lipscomb, 7:00 PM
+Jan 20- vs. Belmont, 6:00 PM
+Jan 25- vs. Jacksonville, 6:00 PM
+Jan 27- vs. North Florida, 8:15 PM
+Jan 30- vs. Campbell, 7:00 PM
+Feb 2- at East Tenn St, 7:00 PM
+Feb 4- at Kennesaw St, 2:00 PM
+Feb 8- vs. Mercer, 7:00 PM
+Feb 10- vs. Stetson, 7:00 PM
+Feb 15- at Belmont, 7:00 PM
+Feb 17- at Lipscomb, 3:00 PM
+Feb 24- at Campbell, 6:00 PM
+
+
+Nov 12-L at Savannah State, 64-67
+Nov 14-W vs. Saint Leo, 77-73
+Nov 16-L at Florida, 61-90
+Nov 22-W vs. Florida Tech, 89-60
+Nov 25-W vs. SC State, 87-74
+Nov 27-L at U-C-F, 62-99
+Nov 30-L at Lipscomb, 61-73
+Dec 2-L at Belmont, 62-76
+Dec 10-W vs. Coastal Carolina, 85-72
+Dec 16-L at Texas A&M, 58-97
+Dec 19-L at Georgia, 77-93
+Dec 29-L at South Carolina, 73-80
+Jan 2-W vs. Gardner-Webb, 73-64
+Jan 4-W vs. Campbell, 90-71
+Jan 9-W at North Florida, 64-60
+Jan 13-L at Kennesaw St, 76-83
+Jan 15-L at East Tenn St, 59-71
+Jan 18- vs. Mercer, 7:00 PM
+Jan 20- vs. Stetson, 7:00 PM
+Jan 25- at Gardner-Webb, 6:00 PM
+Jan 27- at Campbell, 4:00 PM
+Feb 3- vs. North Florida, 6:00 PM
+Feb 8- vs. East Tenn St, 7:00 PM
+Feb 10- vs. Kennesaw St, 7:00 PM
+Feb 16- at Mercer, 7:30 PM
+Feb 18- at Stetson, 5:00 PM
+Feb 22- vs. Belmont, 6:00 PM
+Feb 24- vs. Lipscomb, 6:00 PM
+
+
+
+
+
+Nov 11-L vs. Western Ky, 55-96
+Nov 17-W at St Peters, 67-60
+Nov 18-L at Columbia, 51-63
+Nov 21-L vs. George Washington, 52-69
+Nov 25-L vs. Florida Intl, 68-70
+Nov 28-W vs. Newberry, 68-55
+Nov 30-L at Stetson, 56-61
+Dec 2-L at Mercer, 77-84 OT
+Dec 17-L at Kansas State, 54-82
+Dec 19-L at Wichita State, 65-74
+Dec 22-W at MD-Eastern Shore, 67-49
+Dec 23-L at Longwood, 85-87 OT
+Dec 29-L at Chattanooga, 67-83
+Dec 30-W vs. Alabama State, 78-72
+Jan 2-W vs. Lipscomb, 66-55
+Jan 4-L vs. Belmont, 45-63
+Jan 6-L at Campbell, 85-88 2OT
+Jan 10-W at Gardner-Webb, 77-60
+Jan 13-W vs. Jacksonville, 83-76
+Jan 15-W vs. North Florida, 77-57
+Jan 19- at East Tenn St, 7:30 PM
+Jan 25- at Lipscomb, 8:00 PM
+Jan 27- at Belmont, 7:00 PM
+Feb 2- vs. Campbell, 7:30 PM
+Feb 4- vs. Gardner-Webb, 2:00 PM
+Feb 8- at North Florida, 7:00 PM
+Feb 10- at Jacksonville, 7:00 PM
+Feb 14- at Georgia, 7:30 PM
+Feb 17- vs. East Tenn St, 7:30 PM
+Feb 22- vs. Mercer, 7:30 PM
+Feb 24- vs. Stetson, 2:00 PM
+
+
+Nov 11-W vs. Tusculum, 70-67
+Nov 13-W vs. Evansville, 67-64
+Nov 16-L at Missouri, 69-89
+Nov 19-L at South Carolina, 68-75
+Nov 25-W vs. Fisk, 80-68
+Nov 27-W vs. Winston-Salem St, 62-46
+Nov 30-W vs. Jacksonville, 73-61
+Dec 2-W vs. North Florida, 68-54
+Dec 7-L at Vanderbilt, 50-59
+Dec 14-W vs. Nicholls State, 75-55
+Dec 16-L at Evansville, 73-80
+Dec 21-W at Liberty, 66-61
+Dec 29-L at Alabama, 58-80
+Jan 2-L at Kennesaw St, 55-66
+Jan 4-L at East Tenn St, 72-75 OT
+Jan 7-W vs. Stetson, 79-68
+Jan 9-W vs. Mercer, 89-68
+Jan 12-W at Belmont, 55-50
+Jan 18- at Gardner-Webb, 7:00 PM
+Jan 20- at Campbell, 1:00 PM
+Jan 25- vs. Kennesaw St, 8:00 PM
+Jan 27- vs. East Tenn St, 5:00 PM
+Feb 1- at Mercer, 7:00 PM
+Feb 3- at Stetson, 7:00 PM
+Feb 9- vs. Belmont, 6:30 PM
+Feb 15- vs. Campbell, 8:00 PM
+Feb 17- vs. Gardner-Webb, 3:00 PM
+Feb 22- at North Florida, 7:00 PM
+Feb 24- at Jacksonville, 6:00 PM
+
+
+Nov 12-L at Wisconsin, 48-72
+Nov 14-L at Savannah State, 61-71
+Nov 18-W vs. Emory, 89-71
+Nov 27-L vs. Ga Southern, 59-61
+Nov 30-L vs. East Tenn St, 70-76
+Dec 2-W vs. Kennesaw St, 84-77 OT
+Dec 4-W vs. Char Southern, 78-59
+Dec 7-W vs. Fort Valley St, 79-74
+Dec 9-W at Va Military, 105-103
+Dec 21-L at Oregon State, 62-93
+Dec 23-L at Oregon, 64-84
+Dec 30-L at Furman, 69-83
+Jan 2-W vs. Stetson, 84-63
+Jan 7-L at Belmont, 47-72
+Jan 9-L at Lipscomb, 68-89
+Jan 13-W vs. Campbell, 94-93
+Jan 15-W vs. Gardner-Webb, 85-74
+Jan 18- at Jacksonville, 7:00 PM
+Jan 20- at North Florida, 4:00 PM
+Jan 24- vs. Savannah State, 7:00 PM
+Jan 26- at Stetson, 7:30 PM
+Feb 1- vs. Lipscomb, 7:00 PM
+Feb 3- vs. Belmont, 6:00 PM
+Feb 8- at Gardner-Webb, 7:00 PM
+Feb 10- at Campbell, 7:00 PM
+Feb 16- vs. Jacksonville, 7:30 PM
+Feb 18- vs. North Florida, 2:00 PM
+Feb 22- at Kennesaw St, 7:30 PM
+Feb 25- at East Tenn St, 2:00 PM
+
+
+Nov 10-L at St Johns, 53-74
+Nov 11-L vs. Loyola-Maryland, 50-65
+Nov 14-L at Florida, 40-86
+Nov 19-W vs. Concordia (NY), 77-72
+Nov 22-L vs. Fla Atlantic, 44-59
+Nov 25-L at Northwestern, 39-40
+Nov 30-L at Belmont, 32-87
+Dec 2-L at Lipscomb, 54-68
+Dec 8-L at William & Mary, 44-61
+Dec 18-L vs. Binghamton, 61-79
+Dec 20-L vs. Florida A&M, 65-66
+Dec 28-W vs. Skidmore, 70-43
+Jan 2-L vs. Campbell, 48-78
+Jan 4-L vs. Gardner-Webb, 52-72
+Jan 9-L vs. Jacksonville, 60-64
+Jan 13-L at East Tenn St, 58-77
+Jan 15-L at Kennesaw St, 57-77
+Jan 18- vs. Stetson, 7:00 PM
+Jan 20- vs. Mercer, 4:00 PM
+Jan 25- at Campbell, 8:00 PM
+Jan 27- at Gardner-Webb, 8:15 PM
+Jan 30- at Savannah State, 7:00 PM
+Feb 3- at Jacksonville, 6:00 PM
+Feb 8- vs. Kennesaw St, 7:00 PM
+Feb 10- vs. East Tenn St, 4:00 PM
+Feb 15- at Stetson, 7:00 PM
+Feb 18- at Mercer, 2:00 PM
+Feb 22- vs. Lipscomb, 7:00 PM
+Feb 24- vs. Belmont, 7:00 PM
+
+
+
+Nov 10-L at Army, 68-80
+Nov 11-W at NC A&T, 72-69
+Nov 12-L at Missouri, 45-66
+Nov 18-L at U-C-F, 60-73
+Nov 20-W vs. Palm Beach Atlantic, 80-6
+Nov 27-L at South Florida, 72-77 2OT
+Nov 30-W vs. Kennesaw St, 61-56
+Dec 2-L vs. East Tenn St, 61-75
+Dec 5-L vs. Florida State, 63-82
+Dec 16-L at Miami-Florida, 64-89
+Dec 20-L at Florida, 67-88
+Dec 23-W at Savannah State, 58-46
+Dec 30-W vs. Skidmore, 85-55
+Jan 2-L at Mercer, 63-84
+Jan 7-L at Lipscomb, 68-79
+Jan 9-L at Belmont, 71-73
+Jan 13-L vs. Gardner-Webb, 64-77
+Jan 15-W vs. Campbell, 82-73
+Jan 18- at North Florida, 7:00 PM
+Jan 20- at Jacksonville, 7:00 PM
+Jan 26- vs. Mercer, 7:30 PM
+Feb 1- vs. Belmont, 6:00 PM
+Feb 3- vs. Lipscomb, 7:00 PM
+Feb 8- at Campbell, 7:00 PM
+Feb 10- at Gardner-Webb, 7:00 PM
+Feb 13- vs. Savannah State, 7:00 PM
+Feb 15- vs. North Florida, 7:00 PM
+Feb 18- vs. Jacksonville, 5:00 PM
+Feb 23- at East Tenn St, 7:30 PM
+Feb 24- at Kennesaw St, 2:00 PM
+
+
+ January 18, 2007, at 03:41 AM ET
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.dtd
new file mode 100644
index 00000000000..9e4dd578483
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.dtd
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.out b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.out
new file mode 100644
index 00000000000..e946a45a944
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.out
@@ -0,0 +1,19 @@
+
+
+10016
+Wed May 29 12:45:00 PDT 2002
+
+ABC
+XYZ
+1234 Anywhere Street
+Palo Alto
+California
+USA
+94303
+NULL
+NULL
+
+
+
+
+
\ No newline at end of file
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.xml
new file mode 100644
index 00000000000..13f72a5693f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341.xml
@@ -0,0 +1,20 @@
+
+
+
+10016
+Wed May 29 12:45:00 PDT 2002
+
+ABC
+XYZ
+1234 Anywhere Street
+Palo Alto
+California
+USA
+94303
+NULL
+NULL
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341Test.java
new file mode 100644
index 00000000000..605baf81ef5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341Test.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.net.URL;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4693341
+ * @summary Test transform with external dtd.
+ */
+public class Bug4693341Test {
+
+ @Test
+ public void test() {
+ boolean status = false;
+
+ try {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+
+ String out = getClass().getResource("Bug4693341.out").getPath();
+ StreamResult result = new StreamResult(new FileOutputStream(out));
+
+ String in = getClass().getResource("Bug4693341.xml").getPath();
+ File file = new File(in);
+ StreamSource source = new StreamSource(new FileInputStream(file), ("file://" + in));
+
+ transformer.transform(source, result);
+
+ //URL inputsource = new URL("file", "", golden);
+ URL output = new URL("file", "", out);
+
+ // error happens when trying to parse output
+ String systemId = output.toExternalForm();
+ System.out.println("systemId: " + systemId);
+ InputSource is = new InputSource(systemId);
+ SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+ parser.parse(is, new DefaultHandler());
+
+ } catch (Exception ex) {
+ Assert.fail(ex.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.dtd
new file mode 100644
index 00000000000..9e4dd578483
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.dtd
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.xml
new file mode 100644
index 00000000000..5c0928e85ab
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4693341_golden.xml
@@ -0,0 +1,20 @@
+
+
+
+10016
+Wed May 29 12:45:00 PDT 2002
+
+ABC
+XYZ
+1234 Anywhere Street
+Palo Alto
+California
+USA
+94303
+NULL
+NULL
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4892774.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4892774.java
new file mode 100644
index 00000000000..c4b54f80cd0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug4892774.java
@@ -0,0 +1,372 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.util.DOMUtil;
+import javax.xml.transform.util.SAXUtil;
+import javax.xml.transform.util.StAXUtil;
+import javax.xml.transform.util.StreamUtil;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4892774
+ * @summary Test identity transformer with all possible types of Source and Result combinations for doucment version and encoding information.
+ */
+
+public class Bug4892774 {
+
+ private final String XML_FILE = "catalog.xml";
+ private final String XML10_FILE = "catalog_10.xml"; // 1.0 version document
+ private final String TEMP_FILE = "tmp.xml";
+ private final String EXPECTED_VERSION = "1.1";
+ static private Transformer idTransform = null;
+
+ private static DOMUtil domUtil = null;
+ private static StreamUtil streamUtil = null;
+ private static SAXUtil saxUtil = null;
+ private static StAXUtil staxUtil = null;
+
+ @BeforeMethod
+ protected void setUp() {
+ File tmpFile = new File(TEMP_FILE);
+ if (tmpFile.exists())
+ tmpFile.delete();
+ try {
+
+ if (idTransform == null)
+ idTransform = getIdTransformer();
+ else
+ idTransform.reset();
+
+ initializeUtils();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured during setUp(): " + e.getMessage());
+ }
+ }
+
+ @AfterMethod
+ protected void tearDown() {
+ File tmpFile = new File(TEMP_FILE);
+ if (tmpFile.exists())
+ tmpFile.delete();
+ }
+
+ private void initializeUtils() throws Exception {
+ if (domUtil == null)
+ domUtil = (DOMUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.DOM);
+ if (saxUtil == null)
+ saxUtil = (SAXUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.SAX);
+ if (streamUtil == null)
+ streamUtil = (StreamUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.STREAM);
+ if (staxUtil == null)
+ staxUtil = (StAXUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.StAX);
+ }
+
+ @Test
+ public void testDOM2DOM() {
+ try {
+ Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ DOMResult domResult = (DOMResult) domUtil.prepareResult();
+ idTransform.transform(input, domResult);
+ domUtil.checkResult(domResult, EXPECTED_VERSION);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ private Transformer getIdTransformer() throws Exception {
+ return TransformerFactory.newInstance().newTransformer();
+ }
+
+ @Test
+ public void testDOM2Stream() {
+ try {
+
+ Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StreamResult strResult = (StreamResult) streamUtil.prepareResult();
+ idTransform.transform(input, strResult);
+ streamUtil.checkResult(strResult, EXPECTED_VERSION, "UTF-8");
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDOM2SAX() {
+ try {
+ Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ SAXResult saxResult = (SAXResult) saxUtil.prepareResult();
+ idTransform.transform(input, saxResult);
+ saxUtil.checkResult(saxResult, EXPECTED_VERSION, "UTF-8");
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDOM2StAX() {
+ try {
+ Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkResult(staxResult, EXPECTED_VERSION, "UTF-8");
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDOM2StAXStream() {
+ try {
+ Source input = domUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareStreamResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkStreamResult(staxResult, EXPECTED_VERSION);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSAX2DOM() {
+ try {
+ Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ DOMResult domResult = (DOMResult) domUtil.prepareResult();
+ idTransform.transform(input, domResult);
+ domUtil.checkResult(domResult, EXPECTED_VERSION);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSAX2SAX() {
+ try {
+ Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ SAXResult saxResult = (SAXResult) saxUtil.prepareResult();
+ idTransform.transform(input, saxResult);
+ saxUtil.checkResult(saxResult, EXPECTED_VERSION, "UTF-8");
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSAX2Stream() {
+ try {
+ Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StreamResult strResult = (StreamResult) streamUtil.prepareResult();
+ idTransform.transform(input, strResult);
+ streamUtil.checkResult(strResult, EXPECTED_VERSION, "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSAX2StAX() {
+ try {
+ Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkResult(staxResult, EXPECTED_VERSION, "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSAX2StAXStream() {
+ try {
+ Source input = saxUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareStreamResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkStreamResult(staxResult, EXPECTED_VERSION);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStream2DOM() {
+ try {
+ Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ DOMResult domResult = (DOMResult) domUtil.prepareResult();
+ idTransform.transform(input, domResult);
+ domUtil.checkResult(domResult, EXPECTED_VERSION);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStream2Stream() {
+ try {
+ Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StreamResult strResult = (StreamResult) streamUtil.prepareResult();
+ idTransform.transform(input, strResult);
+ streamUtil.checkResult(strResult, EXPECTED_VERSION, "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStream2Stax() {
+ try {
+ Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkResult(staxResult, EXPECTED_VERSION, "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStream2StaxStream() {
+ try {
+ Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareStreamResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkStreamResult(staxResult, EXPECTED_VERSION);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStream2SAX() {
+ try {
+ Source input = streamUtil.prepareSource(this.getClass().getResourceAsStream(XML_FILE));
+ SAXResult saxResult = (SAXResult) saxUtil.prepareResult();
+ idTransform.transform(input, saxResult);
+ saxUtil.checkResult(saxResult, EXPECTED_VERSION, "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStAX2DOM() {
+ try {
+ Source input = staxUtil.prepareStreamSource(this.getClass().getResourceAsStream(XML10_FILE));
+ DOMResult domResult = (DOMResult) domUtil.prepareResult();
+ idTransform.transform(input, domResult);
+ domUtil.checkResult(domResult, "1.0");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStAX2Stream() {
+ try {
+ Source input = staxUtil.prepareStreamSource(this.getClass().getResourceAsStream(XML10_FILE));
+ StreamResult strResult = (StreamResult) streamUtil.prepareResult();
+ idTransform.transform(input, strResult);
+ streamUtil.checkResult(strResult, "1.0", "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStAX2StAX() {
+ try {
+ Source input = staxUtil.prepareStreamSource(this.getClass().getResourceAsStream(XML10_FILE));
+ StAXResult staxResult = (StAXResult) staxUtil.prepareResult();
+ idTransform.transform(input, staxResult);
+ staxUtil.checkResult(staxResult, "1.0", "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStAXEvent2DOM() {
+ try {
+ Source input = staxUtil.prepareSource(this.getClass().getResourceAsStream(XML10_FILE));
+ DOMResult domResult = (DOMResult) domUtil.prepareResult();
+ idTransform.transform(input, domResult);
+ domUtil.checkResult(domResult, "1.0");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testStAXEvent2Stream() {
+ try {
+ Source input = staxUtil.prepareSource(this.getClass().getResourceAsStream(XML10_FILE));
+ StreamResult strResult = (StreamResult) streamUtil.prepareResult();
+ idTransform.transform(input, strResult);
+ streamUtil.checkResult(strResult, "1.0", "UTF-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.java
new file mode 100644
index 00000000000..7d061c2c2c0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.dom.DOMResult;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 5073477
+ * @summary Test DOMResult.setNextSibling works correctly.
+ */
+public class Bug5073477 {
+
+ @Test
+ public void test1() throws Exception {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document dom = parser.parse(Bug5073477.class.getResourceAsStream("Bug5073477.xml"));
+
+ DOMResult r = new DOMResult();
+
+ r.setNode(dom.getDocumentElement());
+ r.setNextSibling(r.getNode().getFirstChild());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.xml
new file mode 100644
index 00000000000..fd275a92046
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug5073477.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6175602.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6175602.java
new file mode 100644
index 00000000000..ae568341344
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6175602.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+
+import javax.xml.transform.Templates;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6175602
+ * @summary Test compilation of MsWordXMLImport.xsl.
+ */
+public class Bug6175602 {
+
+ public Bug6175602() {
+ }
+
+ @Test
+ public void test926007_1() throws Exception {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ File f = new File(getClass().getResource("MsWordXMLImport.xsl.data").getPath());
+ Templates t = factory.newTemplates(new StreamSource(f));
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.java
new file mode 100644
index 00000000000..9b508796ac9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6206491
+ * @summary Test key searches over more than one document.
+ */
+public class Bug6206491 {
+
+ private String getResource(String s) {
+ return getClass().getResource(s).toString();
+
+ }
+
+ @Test
+ public void test() {
+ try {
+ Document document = getNewXmlDoc(new File(getClass().getResource("Bug6206491.xml").getFile()));
+
+ xmlxsl2html(TransformerFactory.newInstance(), new File(getClass().getResource("Bug6206491.xsl").getFile()), document);
+ } catch (Exception ex) {
+ System.err.println(ex.getMessage());
+ ex.printStackTrace(System.err);
+ Assert.fail(ex.toString());
+ }
+ }
+
+ void xmlxsl2html(TransformerFactory tFactory, File xslFile, Document document) throws Exception {
+ try {
+ // tFactory.setAttribute("generate-translet", Boolean.TRUE);
+ } catch (Exception e) {
+ // Ignore
+ }
+
+ try {
+ StreamSource stylesource = new StreamSource(xslFile);
+ Transformer transformer = tFactory.newTransformer(stylesource);
+
+ transformer.clearParameters();
+
+ DOMSource source = new DOMSource(document);
+
+ StringWriter sw = new StringWriter();
+ StreamResult result = new StreamResult(sw);
+ transformer.transform(source, result);
+ String s = sw.toString();
+ Assert.assertFalse(s.contains("0"));
+ } catch (TransformerConfigurationException ex) {
+ throw ex;
+
+ } catch (TransformerException ex) {
+ throw ex;
+ }
+ }
+
+ Document getNewXmlDoc(File xmlFile) throws Exception {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ factory.setValidating(true);
+
+ try {
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ builder.setErrorHandler(new org.xml.sax.helpers.DefaultHandler() {
+ public void fatalError(SAXParseException e) throws SAXParseException {
+ throw e;
+ }
+
+ public void error(SAXParseException e) throws SAXParseException {
+ throw e;
+ }
+
+ public void warning(SAXParseException e) throws SAXParseException {
+ throw e;
+ }
+ });
+ return builder.parse(xmlFile);
+
+ } catch (SAXException ex) {
+ throw ex;
+ } catch (ParserConfigurationException ex) {
+ throw ex;
+ } catch (IOException ex) {
+ throw ex;
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xml
new file mode 100644
index 00000000000..7415fa8208b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xsl
new file mode 100644
index 00000000000..33bb901a3f8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491.xsl
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491_2.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491_2.xml
new file mode 100644
index 00000000000..0d21ad499b9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6206491_2.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6216226Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6216226Test.java
new file mode 100644
index 00000000000..ec856b7116f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6216226Test.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+import java.io.StringReader;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6216226
+ * @summary Test StreamResult(File) is closed after transform().
+ */
+public class Bug6216226Test {
+
+ @Test
+ public final void test() {
+ try {
+ File test = new File("bug6216226.txt");
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer xformer = tf.newTransformer();
+ StringReader st = new StringReader("");
+ StreamSource s = new StreamSource(st);
+ StreamResult r = new StreamResult(test);
+ xformer.transform(s, r);
+ if (!test.delete()) {
+ Assert.fail("cannot delete file: " + test.getPath());
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6311448.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6311448.java
new file mode 100644
index 00000000000..5b395170918
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6311448.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/*
+ * @bug 6311448
+ * @summary Test XML transformer can output Unicode surrorate pair.
+ */
+public class Bug6311448 {
+
+ @Test
+ public void test01() {
+ try {
+ String attrKey = "key";
+ String attrValue = "\ud800\udc00"; // 17-bit code point in UTF-16
+
+ // Some obvious assertions for documentation purposes
+ Assert.assertTrue(Character.isSurrogatePair('\ud800', '\udc00'));
+ Assert.assertTrue(Character.toCodePoint('\ud800', '\udc00') == 65536);
+ Assert.assertTrue(Character.charCount(Character.toCodePoint('\ud800', '\udc00')) == 2);
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ Transformer t = TransformerFactory.newInstance().newTransformer();
+
+ // Create a DOM with 'attrValue' in it
+ Document doc = dbf.newDocumentBuilder().getDOMImplementation().createDocument(null, null, null);
+ Element xmlRoot = doc.createElement("root");
+ xmlRoot.setAttribute(attrKey, attrValue);
+ doc.appendChild(xmlRoot);
+
+ // Serialize DOM into a byte array
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ t.setOutputProperty("encoding", "utf-8");
+ t.transform(new DOMSource(doc), new StreamResult(baos));
+
+ // Re-parse byte array back into a DOM
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ doc = dbf.newDocumentBuilder().parse(bais);
+ String newValue = doc.getDocumentElement().getAttribute(attrKey);
+ Assert.assertTrue(newValue.charAt(0) == '\ud800' && newValue.charAt(1) == '\udc00');
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6384805.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6384805.java
new file mode 100644
index 00000000000..c59b9555f0a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6384805.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6384805
+ * @summary Test XSLTC can parse XML namespace when nodeset is created within a template.
+ */
+public class Bug6384805 {
+
+ @Test
+ public void test0() {
+ try {
+ TransformerFactory tf = TransformerFactory.newInstance();
+
+ try {
+ // tf.setAttribute("generate-translet", Boolean.TRUE);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+
+ Transformer t = tf.newTransformer(new StreamSource(getClass().getResourceAsStream("tigertest.xsl"), getClass().getResource("tigertest.xsl")
+ .toString()));
+
+ StreamSource src = new StreamSource(getClass().getResourceAsStream("tigertest-in.xml"));
+ DOMResult res = new DOMResult();
+ t.transform(src, res);
+
+ // Verify output of transformation
+ XPath query = XPathFactory.newInstance().newXPath();
+
+ query.setNamespaceContext(new NamespaceContext() {
+ public String getNamespaceURI(String prefix) {
+ return prefix.equals("style") ? "http://openoffice.org/2000/style" : prefix.equals("office") ? "http://openoffice.org/2000/office" : null;
+ }
+
+ public String getPrefix(String namespaceURI) {
+ return null;
+ }
+
+ public Iterator getPrefixes(String namespaceURI) {
+ return null;
+ }
+ });
+
+ // Find the value of the style:family attribute
+ Object o1 = query.evaluate("/test/office:document/office:styles/style:default-style/@style:family", res.getNode(), XPathConstants.STRING);
+
+ Assert.assertTrue(o1.equals("graphics"));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6465722.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6465722.java
new file mode 100644
index 00000000000..3a261092f0e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6465722.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 6465722
+ * @summary Test Transformer can transform the node attribute prefixed with a namespace.
+ */
+public class Bug6465722 {
+
+ public Bug6465722(String name) {
+ }
+
+ private static final String IDENTITY_XSLT = ""
+ + "" + "" + "" + "" + ""
+ + "";
+
+ @Test
+ public void test() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document d = dbf.newDocumentBuilder().getDOMImplementation().createDocument(null, "r", null);
+ d.getDocumentElement().setAttributeNS("http://nowhere.net/", "id", "1");
+
+ Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(IDENTITY_XSLT)));
+ t.transform(new DOMSource(d), new StreamResult(new StringWriter()));
+ } catch (Throwable ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6467808.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6467808.java
new file mode 100644
index 00000000000..e32947c1814
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6467808.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6467808
+ * @summary Test Transformer can parse re-declare prefixed namespace mappings.
+ */
+public class Bug6467808 {
+
+ private static final String TESTXML = "\n"
+ + "\n"
+ + "\n" + "\n" + "\n"
+ + "soapenv:Server\n" + "\n" + "com.sun.ts.tests.jaxws.sharedwebservices.faultservice.DummyException\n"
+ + "\n" + "\n" + "\n" + "dummyString1\n" + "\n" + "dummyString2\n"
+ + "\n" + "\n" + "\n" + "\n" + "\n";
+
+ // simplest XML to re-declare same prefix/namespace mappings
+ private static final String SIMPLE_TESTXML = "\n" + "\n"
+ + "\n" + "\n" + "\n";
+
+ @Test
+ public void test() {
+ try {
+ SAXParserFactory fac = SAXParserFactory.newInstance();
+ fac.setNamespaceAware(true);
+ SAXParser saxParser = fac.newSAXParser();
+
+ StreamSource src = new StreamSource(new StringReader(SIMPLE_TESTXML));
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ DOMResult result = new DOMResult();
+ transformer.transform(src, result);
+ } catch (Throwable ex) {
+ // unexpected failure
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490380.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490380.java
new file mode 100644
index 00000000000..5ec65e81110
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490380.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringWriter;
+import java.net.URL;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6490380
+ * @summary Test only a single DOCTYPE declaration is generated through transforming.
+ */
+public class Bug6490380 {
+
+ @Test
+ public void test() {
+ try {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ URL input = Bug6490380.class.getResource("Bug4693341.xml");
+ StreamSource source = new StreamSource(input.openStream(), input.toString());
+ StringWriter sw = new StringWriter();
+ transformer.transform(source, new StreamResult(sw));
+ String s = sw.toString();
+ Assert.assertEquals(s.indexOf("!DOCTYPE"), s.lastIndexOf("!DOCTYPE"));
+ } catch (Exception ex) {
+ Assert.fail(ex.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490921.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490921.java
new file mode 100644
index 00000000000..b8ec881fdc6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6490921.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/*
+ * @bug 6490921
+ * @summary Test property org.xml.sax.driver is always applied in transformer API.
+ */
+public class Bug6490921 {
+
+ public static class ReaderStub extends XMLFilterImpl {
+ static boolean used = false;
+
+ public ReaderStub() throws ParserConfigurationException, SAXException {
+ super();
+ super.setParent(SAXParserFactory.newInstance().newSAXParser().getXMLReader());
+ }
+
+ public void parse(InputSource input) throws SAXException, IOException {
+ used = true;
+ super.parse(input);
+ }
+
+ public void parse(String systemId) throws SAXException, IOException {
+ used = true;
+ super.parse(systemId);
+ }
+ }
+
+ @Test
+ public void test01() {
+ String xml = "";
+ ReaderStub.used = false;
+ System.setProperty("org.xml.sax.driver", "");
+
+ // Don't set 'org.xml.sax.driver' here, just use default
+ try {
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = transFactory.newTransformer();
+ InputSource in = new InputSource(new StringReader(xml));
+ SAXSource source = new SAXSource(in);
+ StreamResult result = new StreamResult(new StringWriter());
+ transformer.transform(source, result);
+ Assert.assertTrue(!printWasReaderStubCreated());
+ } catch (Exception ex) {
+ Assert.fail(ex.getMessage());
+ }
+ }
+
+ @Test
+ public void test02() {
+ String xml = "";
+ ReaderStub.used = false;
+ System.setProperty("org.xml.sax.driver", ReaderStub.class.getName());
+ try {
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = transFactory.newTransformer();
+ InputSource in = new InputSource(new StringReader(xml));
+ SAXSource source = new SAXSource(in);
+ StreamResult result = new StreamResult(new StringWriter());
+ transformer.transform(source, result);
+ Assert.assertTrue(printWasReaderStubCreated());
+ } catch (Exception ex) {
+ Assert.fail(ex.getMessage());
+ }
+ }
+
+ @Test
+ public void test03() {
+ String xsl = "\n" + "\n"
+ + " Hello World!\n" + "\n";
+
+ ReaderStub.used = false;
+ System.setProperty("org.xml.sax.driver", ReaderStub.class.getName());
+ try {
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ if (transFactory.getFeature(SAXTransformerFactory.FEATURE) == false) {
+ System.out.println("SAXTransformerFactory not supported");
+ }
+ InputSource in = new InputSource(new StringReader(xsl));
+ SAXSource source = new SAXSource(in);
+
+ transFactory.newTransformer(source);
+ Assert.assertTrue(printWasReaderStubCreated());
+ } catch (TransformerException e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ private static boolean printWasReaderStubCreated() {
+ if (ReaderStub.used) {
+ System.out.println("\tReaderStub is used.");
+ return ReaderStub.used;
+ } else {
+ System.out.println("\tReaderStub is not used.");
+ return ReaderStub.used;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6505031.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6505031.java
new file mode 100644
index 00000000000..931bf6dc34b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6505031.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6505031
+ * @summary Test transformer parses keys and their values coming from different xml documents.
+ */
+public class Bug6505031 {
+
+ private String getResource(String s) {
+ return getClass().getResource(s).toString();
+
+ }
+
+ @Test
+ public void test() {
+ Map params = new HashMap();
+
+ params.put("config", getResource("config.xml"));
+ params.put("mapsFile", getResource("maps.xml"));
+ generate(getResource("template.xml"), getResource("transform.xsl"), params);
+ }
+
+ private void generate(String in, String xsl, Map params) {
+ try {
+ Transformer transformer = getTransformer(xsl);
+
+ for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
+ Map.Entry entry = (Map.Entry) i.next();
+
+ transformer.setParameter((String) entry.getKey(), entry.getValue());
+ }
+ transform(in, transformer);
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ private Transformer getTransformer(String transform) throws Exception {
+ TransformerFactory tfactory = TransformerFactory.newInstance();
+
+ try {
+ // tfactory.setAttribute("generate-translet", Boolean.TRUE);
+ } catch (Exception e) {
+ // Ignore
+ }
+
+ Transformer transformer = tfactory.newTransformer(new StreamSource(transform));
+ return (transformer);
+ }
+
+ private void transform(String in, Transformer transformer) throws Exception {
+ StringWriter sw = new StringWriter();
+ transformer.transform(new StreamSource(in), new StreamResult(sw));
+ String s = sw.toString();
+ Assert.assertTrue(s.contains("map1key1value") && s.contains("map2key1value"));
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6513892.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6513892.java
new file mode 100644
index 00000000000..ac9fab16438
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6513892.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 6513892
+ * @summary Test the output encoding of the transform is the same as that of the redirect extension.
+ */
+public class Bug6513892 {
+ @BeforeClass
+ public void setup(){
+ if (System.getSecurityManager() != null)
+ System.setSecurityManager(null);
+ }
+
+ @Test
+ public void test0() {
+ try {
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer t = tf.newTransformer(new StreamSource(getClass().getResourceAsStream("redirect.xsl"), getClass().getResource("redirect.xsl")
+ .toString()));
+
+ StreamSource src1 = new StreamSource(getClass().getResourceAsStream("redirect.xml"));
+ t.transform(src1, new StreamResult("redirect1.xml"));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ Document d1 = db.parse(new File("redirect1.xml"));
+ Document d2 = db.parse(new File("redirect2.xml"));
+
+ Assert.assertTrue(d1.getDocumentElement().getFirstChild().getNodeValue().equals(d2.getDocumentElement().getFirstChild().getNodeValue()));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6537167.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6537167.java
new file mode 100644
index 00000000000..f64c67213b5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6537167.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6537167
+ * @summary Test transforming for particular xsl files.
+ */
+public class Bug6537167 {
+
+ @Test
+ public void test926007_1() throws Exception {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ File f = new File(getClass().getResource("logon.xsl").getPath());
+ Templates t = factory.newTemplates(new StreamSource(f));
+ Transformer transformer = t.newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+
+ transformer.transform(new StreamSource(getClass().getResourceAsStream("src.xml")), new StreamResult(System.out));
+ }
+
+ @Test
+ public void test926007_2() throws Exception {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ // factory.setAttribute("generate-translet", Boolean.TRUE);
+ File f = new File(getClass().getResource("home.xsl").getPath());
+ Templates t = factory.newTemplates(new StreamSource(f));
+ Transformer transformer = t.newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+
+ transformer.transform(new StreamSource(getClass().getResourceAsStream("src.xml")), new StreamResult(System.out));
+ }
+
+ @Test
+ public void test926007_3() throws Exception {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ // factory.setAttribute("generate-translet", Boolean.TRUE);
+ File f = new File(getClass().getResource("upload-media.xsl").getPath());
+ Templates t = factory.newTemplates(new StreamSource(f));
+ Transformer transformer = t.newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+
+ transformer.transform(new StreamSource(getClass().getResourceAsStream("src.xml")), new StreamResult(System.out));
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6540545.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6540545.java
new file mode 100644
index 00000000000..e9ddaee53a7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6540545.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6540545
+ * @summary Test XSLT as expected.
+ */
+public class Bug6540545 {
+
+ @Test
+ public void test() {
+ try {
+ String xmlFile = "numbering63.xml";
+ String xslFile = "numbering63.xsl";
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ // tFactory.setAttribute("generate-translet", Boolean.TRUE);
+ Transformer t = tFactory.newTransformer(new StreamSource(getClass().getResourceAsStream(xslFile), getClass().getResource(xslFile).toString()));
+ StringWriter sw = new StringWriter();
+ t.transform(new StreamSource(getClass().getResourceAsStream(xmlFile)), new StreamResult(sw));
+ String s = sw.getBuffer().toString();
+ Assert.assertFalse(s.contains("1: Level A"));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java
new file mode 100644
index 00000000000..c6ab3d4625f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.StringBufferInputStream;
+import java.security.Policy;
+
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLOutputFactory;
+
+import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXEventWriter;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6551616
+ * @summary Test SAX2StAXEventWriter.
+ */
+public class Bug6551616 {
+ String _cache = "";
+
+
+ @Test
+ public void test() throws Exception {
+ final String XML = "" + "" + "
Test
";
+
+ javax.xml.parsers.SAXParserFactory saxFactory = javax.xml.parsers.SAXParserFactory.newInstance();
+
+ javax.xml.parsers.SAXParser parser = saxFactory.newSAXParser();
+
+ XMLOutputFactory outFactory = XMLOutputFactory.newInstance();
+ XMLEventWriter writer = outFactory.createXMLEventWriter(System.out);
+
+ SAX2StAXEventWriter handler = new SAX2StAXEventWriter(writer);
+
+ InputStream is = new StringBufferInputStream(XML);
+
+ parser.parse(is, handler);
+
+ // if it doesn't blow up, it succeeded.
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6559595.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6559595.java
new file mode 100644
index 00000000000..1c568b1b86c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6559595.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6559595
+ * @summary Test ampersand in href attribute is not handled specially even if output is set to HTML.
+ */
+public class Bug6559595 {
+
+ @Test
+ public void test() {
+ try {
+ String xml = "" + "";
+
+ Source src = new StreamSource(new StringReader(xml));
+ StringWriter stringWriter = new StringWriter();
+ Result res = new StreamResult(stringWriter);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer t = tf.newTransformer();
+ t.setOutputProperty(OutputKeys.METHOD, "html");
+ t.transform(src, res);
+
+ // System.out.println("s = " + stringWriter.toString());
+ Assert.assertTrue(stringWriter.toString().contains("&"));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6565260.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6565260.java
new file mode 100644
index 00000000000..d6a548bff68
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6565260.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6565260
+ * @summary Test use-attribute-sets attribute is not used for the root node.
+ */
+public class Bug6565260 {
+
+ @Test
+ public void test() {
+ try {
+ String xmlFile = "attribset27.xml";
+ String xslFile = "attribset27.xsl";
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ // tFactory.setAttribute("generate-translet", Boolean.TRUE);
+ Transformer t = tFactory.newTransformer(new StreamSource(getClass().getResourceAsStream(xslFile)));
+ StringWriter sw = new StringWriter();
+ t.transform(new StreamSource(getClass().getResourceAsStream(xmlFile)), new StreamResult(sw));
+ String s = sw.getBuffer().toString();
+ Assert.assertFalse(s.contains("color") || s.contains("font-size"));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6940416.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6940416.java
new file mode 100644
index 00000000000..5c881e10089
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6940416.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.StringWriter;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.SourceLocator;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6940416
+ * @summary Test transforming correctly.
+ */
+public class Bug6940416 {
+
+ @Test
+ public void test() {
+ String xslFilename = getClass().getResource("ViewEditor1.xsl").getFile();
+ String inFilename = getClass().getResource("in.xml").getFile();
+ // String outFilename =
+ // getClass().getResource("out-6u17.xml").getFile();
+ // the xml result
+ StringWriter xmlResultString = new StringWriter();
+ try {
+ // Create transformer factory
+ TransformerFactory factory = TransformerFactory.newInstance();
+ factory.setAttribute("debug", true);
+ // Use the factory to create a template containing the xsl file
+ Templates template = factory.newTemplates(new StreamSource(new FileInputStream(xslFilename)));
+ // Use the template to create a transformer
+ Transformer xformer = template.newTransformer();
+ // Prepare the input and output files
+ Source source = new StreamSource(new FileInputStream(inFilename));
+ // Result result = new StreamResult(new
+ // FileOutputStream(outFilename));
+ Result result = new StreamResult(xmlResultString);
+ // Apply the xsl file to the source file and write the result to the
+ // output file
+ xformer.transform(source, result);
+
+ // 6u17 results contain the following:
+ /**
+ * var g_strInitialTabID = "VIEWEDITOR_TAB_FIELDS";
+ *
+ * var g_strCurrentDataEditorTabID = "DATA_OBJECTS"; var
+ * g_strCurrentPropertyEditorTabID = "VIEWEDITOR_TAB_GENERAL";
+ *
+ * while 6u18: var g_strInitialTabID = "";
+ *
+ * var g_strCurrentDataEditorTabID = ""; var
+ * g_strCurrentPropertyEditorTabID = "VIEWEDITOR_TAB_GENERAL";
+ */
+ System.out.println(xmlResultString.toString());
+ if (xmlResultString.toString().indexOf("VIEWEDITOR_TAB_FIELDS") == -1) {
+ Assert.fail("regression from 6u17");
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ } catch (TransformerConfigurationException e) {
+ // An error occurred in the XSL file
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ // An error occurred while applying the XSL file
+ // Get location of error in input file
+ SourceLocator locator = e.getLocator();
+ int col = locator.getColumnNumber();
+ int line = locator.getLineNumber();
+ String publicId = locator.getPublicId();
+ String systemId = locator.getSystemId();
+ Assert.fail("error while applying the XSL file." + "systemId : " + systemId + ". publicId : " + publicId + ". col : " + col + ". line : " + line);
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xml
new file mode 100644
index 00000000000..0fcaf61021b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xml
@@ -0,0 +1,3 @@
+
+1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 init_01_InitialDummyMOSMESNNinit_02_InitialDummyXid_4dd1acc6337e11d0e10080000ab5dd78init_03_InitialDummyid_4dd1ad48337e11d0e10080000ab5dd78id_4dd1ad8a337e11d0e10080000ab5dd78id_4dd1add2337e11d0e10080000ab5dd78id_4dd1ae1a337e11d0e10080000ab5dd78init_04_InitialDummyid_4dd1af06337e11d0e10080000ab5dd78id_4dd1af58337e11d0e10080000ab5dd78init_05_InitialDummyid_4dd1b05d337e11d0e10080000ab5dd78id_4dd1b0b9337e11d0e10080000ab5dd78init_06_InitialDummyid_4dd1b1da337e11d0e10080000ab5dd78id_4dd1b240337e11d0e10080000ab5dd78init_07_InitialDummyid_4dd1b320337e11d0e10080000ab5dd78id_4dd1b390337e11d0e10080000ab5dd78init_09_InitialDummyid_4dd225b0770407c0e10080000ab5dd78id_4dd2262e770407c0e10080000ab5dd78id_4dd226af770407c0e10080000ab5dd78init_10_InitialDummyid_4dd2280f770407c0e10080000ab5dd78id_4dd20ac184ef12e0e10080000ab5dd78init_11_InitialDummyid_4dd2240285141030e10080000ab5dd78id_4dd2250885141030e10080000ab5dd78init_12_InitialDummyid_4dd2271585141030e10080000ab5dd78id_4dd2281485141030e10080000ab5dd78init_14_InitialDummyid_4dd22d8585141030e10080000ab5dd78id_4dd22e9685141030e10080000ab5dd78init_15_InitialDummyid_4dd231ea85141030e10080000ab5dd78id_4dd2331685141030e10080000ab5dd78init_16_InitialDummyid_4dd2367685141030e10080000ab5dd78id_4dd2379b85141030e10080000ab5dd78init_17_InitialDummyid_4dd23b1f85141030e10080000ab5dd78id_4dd23c5f85141030e10080000ab5dd78init_18_InitialDummyid_4dd20e5685071800e10080000ab5dd78id_4dd20f8f85071800e10080000ab5dd78init_19_InitialDummyid_4dd2134985071800e10080000ab5dd78id_4dd2148c85071800e10080000ab5dd78id_4dd215d285071800e10080000ab5dd78id_4dd2172285071800e10080000ab5dd78id_4dd2186e85071800e10080000ab5dd78init_20_InitialDummyid_4dd21c6385071800e10080000ab5dd78id_4dd21db985071800e10080000ab5dd78id_4dd21f1285071800e10080000ab5dd78id_4dd2206e85071800e10080000ab5dd78id_4dd221cd85071800e10080000ab5dd78id_4dd2232f85071800e10080000ab5dd78id_4dd2249485071800e10080000ab5dd78init_21_InitialDummyid_4dd228d085071800e10080000ab5dd78id_4dd22a3f85071800e10080000ab5dd78id_4dd22bb185071800e10080000ab5dd78id_4dd209ce85141030e10080000ab5dd78CUSTOMER_WISHDEALER_WISHid_4dd20ced85141030e10080000ab5dd78YNid_4dd112db55800ff0e10080000ab5dd78YNid_4dd114c155800ff0e10080000ab5dd78TEL_CUSTOMERTEL_DEALERTECHNICIANORDERinit_01_InitialDummyinit_02_InitialDummyinit_03_InitialDummyinit_04_InitialDummyinit_05_InitialDummyinit_06_InitialDummyinit_07_InitialDummyinit_09_InitialDummyinit_10_InitialDummyinit_11_InitialDummyinit_12_InitialDummyinit_14_InitialDummyinit_15_InitialDummyinit_16_InitialDummyinit_17_InitialDummyinit_18_InitialDummyinit_19_InitialDummyinit_20_InitialDummyinit_21_InitialDummyid_4dd209ce85141030e10080000ab5dd78id_4dd20ced85141030e10080000ab5dd78id_4dd112db55800ff0e10080000ab5dd78id_4dd114c155800ff0e10080000ab5dd78
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xsl
new file mode 100644
index 00000000000..f7611754b28
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704.xsl
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Bitte geben Sie ein gültiges Datum ein!
+ Bitte geben Sie eine Zahl ein!
+ Bitte geben Sie eine gültige Uhrzeit ein!
+ Bitte machen Sie Eingaben in alle Mussfelder!
+
+
+
+
+
+
+
+
<!--
+
+
//-->
+
+
+
+
<BR> 

+ <BR>
+ <COMMENT>CommentComment
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704Test.java
new file mode 100644
index 00000000000..6099296b73f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/BugDB12665704Test.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6935697
+ * @summary Test Transformer can compile large xsl file.
+ */
+public class BugDB12665704Test {
+
+ @Test
+ public final void testTransform() {
+
+ try {
+ String str = new String();
+ ByteArrayOutputStream byte_stream = new ByteArrayOutputStream();
+ File inputFile = new File(getClass().getResource("BugDB12665704.xml").getPath());
+ FileReader in = new FileReader(inputFile);
+ int c;
+
+ while ((c = in.read()) != -1) {
+ str = str + new Character((char) c).toString();
+ }
+
+ in.close();
+
+ System.out.println(str);
+ byte buf[] = str.getBytes();
+ byte_stream.write(buf);
+ String style_sheet_uri = "BugDB12665704.xsl";
+ byte[] xml_byte_array = byte_stream.toByteArray();
+ InputStream xml_input_stream = new ByteArrayInputStream(xml_byte_array);
+
+ Source xml_source = new StreamSource(xml_input_stream);
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ StreamSource source = new StreamSource(getClass().getResource(style_sheet_uri).toString());
+ transformer = tFactory.newTransformer(source);
+
+ ByteArrayOutputStream result_output_stream = new ByteArrayOutputStream();
+ Result result = new StreamResult(result_output_stream);
+ transformer.transform(xml_source, result);
+ result_output_stream.close();
+
+ // expected success
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public void testSAPTransform() {
+ StringWriter out = new StringWriter();
+ try {
+ String xml = getXML(getClass().getResource("BugDB12665704.xml").getPath());
+ getTransformer().transform(new StreamSource(new StringReader(xml)), new StreamResult(out));
+ } catch (TransformerConfigurationException ex) {
+ // Trace.dump(xslt);
+ // Trace.dump(xml);
+ System.err.println("can't process xslt: " + ex.getMessage() + " (" + ex + ")");
+ } catch (TransformerException ex) {
+ // Trace.dump(xslt);
+ // Trace.dump(xml);
+ System.err.println("can't process xml: " + ex.getMessage() + " (" + ex + ")");
+ } catch (Exception ex) {
+ // Trace.dump(xslt);
+ // Trace.dump(xml);
+ System.err.println("can't create processor: " + ex.getMessage() + " (" + ex + ")");
+ }
+ }
+
+ Transformer getTransformer() {
+ Transformer transformer = null;
+ try {
+ InputStream xin = this.getClass().getResourceAsStream("BugDB12665704.xsl");
+ StreamSource xslt = new StreamSource(xin);
+ TransformerFactory fc = TransformerFactory.newInstance();
+ transformer = fc.newTransformer(xslt);
+
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ return transformer;
+ }
+
+ String getXML(String sourceFile) throws IOException {
+ BufferedReader inputStream = null;
+ StringBuilder sb = new StringBuilder();
+ try {
+ inputStream = new BufferedReader(new FileReader(sourceFile));
+ String l;
+
+ while ((l = inputStream.readLine()) != null) {
+ sb.append(l);
+ }
+
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ return sb.toString();
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java
new file mode 100644
index 00000000000..de8139a8267
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test internal transform CLI.
+ */
+public class CLITest {
+
+ @Test
+ public void testCLI() {
+ try {
+ String[] args = new String[] { "-XSLTC", "-XSL", getClass().getResource("tigertest.xsl").toString(), "-IN",
+ getClass().getResource("tigertest-in.xml").toString(), };
+ com.sun.org.apache.xalan.internal.xslt.Process._main(args);
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xml
new file mode 100644
index 00000000000..e1dc62dde21
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xsl
new file mode 100644
index 00000000000..96caed83357
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137.xsl
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137Test.java
new file mode 100644
index 00000000000..c74fb355e89
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6401137Test.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileReader;
+import java.io.InputStream;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6401137
+ * @summary Test transform certain xsl.
+ */
+public class CR6401137Test {
+
+ @Test
+ public final void testTransform() {
+
+ try {
+ String str = new String();
+ ByteArrayOutputStream byte_stream = new ByteArrayOutputStream();
+ File inputFile = new File(getClass().getResource("CR6401137.xml").getPath());
+ FileReader in = new FileReader(inputFile);
+ int c;
+
+ while ((c = in.read()) != -1) {
+ str = str + new Character((char) c).toString();
+ }
+
+ in.close();
+
+ System.out.println(str);
+ byte buf[] = str.getBytes();
+ byte_stream.write(buf);
+ String style_sheet_uri = "CR6401137.xsl";
+ byte[] xml_byte_array = byte_stream.toByteArray();
+ InputStream xml_input_stream = new ByteArrayInputStream(xml_byte_array);
+
+ Source xml_source = new StreamSource(xml_input_stream);
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ StreamSource source = new StreamSource(getClass().getResourceAsStream(style_sheet_uri));
+ transformer = tFactory.newTransformer(source);
+
+ ByteArrayOutputStream result_output_stream = new ByteArrayOutputStream();
+ Result result = new StreamResult(result_output_stream);
+ transformer.transform(xml_source, result);
+ result_output_stream.close();
+
+ // expected success
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600.policy b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600.policy
new file mode 100644
index 00000000000..381c067b376
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600.policy
@@ -0,0 +1,22 @@
+grant {
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+ permission java.lang.RuntimePermission "accessDeclaredMembers";
+
+ permission java.io.FilePermission "${test.classes}/../../-", "read, write, delete";
+ permission java.io.FilePermission ".", "read, write, delete";
+ permission java.util.PropertyPermission "*", "read, write";
+
+ permission java.lang.RuntimePermission "setSecurityManager";
+ permission java.lang.RuntimePermission "createSecurityManager";
+ permission java.lang.RuntimePermission "createClassLoader";
+ permission java.lang.RuntimePermission "setIO";
+ permission java.lang.RuntimePermission "setContextClassLoader";
+ permission java.security.SecurityPermission "getPolicy";
+
+ permission java.io.FilePermission "${test.src}/-", "read, write, delete";
+ permission java.io.FilePermission "${user.dir}/-", "read, write, delete";
+ permission java.io.FilePermission "${java.io.tmpdir}/-", "read, write, delete";
+
+ permission java.io.FilePermission "//localhost/C$/xslt_unc_test.xml", "read, write, delete";
+
+};
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600Test.java
new file mode 100644
index 00000000000..4211bdf5d8d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6551600Test.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/*
+ * @bug 6551600
+ * @summary Test using UNC path as StreamResult.
+ */
+public class CR6551600Test {
+
+ @Test
+ public final void testUNCPath() {
+ String hostName = "";
+ try {
+ hostName = java.net.InetAddress.getLocalHost().getHostName();
+ } catch (java.net.UnknownHostException e) {
+ // falls through
+ }
+
+ String path = "\\\\" + hostName + "\\C$\\xslt_unc_test.xml";
+ String os = System.getProperty("os.name");
+ if (os.indexOf("Windows") < 0) {
+ path = "///tmp/test.xml";
+ }
+ else {
+ policy.PolicyUtil.changePolicy(getClass().getResource("CR6551600.policy").getFile());
+ }
+
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.newDocument();
+ Element root = doc.createElement("test");
+ doc.appendChild(root);
+ // create an identity transform
+ Transformer t = TransformerFactory.newInstance().newTransformer();
+ File f = new File(path);
+ StreamResult result = new StreamResult(f);
+ DOMSource source = new DOMSource(doc);
+ System.out.println("Writing to " + f);
+ t.transform(source, result);
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ File file = new File(path);
+ if (file.exists()) {
+ file.deleteOnExit();
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667.xsl
new file mode 100644
index 00000000000..9bb96c30417
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667.xsl
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667Test.java
new file mode 100644
index 00000000000..b6039c120e1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6577667Test.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.InputStream;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6577667
+ * @summary Test XSLT can parse statement "not(preceding-sibling::* or following-sibling::*)" in stylesheet file.
+ */
+public class CR6577667Test {
+
+ @Test
+ public final void testTransform() {
+ try {
+ InputStream xin = this.getClass().getResourceAsStream("CR6577667.xsl");
+ StreamSource xslt = new StreamSource(xin);
+ TransformerFactory fc = TransformerFactory.newInstance();
+ Transformer transformer = fc.newTransformer(xslt);
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6652519Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6652519Test.java
new file mode 100644
index 00000000000..afec16489fd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6652519Test.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 6652519
+ * @summary Test transfoming from StreamSource to DOMResult.
+ */
+public class CR6652519Test {
+
+ @Test
+ public final void test1() {
+ try {
+ long start = System.currentTimeMillis();
+ Transformer t = TransformerFactory.newInstance().newTransformer();
+ File file = new File(getClass().getResource("msgAttach.xml").getFile());
+ StreamSource source = new StreamSource(file);
+ DOMResult result = new DOMResult();
+ t.transform(source, result);
+
+ long end = System.currentTimeMillis();
+ System.out.println("Test2:Total Time Taken=" + (end - start));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ public final void xtest2() {
+ try {
+ long start = System.currentTimeMillis();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document doc = db.parse(new File(getClass().getResource("msgAttach.xml").getFile()));
+ long end = System.currentTimeMillis();
+ System.out.println("Test1: Total Time Taken=" + (end - start));
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6689809Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6689809Test.java
new file mode 100644
index 00000000000..dec6b4eb799
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6689809Test.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.CharArrayWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6689809
+ * @summary Test Transformer can handle XPath predicates in xsl:key elements.
+ */
+public class CR6689809Test {
+
+ @Test
+ public final void testTransform() {
+
+ try {
+ StreamSource input = new StreamSource(getClass().getResourceAsStream("PredicateInKeyTest.xml"));
+ StreamSource stylesheet = new StreamSource(getClass().getResourceAsStream("PredicateInKeyTest.xsl"));
+ CharArrayWriter buffer = new CharArrayWriter();
+ StreamResult output = new StreamResult(buffer);
+
+ TransformerFactory.newInstance().newTransformer(stylesheet).transform(input, output);
+
+ Assert.assertEquals(buffer.toString(), "0|1|2|3", "XSLT xsl:key implementation is broken!");
+ // expected success
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xml
new file mode 100644
index 00000000000..fe3bc3f76c0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xml
@@ -0,0 +1,7 @@
+
+
+
+ Java
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xsl
new file mode 100644
index 00000000000..96ce42aae9a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6905829.xsl
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UpdatingOrderedList
+ ActionList
+
+
+ datasets
+
+
+
+ fields
+
+
+
+ sort
+
+
+
+ rowFilter
+
+
+
+ topN
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ CollapsedList
+ List
+ OWCSpreadsheet
+ ExcelSpreadsheet
+
+
+ datasets
+
+
+
+ fields
+
+
+
+ sort
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ StreamingList
+ UpdatesList
+
+
+ datasets
+
+
+
+ fields
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ CrossTab
+
+
+ datasets
+
+
+
+ crosstabFields
+
+
+
+ aggregate
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ Matrix
+
+
+ datasets
+
+
+
+ crosstabFields
+
+
+
+ rowFilter
+
+
+
+ drilling
+
+
+
+ calculations
+
+
+
+ surfacePrompts
+
+
+
+ SummaryCrosstab
+
+
+ datasets
+
+
+
+ crosstabFields
+
+
+
+ aggregate
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ Columnar
+
+
+ datasets
+
+
+
+ fields
+
+
+
+ group
+
+
+
+ aggregate
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ StackedBarChart
+ LineChart
+ AreaChart
+ ComboChart
+ ThreeDStackedBarChart
+ ThreeDLineChart
+ ThreeDAreaChart
+ ThreeDComboChart
+
+
+ datasets
+
+
+
+ chartFields
+
+
+
+ rowFilter
+
+
+
+ topN
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ RChart
+ SChart
+ PChart
+
+
+ datasets
+
+
+
+ chartFields
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ BarChart
+ ThreeDBarChart
+
+
+ datasets
+
+
+
+ chartFields
+
+
+
+ rowFilter
+
+
+
+ topN
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ PieChart
+ ThreeDPieChart
+
+
+
+ datasets
+
+
+
+ chartFields
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+ Arrow
+ MarketArrow
+ RangeGauge
+ DialGauge
+
+
+ datasets
+
+
+
+ kPIFields
+
+
+
+ rowFilter
+
+
+
+ calculations
+
+
+
+ drilling
+
+
+
+ surfacePrompts
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697Test.java
new file mode 100644
index 00000000000..646043feaa6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6935697Test.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.FileOutputStream;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6935697
+ * @summary Test XSLT can parse the certain xsl.
+ */
+public class CR6935697Test {
+
+ @Test
+ public final void testTransform() {
+
+ try {
+
+ String inFilename = "CR6935697.xml";
+ String xslFilename = "CR6935697.xsl";
+ String outFilename = "CR6935697.out";
+
+ // Create transformer factory
+ TransformerFactory factory = TransformerFactory.newInstance();
+ // Use the factory to create a template containing the xsl file
+ Templates template = factory.newTemplates(new StreamSource(getClass().getResourceAsStream(xslFilename)));
+ // Use the template to create a transformer
+ Transformer xformer = template.newTransformer();
+ // Prepare the input and output files
+ Source source = new StreamSource(getClass().getResourceAsStream(inFilename));
+ Result result = new StreamResult(new FileOutputStream(outFilename));
+ // Apply the xsl file to the source file and write the result to the
+ // output file
+ xformer.transform(source, result);
+
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xml
new file mode 100644
index 00000000000..3c702592100
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ E3
+
+
+
+
+
+
+
+
+ E3
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xsl
new file mode 100644
index 00000000000..37e9659f03e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869.xsl
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+ Working (by replacing the count() argument with a variable):
+
+
+
+
+ Node ;
+
+ count =
+
+ ---------
+
+ Not working in the 2nd loop iteration (by using the union expression as count() argument):
+
+
+
+
+
+ Node ;
+
+ count =
+
+ ---------
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869Test.java
new file mode 100644
index 00000000000..d2e6eba9b41
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6941869Test.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+import java.io.StringWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6941869
+ * @summary Test XSLT evaluate "count(.|key('props', d/e)[1])" correctly.
+ */
+public class CR6941869Test {
+
+ @Test
+ public final void testTransform() {
+ File xml = new File(getClass().getResource("CR6941869.xml").getFile());
+ File xsl = new File(getClass().getResource("CR6941869.xsl").getFile());
+ try {
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ StreamSource source = new StreamSource(xsl);
+ transformer = tFactory.newTransformer(source);
+ // the xml result
+ StringWriter xmlResultString = new StringWriter();
+ StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+ transformer.transform(new StreamSource(xml), xmlResultStream);
+ System.out.println(xmlResultString.toString());
+ String temp = xmlResultString.toString();
+ int pos = temp.lastIndexOf("count");
+ if (temp.substring(pos + 8, pos + 9).equals("1")) {
+ Assert.fail("count=1");
+ } else if (temp.substring(pos + 8, pos + 9).equals("2")) {
+ // expected success
+ System.out.println("count=2");
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xml
new file mode 100644
index 00000000000..d59b2a4d45f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xsl
new file mode 100644
index 00000000000..33a7cd47235
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215.xsl
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ namevalue
+ packagevalue
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215Test.java
new file mode 100644
index 00000000000..2a8460a10a7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR6957215Test.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.StringWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6957215
+ * @summary Test XSLT generates the element content using xsl:attribute instructions.
+ */
+public class CR6957215Test {
+
+ @Test
+ public final void testTransform() {
+ xsl(getClass().getResource("CR6957215.xml").getFile(), getClass().getResource("CR6957215.xsl").getFile());
+ }
+
+ public static void xsl(String inFilename, String xslFilename) {
+ try {
+ // Create transformer factory
+ TransformerFactory factory = TransformerFactory.newInstance();
+
+ // Use the factory to create a template containing the xsl file
+ Templates template = factory.newTemplates(new StreamSource(new FileInputStream(xslFilename)));
+
+ // Use the template to create a transformer
+ Transformer xformer = template.newTransformer();
+
+ // Prepare the input and output files
+ Source source = new StreamSource(new FileInputStream(inFilename));
+
+ StringWriter strResult = new StringWriter();
+ Result result = new StreamResult(strResult);
+
+ // Apply the xsl file to the source file and write the result to the
+ // output file
+ xformer.transform(source, result);
+ String resultString = strResult.toString();
+ System.out.println(resultString);
+ if (resultString.indexOf("aaa-ref/") > 0)
+ Assert.fail("missing attributes");
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (TransformerConfigurationException e) {
+ // An error occurred in the XSL file
+ e.printStackTrace();
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ // An error occurred while applying the XSL file
+ // Get location of error in input file
+ SourceLocator locator = e.getLocator();
+ int col = locator.getColumnNumber();
+ int line = locator.getLineNumber();
+ String publicId = locator.getPublicId();
+ String systemId = locator.getSystemId();
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xml
new file mode 100644
index 00000000000..a48aae54a35
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+ These pages are all about XSLT, an XML-based language for translating one set of XML into another set of XML, or into HTML. Of course, there are all sorts of other pages around that cover XSLT. Jeni's XSLT Pages, though, are dedicated to helping people understand and make the most of using XSLT.
+
+
+ My warmest thanks to all those people who post interesting problems on XSL-List, and especially to those of you that have encouraged me to set up this site through your kind emails.
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746Test.java
new file mode 100644
index 00000000000..5b3e71c18a2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CR7098746Test.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 7098746
+ * @summary Test transforming as expected.
+ */
+public class CR7098746Test {
+
+ @Test
+ public final void testTransform() {
+
+ try {
+
+ String inFilename = "CR7098746.xml";
+ String xslFilename = "CR7098746.xsl";
+
+ StringWriter sw = new StringWriter();
+ // Create transformer factory
+ TransformerFactory factory = TransformerFactory.newInstance();
+ // set the translet name
+ // factory.setAttribute("translet-name", "myTranslet");
+
+ // set the destination directory
+ // factory.setAttribute("destination-directory", "c:\\temp");
+ // factory.setAttribute("generate-translet", Boolean.TRUE);
+
+ // Use the factory to create a template containing the xsl file
+ Templates template = factory.newTemplates(new StreamSource(getClass().getResourceAsStream(xslFilename)));
+ // Use the template to create a transformer
+ Transformer xformer = template.newTransformer();
+ // Prepare the input and output files
+ Source source = new StreamSource(getClass().getResourceAsStream(inFilename));
+ // Result result = new StreamResult(new
+ // FileOutputStream(outFilename));
+ Result result = new StreamResult(sw);
+ // Apply the xsl file to the source file and write the result to the
+ // output file
+ xformer.transform(source, result);
+
+ String out = sw.toString();
+ if (out.indexOf("
") < 0) {
+ Assert.fail(out);
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DOMResultTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DOMResultTest.java
new file mode 100644
index 00000000000..b08d532bd09
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DOMResultTest.java
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test DOMResult.
+ */
+public class DOMResultTest {
+
+ @Test
+ public void testDOMResult1() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ String xml = this.getClass().getResource("toys.xml").getFile();
+ Document doc = db.parse(new FileInputStream(new File(xml)));
+ TransformerFactory tff = TransformerFactory.newInstance();
+ Transformer tf = tff.newTransformer();
+ // get element node
+ Node toys = doc.getChildNodes().item(1);
+ // supposed to insert new node at index=4
+ int index = 4;
+ String systemId = "customSysId";
+ DOMResult result = new DOMResult(toys, systemId);
+ result.setNextSibling(result.getNode().getChildNodes().item(index));
+ int length = result.getNode().getChildNodes().getLength();
+ // copy the first element node and insert it to position
+ // marked by index
+ Node source = doc.getLastChild().getChildNodes().item(1);
+ tf.transform(new DOMSource(source), result);
+
+ // document length verification
+ if (result.getNode().getChildNodes().getLength() != length + 1) {
+ Assert.fail("incorrect nodes length");
+ }
+ // element content verification
+ Node newnode = result.getNode().getChildNodes().item(index);
+ System.out.println(newnode.getTextContent());
+ if (!source.getTextContent().equals(newnode.getTextContent())) {
+ Assert.fail("target node content is not matched with source");
+ }
+ // element systemid verification
+ if (!result.getSystemId().equals(systemId)) {
+ Assert.fail("systemId is not matched");
+ }
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (IOException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (TransformerConfigurationException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDOMResult2() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ String xml = this.getClass().getResource("toys.xml").getFile();
+ Document doc = db.parse(new FileInputStream(new File(xml)));
+ TransformerFactory tff = TransformerFactory.newInstance();
+ Transformer tf = tff.newTransformer();
+ // get element node
+ Node toys = doc.getChildNodes().item(1);
+ // supposed to insert new node at index=4
+ int index = 4;
+ String systemId = "customSysId";
+ DOMResult result = new DOMResult(toys, toys.getChildNodes().item(index), systemId);
+ int length = result.getNode().getChildNodes().getLength();
+ // copy the first element node and insert it to position
+ // marked by index
+ Node source = doc.getLastChild().getChildNodes().item(1);
+ tf.transform(new DOMSource(source), result);
+
+ // document length verification
+ if (result.getNode().getChildNodes().getLength() != length + 1) {
+ Assert.fail("incorrect nodes length");
+ }
+ // element content verification
+ Node newnode = result.getNode().getChildNodes().item(index);
+ System.out.println(newnode.getTextContent());
+ if (!source.getTextContent().equals(newnode.getTextContent())) {
+ Assert.fail("target node content is not matched with source");
+ }
+ // element systemid verification
+ if (!result.getSystemId().equals(systemId)) {
+ Assert.fail("systemId is not matched");
+ }
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (IOException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (TransformerConfigurationException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDOMResult3() {
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ String xml = this.getClass().getResource("toys.xml").getFile();
+ Document doc = db.parse(new FileInputStream(new File(xml)));
+ TransformerFactory tff = TransformerFactory.newInstance();
+ Transformer tf = tff.newTransformer();
+ // get element node
+ Node toys = doc.getChildNodes().item(1);
+ // supposed to insert new node at index=4
+ int index = 4;
+ DOMResult result = new DOMResult(toys, toys.getChildNodes().item(index));
+ int length = result.getNode().getChildNodes().getLength();
+ // copy the first element node and insert it to position
+ // marked by index
+ Node source = doc.getLastChild().getChildNodes().item(1);
+ tf.transform(new DOMSource(source), result);
+
+ // document length verification
+ if (result.getNode().getChildNodes().getLength() != length + 1) {
+ Assert.fail("incorrect nodes length");
+ }
+ // element content verification
+ Node newnode = result.getNode().getChildNodes().item(index);
+ System.out.println(newnode.getTextContent());
+ if (!source.getTextContent().equals(newnode.getTextContent())) {
+ Assert.fail("target node content is not matched with source");
+ }
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (IOException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (TransformerConfigurationException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/FactoryFindTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/FactoryFindTest.java
new file mode 100644
index 00000000000..370f0fff2ac
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/FactoryFindTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test creating TransformerFactory with ContextClassLoader.
+ */
+public class FactoryFindTest {
+
+ boolean myClassLoaderUsed = false;
+
+ @Test
+ public void testFactoryFind() {
+ try {
+ // System.setProperty("jaxp.debug", "true");
+
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Assert.assertTrue(factory.getClass().getClassLoader() == null);
+
+ Thread.currentThread().setContextClassLoader(null);
+ factory = TransformerFactory.newInstance();
+ Assert.assertTrue(factory.getClass().getClassLoader() == null);
+
+ Thread.currentThread().setContextClassLoader(new MyClassLoader());
+ factory = TransformerFactory.newInstance();
+ if (System.getSecurityManager() == null)
+ Assert.assertTrue(myClassLoaderUsed);
+ else
+ Assert.assertFalse(myClassLoaderUsed);
+ } catch (Exception ex) {
+ Assert.fail(ex.toString());
+ }
+
+ }
+
+ class MyClassLoader extends URLClassLoader {
+
+ public MyClassLoader() {
+ super(new URL[0]);
+ }
+
+ public Class loadClass(String name) throws ClassNotFoundException {
+ myClassLoaderUsed = true;
+ return super.loadClass(name);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xml
new file mode 100644
index 00000000000..240730ae3fc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xml
@@ -0,0 +1,2 @@
+12
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xsl
new file mode 100644
index 00000000000..f2a05292905
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204.xsl
@@ -0,0 +1,10 @@
+
+
+
+
+ First:
+ Second:
+ Third:
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204Test.java
new file mode 100644
index 00000000000..35bcab3dc23
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2204Test.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6905829
+ * @summary Test XSLT can work against the certain xsl.
+ */
+public class Issue2204Test {
+
+ @Test
+ public final void testTransform() {
+ try {
+ Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(getClass().getResourceAsStream("Issue2204.xsl")));
+
+ System.out.printf("transformer: %s%n", t.getClass().getName());
+
+ StringWriter streamResult = new StringWriter();
+ t.transform(new StreamSource(getClass().getResourceAsStream("Issue2204.xml")), new StreamResult(streamResult));
+
+ System.out.println(streamResult.toString());
+ if (streamResult.toString().indexOf("3") > 0) {
+ Assert.fail("Function Count on variable modifies number of nodes in variable.");
+ }
+ // expected success
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290.xsl
new file mode 100644
index 00000000000..701eb05ab99
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290.xsl
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290Test.java
new file mode 100644
index 00000000000..1c63d974bb0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Issue2290Test.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test XSL extension for RTF works, for https://issues.apache.org/jira/i#browse/XALANJ-2290.
+ */
+public class Issue2290Test {
+
+ @Test
+ public final void testTransform() throws Exception {
+ DocumentFragment outNode = null;
+ DocumentBuilder docBuilder = null;
+ Document outDoc = null;
+ // TransformerImpl transformer = null;
+ StringReader execReaderXML = null;
+ Properties propFormat = null;
+ StringWriter sw = null;
+
+ try {
+ // template = TransformerFactory.newInstance().newTemplates(new
+ // StreamSource("D:/Work/Apache/TestVar.xsl"));
+ // transformer = (TransformerImpl) template.newTransformer();
+ Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(getClass().getResourceAsStream("Issue2290.xsl")));
+ System.out.print("Created Transformer");
+ execReaderXML = new StringReader(" Stuff");
+
+
+ docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ outDoc = docBuilder.newDocument();
+ outNode = outDoc.createDocumentFragment();
+ System.out.println("Created Fragment");
+ System.out.println("execute transformer.");
+ // transformer.transform(new StreamSource(execReaderXML),new
+ // DOMResult(outNode));
+ t.transform(new StreamSource(execReaderXML), new DOMResult(outNode));
+ System.out.println("Finsished transformer.");
+ sw = new StringWriter();
+
+ StreamResult sr = new StreamResult(sw);
+ t = TransformerFactory.newInstance().newTransformer();
+ t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+ t.transform(new DOMSource(outNode), sr);
+ System.out.println(sw.toString());
+ } catch (Exception e) {
+ Assert.fail(e.toString());
+ } finally {
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/MsWordXMLImport.xsl.data b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/MsWordXMLImport.xsl.data
new file mode 100644
index 00000000000..9ba08025521
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/MsWordXMLImport.xsl.data
@@ -0,0 +1,3156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ x-symbol
+
+
+
+
+ swiss
+
+
+ modern
+
+
+ roman
+
+
+ script
+
+
+ decorative
+
+
+ system
+
+
+ system
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text
+
+
+
+
+
+
+ text
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ frame
+
+
+ page
+
+
+ as-char
+
+
+ paragraph
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ page
+ cm
+ cm
+ cm
+ cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ page
+ cm
+ cm
+ cm
+ cm
+
+
+
+
+
+
+
+
+
+
+
+
+ List
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bullet Symbols
+
+
+
+ Numbering Symbols
+
+
+
+
+
+
+
+
+
+
+
+ Numbering Symbols
+
+
+
+
+
+
+
+
+
+
+
+
+
+ end
+
+
+ center
+
+
+ start
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+ 0cm
+
+
+
+ 0.20cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ middle
+ line
+
+ cm
+ cm
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+ 0cm
+
+
+ 0.20cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ List
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+ I
+
+
+ i
+
+
+ A
+
+
+ a
+
+
+ 一, 二, 三, ...
+
+
+ ア, イ, ウ, ...
+
+
+ イ, ãƒ, ãƒ, ...
+
+
+ 1, 2, 3, ...
+
+
+ 壱, å¼, å‚, ...
+
+
+ â‘ , â‘¡, â‘¢, ...
+
+
+ ï½±, ï½², ï½³, ...
+
+
+ イ, ロ, ハ, ...
+
+
+ 가, 나, 다, ...
+
+
+ ㄱ, ㄴ, ㄷ, ...
+
+
+ 甲, 乙, 丙, ...
+
+
+ å, 丑, 寅, ...
+
+
+ 壹, è²³, åƒ, ...
+
+
+ 壹, è´°, å, ...
+
+
+ ì¼, ì´, 삼, ...
+
+
+ ×, ב, ×’, ...
+
+
+ أ, ب, ت, ...
+
+
+ à¸, ข, ฃ, ...
+
+
+ Native Numbering
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pm
+
+ cm
+ cm
+
+
+ cm
+ cm
+ cm
+
+
+ cm
+ cm
+ cm
+
+
+ cm
+ cm
+ cm
+
+
+ cm
+
+
+
+
+
+
+
+
+ cm
+
+
+
+
+
+
+
+
+
+
+
+ Standard
+
+
+
+
+ cm
+ 0.792cm
+ true
+
+
+
+
+ cm
+ 0.792cm
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+ true
+
+
+
+
+
+
+ 1
+ 1
+
+
+ 3
+
+
+ 2
+
+
+ 1
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Table
+ table
+
+
+
+
+
+
+
+
+
+ margins
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TableFrame
+ graphics
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ no-limit
+
+
+
+
+ top
+
+
+ middle
+
+
+ bottom
+
+
+ from-top
+
+
+ top
+
+
+ from-top
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ left
+
+
+ center
+
+
+ right
+
+
+ from-left
+
+
+ outside
+
+
+ left
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #ffffff
+ 100%
+ parallel
+
+
+
+
+
+
+ table-column
+ Table.C
+
+
+
+
+
+
+
+
+
+
+
+
+
+ table-row
+ Table.R
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Table.RC
+ table-cell
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ top
+
+
+ middle
+
+
+ bottom
+
+
+ automatic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+ single
+
+
+
+
+
+ hidden
+ solid
+ double
+
+
+
+
+
+
+
+
+ c0c0c0
+
+
+
+
+
+ c0c0c0
+
+
+
+
+
+ c0c0c0
+
+ 000000
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.002cm 0.035cm 0.002cm
+
+
+
+ 0.002cm 0.088cm 0.002cm
+
+
+
+ 0.035cm 0.035cm 0.035cm
+
+
+
+ 0.088cm 0.088cm 0.088cm
+
+
+
+
+
+
+
+ 0.002cm 0.035cm 0.002cm
+
+
+
+ .002cm 0.088cm 0.002cm
+
+
+
+ 0.035cm 0.035cm 0.035cm
+
+
+
+ 0.088cm 0.088cm 0.088cm
+
+
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.035cm
+
+
+
+ 0.002cm 0.088cm 0.088cm
+
+
+
+ 0.002cm 0.088cm 0.141cm
+
+
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.088cm
+
+
+
+ 0.002cm 0.088cm 0.141cm
+
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+
+
+
+
+
+ 0.002cm 0.035cm 0.002cm
+
+
+
+ 0.035cm 0.035cm 0.035cm
+
+
+
+
+
+ 0.035cm 0.088cm 0.088cm
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+
+
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+ 0.141cm 0.088cm 0.088cm
+
+
+
+
+
+
+
+
+
+ 0.002cm 0.035cm 0.002cm
+
+
+
+ 0.035cm 0.035cm 0.035cm
+
+
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+ 0.035cm 0.088cm 0.088cm
+
+
+
+
+
+
+
+ 0.141cm 0.088cm 0.088cm
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.002cm
+
+
+
+
+
+ 0.002cm 0.088cm 0.035cm
+
+
+
+ 0.002cm 0.088cm 0.002cm
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.035cm
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.088cm
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.141cm
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+
+
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+ 0.141cm 0.088cm 0.088cm
+
+
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.035cm
+
+
+
+ 0.002cm 0.088cm 0.088cm
+
+
+
+ 0.002cm 0.088cm 0.141cm
+
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+
+
+
+ 0.035cm 0.035cm 0.035cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.088cm 0.088cm 0.088cm
+
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+
+
+
+
+
+ 0.002cm 0.088cm 0.002cm
+
+
+
+
+
+ 0.002cm 0.088cm 0.002cm
+
+
+
+ 0.002cm 0.088cm 0.035cm
+
+
+
+
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+ 0.002cm 0.088cm 0.035cm
+
+
+
+
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+ 0.002cm 0.088cm 0.088cm
+
+
+
+
+
+
+
+ 0.088cm 0.035cm 0.035cm
+
+
+
+ 0.002cm 0.088cm 0.141cm
+
+
+
+
+
+
+
+ 0.141cm 0.088cm 0.088cm
+
+
+
+ 0.088cm 0.088cm 0.141cm
+
+
+
+
+
+
+ 0.002cm solid #000000
+
+
+
+
+
+
+
+
+
+ TableFrame
+ TableFr
+
+
+
+ as-char
+
+
+ paragraph
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Table
+
+
+
+
+
+
+
+
+
+
+
+
+ Table
+
+
+
+
+
+
+
+
+
+
+
+ Table.C
+
+
+
+
+
+
+ Table.R
+
+
+
+
+
+
+ Table.RC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Times New Roman
+
+
+
+ pt
+ pt
+
+
+ pt
+
+
+
+ 10pt
+ 10pt
+ 10pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Standard
+
+
+ Standard1
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Standard
+
+
+ Standard1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Standard
+
+
+ Standard1
+
+
+
+
+
+
+
+
+
+
+ cm
+
+
+ cm
+
+
+ cm
+
+
+ cm
+
+
+
+ rl-tb
+ end
+
+
+
+
+ center
+
+
+
+
+ end
+
+
+ start
+
+
+
+
+
+
+ start
+
+
+ end
+
+
+
+
+ justify
+ false
+
+
+
+ false
+
+
+
+ cm
+
+
+ %
+
+
+ cm
+
+
+
+ cm
+
+
+ cm
+
+
+
+
+
+
+
+
+ #000000
+
+
+
+
+
+
+
+
+
+
+
+ page
+
+
+
+
+
+ cm
+
+
+ char
+
+
+
+
+
+
+
+ -_.
+
+
+
+
+ hyphen
+
+
+ underscore
+
+
+ dot
+
+
+ middle-dot
+
+
+
+
+
+
+
+
+ true
+
+
+ avoid
+
+
+ 2
+ 2
+
+
+ false
+
+
+ normal
+
+
+ simple
+
+
+ none
+
+
+
+
+ middle
+
+
+
+
+
+
+
+
+
+
+
+
+ cm
+
+
+
+
+
+
+ cm
+
+
+
+
+
+
+ cm
+
+
+
+
+
+
+ cm
+
+
+ #000000 0.15cm 0.15cm
+
+
+
+ false
+
+
+
+
+
+ T
+ text
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ bold
+ bold
+
+
+ bold
+
+
+ italic
+ italic
+
+
+ italic
+
+
+ uppercase
+
+
+ small-caps
+
+
+ single-line
+
+
+ double-line
+
+
+ true
+
+
+ 1pt 1pt
+ 1pt 1pt
+
+
+ engraved
+
+
+ embossed
+
+
+ true
+
+
+ #
+
+
+ cm
+
+
+
+
+
+
+
+ 58%
+ 100%
+
+
+
+
+
+
+
+
+ super
+ sub
+
+
+
+
+
+ pt
+ pt
+
+
+ pt
+
+
+
+
+ #000000
+
+
+ #ffff00
+
+
+ #00ff00
+
+
+ #00ffff
+
+
+ #ff00ff
+
+
+ #0000ff
+
+
+ #ff0000
+
+
+ #000080
+
+
+ #008080
+
+
+ #008000
+
+
+ #800080
+
+
+ #800000
+
+
+ #808000
+
+
+ #808080
+
+
+ #c0c0c0
+
+
+
+
+
+
+ single
+ false
+
+
+ bold
+
+
+ bold-dotted
+
+
+ bold-dash
+
+
+ long-dash
+
+
+ bold-long-dash
+
+
+ bold-dot-dash
+
+
+ bold-dot-dot-dash
+
+
+ bold-wave
+
+
+ double-wave
+
+
+
+
+
+
+ #
+
+
+
+ true
+ #000000
+
+
+
+ #
+
+
+
+
+
+ accent below
+
+
+ disc below
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text:h
+ text:p
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ T
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ simple
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Microsoft Word 2003
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'mm'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'cm'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'in'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'dpt'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'pica'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'pt'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'twip'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'px'!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ measure_conversion.xsl: Find no conversion for to 'twip'!
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/NCAA_Conference_Schedule_XML.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/NCAA_Conference_Schedule_XML.dtd
new file mode 100644
index 00000000000..600d23a8593
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/NCAA_Conference_Schedule_XML.dtd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/OpenJDK100017Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/OpenJDK100017Test.java
new file mode 100644
index 00000000000..b7bb1ac75ab
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/OpenJDK100017Test.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.IOException;
+
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6883209
+ * @summary Test XSLT won't cause StackOverflow when it handle many characters.
+ */
+public class OpenJDK100017Test {
+
+ @Test
+ public final void testXMLStackOverflowBug() throws TransformerConfigurationException, IOException, SAXException {
+ try {
+ SAXTransformerFactory stf = (SAXTransformerFactory) TransformerFactory.newInstance();
+ TransformerHandler ser = stf.newTransformerHandler();
+ ser.setResult(new StreamResult(System.out));
+
+ StringBuilder sb = new StringBuilder(4096);
+ for (int x = 4096; x > 0; x--) {
+ sb.append((char) x);
+ }
+ ser.characters(sb.toString().toCharArray(), 0, sb.toString().toCharArray().length);
+ ser.endDocument();
+ } catch (StackOverflowError se) {
+ se.printStackTrace();
+ Assert.fail("StackOverflow");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xml
new file mode 100644
index 00000000000..10886c5c88c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xml
@@ -0,0 +1,29 @@
+
+
+0123
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xsl
new file mode 100644
index 00000000000..77d3095de68
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/PredicateInKeyTest.xsl
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+ |
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.java
new file mode 100644
index 00000000000..fb480e11a29
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/*
+ * @summary Test Transforming from SAX to DOM.
+ */
+public class SAX2DOMTest {
+
+ @Test
+ public void test() throws Exception {
+ SAXParserFactory fac = SAXParserFactory.newInstance();
+ fac.setNamespaceAware(true);
+ SAXParser saxParser = fac.newSAXParser();
+
+ StreamSource sr = new StreamSource(this.getClass().getResourceAsStream("SAX2DOMTest.xml"));
+ InputSource is = SAXSource.sourceToInputSource(sr);
+ RejectDoctypeSaxFilter rf = new RejectDoctypeSaxFilter(saxParser);
+ SAXSource src = new SAXSource(rf, is);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ DOMResult result = new DOMResult();
+ transformer.transform(src, result);
+
+ Document doc = (Document) result.getNode();
+ System.out.println("Name" + doc.getDocumentElement().getLocalName());
+
+ String id = "XWSSGID-11605791027261938254268";
+ Element selement = doc.getElementById(id);
+ if (selement == null) {
+ System.out.println("getElementById returned null");
+ }
+
+ }
+
+ public static class RejectDoctypeSaxFilter extends XMLFilterImpl implements XMLReader, LexicalHandler {
+
+ /** Standard SAX 2.0 ext property */
+ static final String LEXICAL_HANDLER_PROP = "http://xml.org/sax/properties/lexical-handler";
+
+ static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd".intern();
+ static final String SIGNATURE_LNAME = "Signature".intern();
+ static final String ENCRYPTED_DATA_LNAME = "EncryptedData".intern();
+ static final String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#".intern();
+ static final String XENC_NS = "http://www.w3.org/2001/04/xmlenc#".intern();
+ static final String ID_NAME = "ID".intern();
+
+ /** LexicalHandler to forward events to, if any */
+ private LexicalHandler lexicalHandler;
+
+ public RejectDoctypeSaxFilter(SAXParser saxParser) throws Exception {
+ XMLReader xmlReader;
+ try {
+ xmlReader = saxParser.getXMLReader();
+ } catch (Exception e) {
+ throw new Exception("Couldn't get an XMLReader while constructing a RejectDoctypeSaxFilter", e);
+ }
+
+ // Set ourselves up to be the SAX LexicalHandler
+ try {
+ xmlReader.setProperty(LEXICAL_HANDLER_PROP, this);
+ } catch (Exception e) {
+ throw new Exception("Couldn't set the lexical handler property while constructing a RejectDoctypeSaxFilter", e);
+ }
+
+ // Set the parent XMLReader of this SAX filter
+ setParent(xmlReader);
+ }
+
+ /*
+ * Override setProperty() to capture any LexicalHandler that is set for
+ * forwarding of events.
+ */
+ public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
+ if (LEXICAL_HANDLER_PROP.equals(name)) {
+ lexicalHandler = (LexicalHandler) value;
+ } else {
+ super.setProperty(name, value);
+ }
+ }
+
+ //
+ // Beginning of SAX LexicalHandler callbacks...
+ //
+
+ public void startDTD(String name, String publicId, String systemId) throws SAXException {
+ throw new SAXException("Document Type Declaration is not allowed");
+ }
+
+ public void endDTD() throws SAXException {
+ }
+
+ public void startEntity(String name) throws SAXException {
+ if (lexicalHandler != null) {
+ lexicalHandler.startEntity(name);
+ }
+ }
+
+ public void endEntity(String name) throws SAXException {
+ if (lexicalHandler != null) {
+ lexicalHandler.endEntity(name);
+ }
+ }
+
+ public void startCDATA() throws SAXException {
+ if (lexicalHandler != null) {
+ lexicalHandler.startCDATA();
+ }
+ }
+
+ public void endCDATA() throws SAXException {
+ if (lexicalHandler != null) {
+ lexicalHandler.endCDATA();
+ }
+ }
+
+ public void comment(char[] ch, int start, int length) throws SAXException {
+ if (lexicalHandler != null) {
+ lexicalHandler.comment(ch, start, length);
+ }
+ }
+
+ //
+ // End of SAX LexicalHandler callbacks
+ //
+
+ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+ if (atts != null) {
+ boolean eos = false;
+ if (namespaceURI == DSIG_NS || XENC_NS == namespaceURI) {
+ eos = true;
+ }
+ int length = atts.getLength();
+ AttributesImpl attrImpl = new AttributesImpl();
+ for (int i = 0; i < length; i++) {
+ String name = atts.getLocalName(i);
+ if (name != null && (name.equals("Id"))) {
+ if (eos || atts.getURI(i) == WSU_NS) {
+ attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), ID_NAME, atts.getValue(i));
+ } else {
+ attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i));
+ }
+ } else {
+ attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i));
+ }
+ }
+ super.startElement(namespaceURI, localName, qName, attrImpl);
+ } else {
+ super.startElement(namespaceURI, localName, qName, atts);
+ }
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.xml
new file mode 100644
index 00000000000..6114221d769
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SAX2DOMTest.xml
@@ -0,0 +1,109 @@
+
+
+
+
+ MIICvjCCAicCBEUKVsswDQYJKoZIhvc
+ NAQEEBQAwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpD
+ YWxpZm9ybmlhMRQwEgYDVQQHEwtTYW50YSBDbGFyYTEZMBcGA1UEChMQU3VuIE1pY3Jvc3lz
+ dGVt
+ czErMCkGA1UECxMiU3VuIEphdmEgU3lzdGVtIEFwcGxpY2F0aW9uIFNlcnZlcjEjMCEGA1UE
+ AxMa
+ a3VtYXJqYXlhbnRpLmluZGlhLnN1bi5jb20wHhcNMDYwOTE1MDczMTIzWhcNMTYwOTEyMDcz
+ MTIz
+ WjCBpTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRh
+ IENs
+ YXJhMRkwFwYDVQQKExBTdW4gTWljcm9zeXN0ZW1zMSswKQYDVQQLEyJTdW4gSmF2YSBTeXN0
+ ZW0g
+ QXBwbGljYXRpb24gU2VydmVyMSMwIQYDVQQDExprdW1hcmpheWFudGkuaW5kaWEuc3VuLmNv
+ bTCB
+ nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArvcLWMmE7KUE+QJhhv
+ +sNEpsVnOgDQ8Q2Q7WUUHh
+ psY/o059aaurJT6GpmBL8fOoVRw08hsRN5B1rBUSjEQhlVNP/RM5tKow/hdXNt
+ +zBhQ11d8Kocvd
+ VJcTSsuLCQombPJj0gzVeu3UOa0n290YvakbDxpBLoA14d4K/
+ lA6BOsCAwEAATANBgkqhkiG9w0B
+ AQQFAAOBgQCWxwpM2eVlE2mG6rsnrhJMQdtaLIoEilh6xtUTkFgLW
+ +H6rRSFAr7pxCO2OiwWWzRa
+ FQuuigYlhDpTcCcQARElhlL5ZHLP84cgp/
+ 2KfFKXBphOx9xNoThFLDuh2ExUUydfqZMXYhpN39fe
+ ziQeqggTVsTKHTfFsNpAW09ZoXx5ug==
+
+
+
+
+
+
+
+
+ elU7zQXCWw3VUeb7CRRhm2Qc0HTF6tQz4MAaLDrlw60oBi0bHi2npe
+ vNuhQuDIMBcqA4U9f51zK7
+ /tR8602YjpMETlby/w01yLGb2IvzKsFAL02NilRUT4o1Jj2PiLibcbVonzuye/
+ dfoNKi5dNeQY6k
+ In3JurQmap8QEEpEoIM=
+
+
+
+
+
+
+
+
+
+ ZnUgV0uixMVhb7LYujc+vGwlnZdfG7c9MtI3+M8P92Oyh2Mk
+ +xfQsADTlk2Gqux6gRLAeKjafdXG
+ gVsdZvWkc9+tvKE9cGRv8Gm2d7ephTdSDwKRX1m7I8Q52U87MCrBWPfWEZAhm/
+ UE8RfZf54YHFB6
+ AA2gIrQQF1qYprX6eyHzaLdZe2iVRs5wXD2uRr1C3e1F6HbftGVc8gGMcsClXXzrSu3wMzJ7
+ CIRH
+ tGg8R/Xoghj2KHwv4p4FGOBQ4AT3F54I3/
+ wcfFLawPLH40wwjDuHK9ufRWIrkn4VYTUrWfZoUxMV
+ ZSaUkGeLi1d55IeWJhjQwwktYFd/KKe79qHLbc5IMzrVNbK7yKpxvQ25/CL+6lHVmPAd
+ +RrLtopX
+ qBhSRGVwHUHoLl7lAZX7q+x4AbO0x6ftib/5ytRgIBhpZWo6/
+ WvVYAQrV5Fw1e5OYZq1kkWuq3XO
+ jJuBU7x4vCTXlUphe9aDMJV/K7mTXwrgzRXFxSkUS/
+ L1q8EfCTT73aFyGuRQmFK9ZTyXuZtg4E1V
+ ooxYuOwvAQZfp49lj39+oieNP4q24/I2tcflA+blHjSrV/
+ 8CqrRLZfMnGzTAW4rA3JPzQcwexuAv
+ bkUdMF8GU8XzfGDWSiPz0EDLV0dBOPPL6Da6IH1sWXXegSBnblxRDWZ4XGC5lGXErs7wo9Yo
+ NaNN
+ Y2C3TEfgchGMbg0JvQ7JytKWfKcfjL0A7DoP1ChIbh4JC3rTpRbGvqbAgs7zyS+NyZ06/
+ s4m4s34
+ U4HcILs+lkZUszRAXwKhc9th6KoFl7i+q1UoiOfxFbf/
+ RsIwDg5ULIHRJS7AJrm703jn7OUKalrB
+ a8d5vm0b6PFMQx8eD7
+ +7HaXpBn9GJ5RubfB94QB3BUuy0av8INHtmYpvzcIwTLYmuGYcg7UnvJ6I
+ 8qjagbc67eSNC+vnKQHPrOyrqvY44R5qzfij+rp9k1vp4an/ys5db9P
+ +igwmyH3BTXC3rqjbgO7i
+ tuv5Kw/H8mfl2VKme13VyWry6zCCNo8ug8O7YE0M/
+ lhjb0SCDyz8Rfxp7zApgGXDjrx4TNlBf+Jj
+ Ys4QVbDA8EQf6Ku3ZYfLGM+eFFSguR0OiCWb6pOD8AWxIv4yq6d6hA3pE5/
+ okvOmHl2BpElpyePb
+ lbeOuU8DrmceetMTL+U5QOUYSvYpMPop20QDUNje7
+ +SIDcHG3xp9Vx78gI7HOqmeBzFla49wXJxF
+ ffK86OmEV14=
+
+
+
+
+
+
+
+ 97000.0
+ 7000.0
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.java
new file mode 100644
index 00000000000..c158d7a85be
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test XSLT shall report TransformerException for unsafe xsl when FEATURE_SECURE_PROCESSING is true.
+ */
+public class SecureProcessingTest {
+ static boolean _isSecureMode = false;
+ static {
+ if (System.getSecurityManager() != null) {
+ _isSecureMode = true;
+ System.out.println("Security Manager is present");
+ } else {
+ System.out.println("Security Manager is NOT present");
+ }
+ }
+
+
+
+ @Test
+ public final void testSecureProcessing() {
+
+ // SECURE_PROCESSING == false
+
+ // the style sheet
+ InputStream xslStream = this.getClass().getResourceAsStream("SecureProcessingTest.xsl");
+ StreamSource xslSource = new StreamSource(xslStream);
+
+ // the xml source
+ InputStream xmlStream = this.getClass().getResourceAsStream("SecureProcessingTest.xml");
+ StreamSource xmlSource = new StreamSource(xmlStream);
+
+ // the xml result
+ StringWriter xmlResultString = new StringWriter();
+ StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+ // the transformer
+ TransformerFactory transformerFactory = null;
+ Transformer transformer = null;
+
+ // transform with a non-secure Transformer
+ // expect success
+ String xmlResult;
+ if (!_isSecureMode) { // jaxp secure feature can not be turned off when
+ // security manager is present
+ try {
+ transformerFactory = TransformerFactory.newInstance();
+ transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+ transformer = transformerFactory.newTransformer(xslSource);
+ transformer.transform(xmlSource, xmlResultStream);
+ } catch (TransformerConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ } catch (TransformerException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+
+ // expected success
+ // and the result is ...
+ xmlResult = xmlResultString.toString();
+ System.out.println("Transformation result (SECURE_PROCESSING == false) = \"" + xmlResult + "\"");
+ }
+
+ // now do same transformation but with SECURE_PROCESSING == true
+ // expect Exception
+ boolean exceptionCaught = false;
+
+ // the style sheet
+ xslStream = this.getClass().getResourceAsStream("SecureProcessingTest.xsl");
+ xslSource = new StreamSource(xslStream);
+
+ // the xml source
+ xmlStream = this.getClass().getResourceAsStream("SecureProcessingTest.xml");
+ xmlSource = new StreamSource(xmlStream);
+
+ // the xml result
+ xmlResultString = new StringWriter();
+ xmlResultStream = new StreamResult(xmlResultString);
+
+ // the transformer
+ transformerFactory = null;
+ transformer = null;
+
+ // transform with a secure Transformer
+ try {
+ transformerFactory = TransformerFactory.newInstance();
+ transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ transformer = transformerFactory.newTransformer(xslSource);
+ transformer.transform(xmlSource, xmlResultStream);
+ } catch (TransformerConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ } catch (TransformerException ex) {
+ // expected failure
+ System.out.println("expected failure: " + ex.toString());
+ ex.printStackTrace(System.out);
+ exceptionCaught = true;
+ }
+
+ // unexpected success?
+ if (!exceptionCaught) {
+ // and the result is ...
+ xmlResult = xmlResultString.toString();
+ System.err.println("Transformation result (SECURE_PROCESSING == true) = \"" + xmlResult + "\"");
+ Assert.fail("SECURITY_PROCESSING == true, expected failure but got result: \"" + xmlResult + "\"");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xml
new file mode 100644
index 00000000000..bc916a958f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xsl
new file mode 100644
index 00000000000..b9f73fb25db
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SecureProcessingTest.xsl
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.java
new file mode 100644
index 00000000000..142fbd2fc37
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.File;
+import java.io.StringWriter;
+
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test Sources.
+ */
+public class SourceTest {
+
+ @Test
+ public final void testDOMSource() {
+ String xml = getClass().getResource("SourceTest.xml").getFile();
+ xml = "file://" + xml;
+ File xsl = new File(getClass().getResource("SourceTest.xsl").getFile());
+ try {
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ StreamSource source = new StreamSource(xsl);
+ transformer = tFactory.newTransformer(source);
+ // the xml result
+ StringWriter xmlResultString = new StringWriter();
+ StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+ Source xmlSource = new DOMSource();
+ xmlSource.setSystemId(xml);
+
+ transformer.transform(xmlSource, xmlResultStream);
+ System.out.println(xmlResultString.toString());
+ String temp = xmlResultString.toString();
+ int pos = temp.lastIndexOf("count");
+ if (temp.substring(pos + 8, pos + 9).equals("1")) {
+ Assert.fail("count=1");
+ } else if (temp.substring(pos + 8, pos + 9).equals("2")) {
+ // expected success
+ System.out.println("count=2");
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public final void testSAXSource() {
+ String xml = getClass().getResource("SourceTest.xml").getFile();
+ File xsl = new File(getClass().getResource("SourceTest.xsl").getFile());
+ try {
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ StreamSource source = new StreamSource(xsl);
+ transformer = tFactory.newTransformer(source);
+ // the xml result
+ StringWriter xmlResultString = new StringWriter();
+ StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+ Source xmlSource = new SAXSource();
+ xmlSource.setSystemId(xml);
+
+ transformer.transform(xmlSource, xmlResultStream);
+ System.out.println(xmlResultString.toString());
+ String temp = xmlResultString.toString();
+ int pos = temp.lastIndexOf("count");
+ if (temp.substring(pos + 8, pos + 9).equals("1")) {
+ Assert.fail("count=1");
+ } else if (temp.substring(pos + 8, pos + 9).equals("2")) {
+ // expected success
+ System.out.println("count=2");
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+
+ @Test
+ public final void testStreamSource() {
+ String xml = getClass().getResource("SourceTest.xml").getFile();
+ File xsl = new File(getClass().getResource("SourceTest.xsl").getFile());
+ try {
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ StreamSource source = new StreamSource(xsl);
+ transformer = tFactory.newTransformer(source);
+ // the xml result
+ StringWriter xmlResultString = new StringWriter();
+ StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+ Source xmlSource = new StreamSource();
+ xmlSource.setSystemId(xml);
+
+ transformer.transform(xmlSource, xmlResultStream);
+ System.out.println(xmlResultString.toString());
+ String temp = xmlResultString.toString();
+ int pos = temp.lastIndexOf("count");
+ if (temp.substring(pos + 8, pos + 9).equals("1")) {
+ Assert.fail("count=1");
+ } else if (temp.substring(pos + 8, pos + 9).equals("2")) {
+ // expected success
+ System.out.println("count=2");
+ }
+ } catch (Exception e) {
+ // unexpected failure
+ e.printStackTrace();
+ Assert.fail(e.toString());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xml
new file mode 100644
index 00000000000..3c702592100
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ E3
+
+
+
+
+
+
+
+
+ E3
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xsl
new file mode 100644
index 00000000000..247042a40f1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/SourceTest.xsl
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+ Working (by replacing the count() argument with a variable):
+
+
+
+
+ Node ;
+
+ count =
+
+ ---------
+
+
+ Not working in the 2nd loop iteration (by using the union expression as count() argument):
+
+
+
+
+
+
+ Node ;
+
+
+ count =
+
+ ---------
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/StAXSourceTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/StAXSourceTest.java
new file mode 100644
index 00000000000..a1b9bc242e0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/StAXSourceTest.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stax.StAXSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test parsing from StAXSource.
+ */
+public class StAXSourceTest {
+
+ @Test
+ public final void testStAXSource() throws XMLStreamException {
+ XMLInputFactory ifactory = XMLInputFactory.newInstance();
+ XMLOutputFactory ofactory = XMLOutputFactory.newInstance();
+
+ String xslStylesheet = ""
+ + " " + " " + " "
+ + " " + " "
+ + " " + " " + " " + "";
+ StringReader xslStringReader = new StringReader(xslStylesheet);
+ StringReader xmlStringReader = new StringReader(xslStylesheet); // identity
+ // on
+ // itself,
+ StringWriter xmlStringWriter = new StringWriter();
+
+ XMLEventReader styleReader = ifactory.createXMLEventReader(xslStringReader);
+ XMLEventReader docReader = ifactory.createXMLEventReader(xmlStringReader);
+ XMLEventWriter writer = ofactory.createXMLEventWriter(xmlStringWriter);
+
+ StAXSource stylesheet = new StAXSource(styleReader);
+ StAXSource document = new StAXSource(docReader);
+ StAXResult result = new StAXResult(writer);
+
+ try {
+ document.setSystemId("sourceSystemId");
+ } catch (UnsupportedOperationException e) {
+ System.out.println("Expected UnsupportedOperationException in StAXSource.setSystemId()");
+ } catch (Exception e) {
+ Assert.fail("StAXSource.setSystemId() does not throw java.lang.UnsupportedOperationException");
+ }
+
+ TransformerFactory tfactory = TransformerFactory.newInstance();
+ try {
+ Transformer transformer = tfactory.newTransformer(stylesheet);
+ transformer.transform(document, result);
+ } catch (TransformerConfigurationException tce) {
+ throw new XMLStreamException(tce);
+ } catch (TransformerException te) {
+ throw new XMLStreamException(te);
+ } finally {
+ styleReader.close();
+ docReader.close();
+ writer.close();
+ }
+
+ try {
+ result.setSystemId("systemId");
+ } catch (UnsupportedOperationException e) {
+ System.out.println("Expected UnsupportedOperationException in StAXResult.setSystemId()");
+ } catch (Exception e) {
+ Assert.fail("StAXResult.setSystemId() does not throw java.lang.UnsupportedOperationException");
+ }
+
+ if (result.getSystemId() != null) {
+ Assert.fail("StAXResult.getSystemId() does not return null");
+ }
+ }
+
+ @Test
+ public final void testStAXSource2() throws XMLStreamException {
+ XMLInputFactory ifactory = XMLInputFactory.newInstance();
+ ifactory.setProperty("javax.xml.stream.supportDTD", Boolean.TRUE);
+
+ StAXSource ss = new StAXSource(ifactory.createXMLStreamReader(getClass().getResource("5368141.xml").toString(),
+ getClass().getResourceAsStream("5368141.xml")));
+ DOMResult dr = new DOMResult();
+
+ TransformerFactory tfactory = TransformerFactory.newInstance();
+ try {
+ Transformer transformer = tfactory.newTransformer();
+ transformer.transform(ss, dr);
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerFactoryTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerFactoryTest.java
new file mode 100644
index 00000000000..16f94995c3c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerFactoryTest.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stax.StAXSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test TransformerFactory.
+ */
+public class TransformerFactoryTest {
+
+ private static URIResolver resolver = new URIResolver() {
+
+ private int n = 0;
+
+ public Source resolve(String href, String base) throws TransformerException {
+
+ System.out.println("resolving: " + href);
+
+ if (n++ > 10) {
+ Assert.fail("Nesting too deep when resolving: " + href);
+ }
+
+ return new StreamSource(this.getClass().getResourceAsStream(href));
+ }
+ };
+
+ private static Document load(InputStream in) throws IOException {
+
+ Document document = null;
+
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ document = db.parse(in);
+ } catch (ParserConfigurationException parserConfigurationException) {
+ parserConfigurationException.printStackTrace();
+ Assert.fail(parserConfigurationException.toString());
+ } catch (SAXException saxException) {
+ saxException.printStackTrace();
+ Assert.fail(saxException.toString());
+ }
+
+ return document;
+ }
+
+ /**
+ *
+ * Test stylesheets that import other stylesheets.
+ *
+ *
+ *
+ * Inspired by: CR 6236727-2125981 XSLTC never stops resolving imported
+ * stylesheets when outer stylesheet is a DOMSource
+ *
+ */
+ @Test
+ public final void testImport() {
+
+ TransformerFactory tff = TransformerFactory.newInstance();
+ tff.setURIResolver(resolver);
+ Templates tt = null;
+ Transformer tf = null;
+
+ // work-a-round is to use a StreamSource.
+ // test should complete
+ System.out.println("StreamSource: pre-Transformer creation");
+ System.out.flush(); // in case import hangs
+ try {
+ InputStream xin = this.getClass().getResourceAsStream("outer.xsl");
+ tt = tff.newTemplates(new StreamSource(xin));
+ tf = tt.newTransformer();
+ } catch (TransformerConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+ System.out.println("StreamSource: post-Transformer creation");
+
+ // CR is that DOMSource never stops resolving
+ System.out.println("DOMSource: pre-Transformer creation");
+ System.out.flush(); // in case import hangs
+ try {
+ InputStream xin = this.getClass().getResourceAsStream("outer.xsl");
+ tt = tff.newTemplates(new DOMSource(load(xin)));
+ tf = tt.newTransformer();
+ } catch (TransformerConfigurationException ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ } catch (IOException ioException) {
+ ioException.printStackTrace();
+ Assert.fail(ioException.toString());
+ }
+ System.out.println("DOMSource: post-Transformer creation");
+ }
+
+ /**
+ * Refer to 6631168 : StAXSource & StAXResult support in JavaSE6
+ */
+ @Test
+ public final void testFeatures() {
+ TransformerFactory tff = TransformerFactory.newInstance();
+ Assert.assertTrue(tff.getFeature(StAXSource.FEATURE));
+ Assert.assertTrue(tff.getFeature(StAXResult.FEATURE));
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerTest.java
new file mode 100644
index 00000000000..d331d2af5a0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerTest.java
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.AttributesImpl;
+
+/*
+ * @summary Test Transformer.
+ */
+public class TransformerTest {
+
+ private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+
+ private static final String XML_DOCUMENT = "" + "";
+
+ //Test for JDK-6305029
+ @Test
+ public final void testTransform() throws TransformerException {
+
+ // test SAXSource
+ SAXSource saxSource = new SAXSource(new MyXMLReader(), new InputSource());
+
+ StringWriter builder = new StringWriter();
+ TransformerFactory.newInstance().newTransformer().transform(saxSource, new StreamResult(builder));
+
+ AssertJUnit.assertEquals("Identity transform of SAXSource", XML_DOCUMENT, builder.toString());
+
+ // test StreamSource
+ StreamSource streamSource = new StreamSource(new StringReader(XML_DOCUMENT));
+
+ StringWriter streamResult = new StringWriter();
+
+ TransformerFactory.newInstance().newTransformer().transform(streamSource, new StreamResult(streamResult));
+
+ AssertJUnit.assertEquals("Identity transform of StreamSource", XML_DOCUMENT, streamResult.toString());
+ }
+
+ private static class MyXMLReader implements XMLReader {
+
+ private static final String NAMESPACES = "http://xml.org/sax/features/namespaces";
+
+ private static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes";
+
+ private boolean namespaces = true;
+
+ private boolean namespacePrefixes = false;
+
+ private EntityResolver resolver;
+
+ private DTDHandler dtdHandler;
+
+ private ContentHandler contentHandler;
+
+ private ErrorHandler errorHandler;
+
+ public boolean getFeature(final String name) throws SAXNotRecognizedException, SAXNotSupportedException {
+
+ if (name.equals(NAMESPACES)) {
+ return namespaces;
+ } else if (name.equals(NAMESPACE_PREFIXES)) {
+ return namespacePrefixes;
+ } else {
+ throw new SAXNotRecognizedException();
+ }
+ }
+
+ public void setFeature(final String name, final boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
+
+ if (name.equals(NAMESPACES)) {
+ namespaces = value;
+ } else if (name.equals(NAMESPACE_PREFIXES)) {
+ namespacePrefixes = value;
+ } else {
+ throw new SAXNotRecognizedException();
+ }
+ }
+
+ public Object getProperty(final String name) throws SAXNotRecognizedException, SAXNotSupportedException {
+ return null;
+ }
+
+ public void setProperty(final String name, final Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
+ }
+
+ public void setEntityResolver(final EntityResolver theResolver) {
+ this.resolver = theResolver;
+ }
+
+ public EntityResolver getEntityResolver() {
+ return resolver;
+ }
+
+ public void setDTDHandler(final DTDHandler theHandler) {
+ dtdHandler = theHandler;
+ }
+
+ public DTDHandler getDTDHandler() {
+ return dtdHandler;
+ }
+
+ public void setContentHandler(final ContentHandler handler) {
+ contentHandler = handler;
+ }
+
+ public ContentHandler getContentHandler() {
+ return contentHandler;
+ }
+
+ public void setErrorHandler(final ErrorHandler handler) {
+ errorHandler = handler;
+ }
+
+ public ErrorHandler getErrorHandler() {
+ return errorHandler;
+ }
+
+ public void parse(final InputSource input) throws IOException, SAXException {
+
+ parse();
+ }
+
+ public void parse(final String systemId) throws IOException, SAXException {
+
+ parse();
+ }
+
+ private void parse() throws SAXException {
+ contentHandler.startDocument();
+ contentHandler.startPrefixMapping("prefix", "namespaceUri");
+
+ AttributesImpl atts = new AttributesImpl();
+ if (namespacePrefixes) {
+ atts.addAttribute("", "xmlns:prefix", "xmlns:prefix", "CDATA", "namespaceUri");
+ }
+
+ contentHandler.startElement("namespaceUri", "localName", namespacePrefixes ? "prefix:localName" : "", atts);
+ contentHandler.endElement("namespaceUri", "localName", namespacePrefixes ? "prefix:localName" : "");
+ contentHandler.endPrefixMapping("prefix");
+ contentHandler.endDocument();
+ }
+ }
+
+ @Test
+ public final void testCR6272879() {
+
+ final String xsl = "" + LINE_SEPARATOR
+ + "" + LINE_SEPARATOR
+ + "" + LINE_SEPARATOR + "" + LINE_SEPARATOR
+ + "" + LINE_SEPARATOR + " " + LINE_SEPARATOR
+ + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR
+ + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR
+ + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + " "
+ + LINE_SEPARATOR + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + "" + LINE_SEPARATOR
+ + "" + LINE_SEPARATOR + "";
+
+ final String sourceXml = ""
+ + LINE_SEPARATOR
+ // "" + LINE_SEPARATOR +
+ // "" + LINE_SEPARATOR +
+ // "" + LINE_SEPARATOR +
+ // "]>" +
+ // LINE_SEPARATOR +
+ + "" + LINE_SEPARATOR + " " + LINE_SEPARATOR + " Valeur 1" + LINE_SEPARATOR
+ + " " + LINE_SEPARATOR + " " + LINE_SEPARATOR + " Valeur 2" + LINE_SEPARATOR
+ + " " + LINE_SEPARATOR + "";
+
+ Document document;
+ Node node;
+
+ System.out.println("Stylesheet:");
+ System.out.println("==================================");
+ System.out.println(xsl);
+ System.out.println();
+
+ System.out.println("Source file before transformation:");
+ System.out.println("==================================");
+ System.out.println(sourceXml);
+ System.out.println();
+
+ System.out.println("Source file after transformation:");
+ System.out.println("=================================");
+ document = getTransformation(xsl, sourceXml);
+
+ System.out.println(document);
+
+ System.out.println("Node content for element valeur2:");
+ System.out.println("=================================");
+ NodeList nodes = document.getElementsByTagName("valeur2");
+ nodes = document.getElementsByTagName("valeur2");
+ for (int i = 0; i < nodes.getLength(); i++) {
+ node = nodes.item(i);
+ System.out.println(" Node value: " + node.getFirstChild().getNodeValue());
+ System.out.println(" Node attribute: " + node.getAttributes().item(0).getNodeValue());
+
+ AssertJUnit.assertEquals("Node value mismatch", "Valeur " + (i + 1), node.getFirstChild().getNodeValue());
+ AssertJUnit.assertEquals("Node attribute mismatch", "Attribut " + (i + 1), node.getAttributes().item(0).getNodeValue());
+ }
+ }
+
+ private static Document getTransformation(final String xsl, final String sourceXml) {
+
+ Transformer transformer;
+ DOMResult reponse;
+ Document document = null;
+
+ try {
+ InputStream in = new ByteArrayInputStream(xsl.getBytes());
+ transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(in));
+
+ reponse = new DOMResult();
+ transformer.transform(new StreamSource(new ByteArrayInputStream(sourceXml.getBytes())), reponse);
+ document = (Document) reponse.getNode();
+ } catch (Exception e) {
+ String msg = "Exception in getTransformation: " + e;
+ System.err.println(msg);
+ Assert.fail(msg);
+ }
+
+ return (document);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerUtilFactory.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerUtilFactory.java
new file mode 100644
index 00000000000..a234aa0f356
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/TransformerUtilFactory.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import javax.xml.transform.util.DOMUtil;
+import javax.xml.transform.util.SAXUtil;
+import javax.xml.transform.util.StAXUtil;
+import javax.xml.transform.util.StreamUtil;
+import javax.xml.transform.util.TransformerUtil;
+
+public class TransformerUtilFactory {
+
+ public final static String DOM = "dom";
+
+ public final static String SAX = "sax";
+
+ public final static String StAX = "stax";
+
+ public final static String STREAM = "stream";
+
+ /** Creates a new instance of TransformerUtilFactory */
+ private TransformerUtilFactory() {
+ }
+
+ public static TransformerUtil getUtil(String type) throws Exception {
+ if (type.equals(DOM)) {
+ return DOMUtil.getInstance();
+ } else if (type.equals(STREAM))
+ return StreamUtil.getInstance();
+ else if (type.equals(SAX))
+ return SAXUtil.getInstance();
+ else if (type.equals(StAX))
+ return StAXUtil.getInstance();
+ else
+ return null;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionDefaultHandler.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionDefaultHandler.java
new file mode 100644
index 00000000000..26bda31979b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionDefaultHandler.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class VersionDefaultHandler extends DefaultHandler {
+
+ private String version = null;
+
+ private String encoding = null;
+
+ /** Creates a new instance of VersionDefaultHandler */
+ public VersionDefaultHandler() {
+ }
+
+ Locator saxLocator = null;
+
+ public void setDocumentLocator(Locator locator) {
+ saxLocator = locator;
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ version = ((org.xml.sax.ext.Locator2) saxLocator).getXMLVersion();
+ encoding = ((org.xml.sax.ext.Locator2) saxLocator).getEncoding();
+ }
+
+ public void error(SAXParseException e) throws SAXException {
+ e.printStackTrace();
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionEventWriter.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionEventWriter.java
new file mode 100644
index 00000000000..c7589da5c32
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/VersionEventWriter.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.StartDocument;
+import javax.xml.stream.events.XMLEvent;
+
+public class VersionEventWriter implements XMLEventWriter {
+
+ private String version = null;
+
+ private String encoding = null;
+
+ /** Creates a new instance of VersionEventWriter */
+ public VersionEventWriter() {
+ }
+
+ public void add(XMLEvent event) throws XMLStreamException {
+ if (event.getEventType() == XMLStreamConstants.START_DOCUMENT) {
+ version = ((StartDocument) event).getVersion();
+ encoding = ((StartDocument) event).getCharacterEncodingScheme();
+ }
+ }
+
+ public void flush() throws XMLStreamException {
+ }
+
+ public void close() throws XMLStreamException {
+ }
+
+ public void add(XMLEventReader reader) throws XMLStreamException {
+ }
+
+ public java.lang.String getPrefix(java.lang.String uri) throws XMLStreamException {
+ return null;
+ }
+
+ public void setPrefix(java.lang.String prefix, java.lang.String uri) throws XMLStreamException {
+ }
+
+ public void setDefaultNamespace(java.lang.String uri) throws XMLStreamException {
+ }
+
+ public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
+ }
+
+ public NamespaceContext getNamespaceContext() {
+ return null;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/ViewEditor1.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/ViewEditor1.xsl
new file mode 100644
index 00000000000..f79ca565b63
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/ViewEditor1.xsl
@@ -0,0 +1,50 @@
+
+
+
+
+
+ 21
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PieChart
+ ThreeDPieChart
+
+
+
+
+ datasets
+
+
+
+
+
+ chartFields
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xml
new file mode 100644
index 00000000000..7928e1d0c3b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xml
@@ -0,0 +1,4 @@
+
+
+ a
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xsl
new file mode 100644
index 00000000000..b0b30ab18b4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/attribset27.xsl
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ none
+
+
+
+
+
+ underline
+
+
+
+ black
+
+
+
+ 14pt
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xml
new file mode 100644
index 00000000000..0fa5eb7ab58
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xml
@@ -0,0 +1,2 @@
+
+<_test01><_test-04>T%e!s#t$1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG93Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.54Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xsd
new file mode 100644
index 00000000000..6e95cb8e31f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog.xsd
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog_10.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog_10.xml
new file mode 100644
index 00000000000..6e64e81e8c4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/catalog_10.xml
@@ -0,0 +1,2 @@
+
+<_test01><_test-04>T%e!s#t$1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG93Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.54Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.dtd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.dtd
new file mode 100644
index 00000000000..35a0568076c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.dtd
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.xml
new file mode 100644
index 00000000000..04be32e7ad6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/config.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/default-layout.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/default-layout.xsl
new file mode 100644
index 00000000000..ab50d03bca7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/default-layout.xsl
@@ -0,0 +1,280 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/maps.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/maps.xml
new file mode 100644
index 00000000000..e5d3508b395
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/maps.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ map1key1value
+ map1key2value
+
+ map2key1value
+ map2key2value
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/msgAttach.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/msgAttach.xml
new file mode 100644
index 00000000000..a6a980f501f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/msgAttach.xml
@@ -0,0 +1,3 @@
+
+<?xml version="1.0" encoding="UTF-8"?><cabecMsg xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.09"><versaoDados>1.03</versaoDados></cabecMsg><enviNFe xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.09"><idLote>200602220000001</idLote><NFe><infNFe Id="NFe28070413349550000324550010000109000000110809" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110809"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>zYASgizMNBAzgn+ot4ejStxDPTA=</DigestValue></Reference></SignedInfo><SignatureValue>WnrapbX3Ewvi10agoVw2ZXl2drRxQdEbe3AHEXwIcr3LbDKGsMhqQusQGgifJkEbLL+IKC2kE9BE/HVFLxhFN9zj7zasTo6voeRApftKmibfASYcLSMTMkRcE97qU7BKQveBb0rYtKoumF020DUofx4TQlq0XhXHwQRSMfjU+PI=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110801" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110801"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>eDf91anljJDYxbEccusEuMITI6w=</DigestValue></Reference></SignedInfo><SignatureValue>1l8xkXfjmhtrkFMXXHxyS2FQ7jM1hBIeqAxk/zVVgaAhAUvOnyqvt6EnIkbkqo+4uRyASFjhr5oFUHz5ryj9oSz+wW2Si95QIXUciWvDSAw2vbWaeusHI4fpJYqjyhUlXAelmQtgl9lkBaXhWrHkyLxTYZuUS0VHyu3SoqlY8L4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110802" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110802"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>KgIkUWcNbSYo+9i4n1Wib3gggRI=</DigestValue></Reference></SignedInfo><SignatureValue>BrV4+H1tm4SN9sjNT2ICKOfNsVGeMAsQilsuqIwflhGJxUVxaCEn8DJ7XaUQkh+Bw1HVd4nyR6XZHVJBtUssK2rN2B24boptcBbBlEs5Q91Guq3lSmWp8lORAf5UTVUuftsrllTmmjsSSgWVB5xog+lQI5/ULX8s+xI05OgFkDE=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110803" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110803"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>fJTDfYgu7OhtAEucE40612pj8yo=</DigestValue></Reference></SignedInfo><SignatureValue>ROGdT3yu5ZbkhXNyn650tfD1bhNo33tYKfH1Ayp+syUJGIRfuepP58gaH8fJbuM4vU8LJozcK87tOaXc0EwM5mej6f+wZ2sv1DPglrt7Bb6Vs8j4v1HPvp7EUYoGYD8cq0IDC32h9ItHlg4H1oTxeM6U7xFMPjEndCRm7Hcym1Y=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110804" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110804"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>Omf325HzAlgBnP9MoAA2Gbf4vbo=</DigestValue></Reference></SignedInfo><SignatureValue>vzjdVi3qU160PgIsCX9Qq07JVy98gwmtFZud6Unkn9uozWVgXGm9V2V3NJ67ke7pkcYZonXHrOTmOGTpuoaW0ZiQ55Mo50zlDS5TCBWn26stI12ecYwrqpgDENpoCKBRa5ZCa7GMaWZZyEgAYYQ8YeI9BtMqaKJnjhuXVaJErdw=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110805" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110805"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>ctmsHHDqE+E+UssdsL4jajRQVWk=</DigestValue></Reference></SignedInfo><SignatureValue>nCoM230bM4Befsnpl3w5/G0ocn1MVkGoqIMIFkcijK7QzBY7n3tK2B9tr9dFv1mN+y/WFZ6+66tKYefaioSNiI0QLVIXfrdYMtZ4+Ewe1N/1xHKlGqujglkmNRF17KH106lBxOltsuxZd5AsyxZ+nF37GIjWzpY/0jOJD4c+OO8=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110806" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110806"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>UVJeRp5XuzdojbAnEjuohV8NFO8=</DigestValue></Reference></SignedInfo><SignatureValue>5Zm+uGuO/xHT/CwgUIWobkM+JaAaYCym4/Kr4goBugykbLXyxXpHAvO4bYN050usn5kMGfELISipAVoaHXvrZ67FgaHkcKGHkymHGS+f8wLLL5TsNVRtZomdJjEy3GVQic8xpU4HUYrgOGktWpOnblaVzir0lZPeuRdkLbRe2y8=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110807" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110807"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>U+jxoc1fo7d4WXa0CrvP1YBQwgA=</DigestValue></Reference></SignedInfo><SignatureValue>QAYBZN3c09rcoVij+fkp4lahEAD5cZV3zjdqvNEE2lzTbzqonHgdT5GyO9VRCikUNm0f3gAbwjyQnSmvTqw4YfVCf6ZYlFBAZ+pOkGdVsOkJ4QArZiU1+hSnLo5iN3WW7b5E7vw0EMv55nGW1zF0ghajClPBsQ+nbUSyYZ09ujk=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110808" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110808"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>rNWb1uYrH9oj+IaQzAQgBgoNJ1Q=</DigestValue></Reference></SignedInfo><SignatureValue>NyJKj4su571ckKVCMK1Ki9QcpKBKczzxIs71nsxH4dZSCG3TUWycHoCsMjRUa7/REKoq1au1TmoZYAIYqZytyQYZ9m+Y+V8HDgGLde3Ymarz5X43MRIVsalGDSw1ukCYQptSLihiOUAT2hd8HYI1DAVWnqHnqDHvJ/wIcH9c44w=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110810" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110810"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>g3nEVfyjf0bEYF0+TFE+f8I0Ekg=</DigestValue></Reference></SignedInfo><SignatureValue>VnwKnzSdKtp2i8rqNAFNc5NPrh1YWRTy4xvlSkcCdxHX0RAwlQ1mFL0wFUVOjNvt3KUVn9d4X5x76yjFbnXDPkcOrf/mpFl5JMhy2oruovcC0MtWrnvguSM/Ujyyl2p4MPLT1lzcUHAFPijh4MPOX694EX+KXxMW8jz9UqpXfn0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110811" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110811"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>nhhsoA1RmioP/vXoARwWijDfkAg=</DigestValue></Reference></SignedInfo><SignatureValue>SNh8Aa27uDRSZRe7nhkEa6ZTVfJV3ljwUSlwikYTMiEMk+B6/62IQqIyfVhfSN1Lx1grYgUfrzoNRanYZWQEUcIk07ENQcIS5KgY9ydSSuuOFVuiRsk/6INm1gjR4XCq4F/tWAdenasZCtZ0DPRNH5la4GSuKevNfoLOGbKgC00=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110812" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110812"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>DFhT+RWH4lqQbbUvFNAXv/GseL0=</DigestValue></Reference></SignedInfo><SignatureValue>250R3TBs7J3uMUiLMywVtlIqn9PpB9Z9vH2vRQtcalB/Jx6bZbhYgRX6GhfVH7wrGfmtfU694g5sKm3447afm74mGV/5rvUlmECOnozuKv+SvXRK0wFvogaaXo5qCYlAqh9rOCa3W4RfVbq9TWfGevyKA7e0uKsjPctcKR/L4xg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110813" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110813"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>Al5DzbSR6cps7LzToU+cyzc51GY=</DigestValue></Reference></SignedInfo><SignatureValue>bGf13rBYoifk5Z2e97D/TiS8oy7qjB+TAfd0ECwgtn0VlWI0z8V9QQWaShjHI6sV5EVJEZlx3s/3HeFPFRiv12d5466EuzI5ftJpZNqAOS+CMkFeRFVGazaIcRY2ncw7wKNsaEmfEn+cnIAgfmXozI34q41R+bG6a/sPcLVJf3k=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110814" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110814"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>0VdDjtU1ZtFc2w5EQU9FWV276ao=</DigestValue></Reference></SignedInfo><SignatureValue>oAAW20eP5P/wuxppPwQVmbrMwCaxAZhHJTGN2bL4GfWuTUhfSwUOxZjKTeSwlPUILU6MU3wMxj3QsIphfVTqRPKtxT19z31L6x8zAx5qV7Vgz+0PDnGsTutPYKxF5XWhHu7zRTTM3TdGKLujqp5jxwDBrM1qbBbYmfN6mxWhmqg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110815" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110815"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>P+vIva8ejzq9bYhM1xL46vbdbEE=</DigestValue></Reference></SignedInfo><SignatureValue>tod/k9ZRlFEMakj89FM12YkHFvBJ2m4wDJwq9bPe6X3CKbv1mYIUAXTkasJL1BF5aJa/z+V0pvK2xTSOznvF1Y5H+TpdaToiZtMeFCbRF+nTqW+cudA3KsgSCjQs2U2kid4BWUNID9hCQHSCUoHsoVbsXDeD0Lbu6r/B0IB8FDU=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110816" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110816"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>llPDkiDAQfwf0brph3hhqCNXliI=</DigestValue></Reference></SignedInfo><SignatureValue>uFDUFef+q2r65uDmR8hS2DR+PAxVBtifJrOdVGmrdA0zQojPYziTlR0kZN/JIkBUkPklz9ejKoxx+XjVhZhu3OgI1ceHya0smOJEMDLfIJ0vHO7WmkunNl0/SBeR4yEGtjm7UxQ55/ZEHU0N/+cDn3iyzOB9t4wabUn5txA9JiA=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110817" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110817"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>qjS8ay1R+Kl2cRxAcxet6HZdt4M=</DigestValue></Reference></SignedInfo><SignatureValue>HoafBrpcYfLjXnH9GHUoZIuxjIhrpLyQeiM3KQMaWx6uyS7c2oXPtVs80L49S7i1CMma+RAywTiGf79RzI95mBy/Vlk4wa51m5h6qizT8NZMP3Pa2ern9+mDhDV7kNgvNl7JDi7hCPvACpGZy54TuzXs2luH5O8iUVYR+g2jD7Y=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110818" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110818"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>xgoWPViXwimNipoyKVr8h/69A7I=</DigestValue></Reference></SignedInfo><SignatureValue>bvGpF6fK/R2srzaaqG3XVDFxkvcvZ97MxAT4CBoezfiQywHPjXaEzmUXF/LMGjfbV1UEjFdoE+ZlPRU1F6Y3IreJvfQNLvXoGlnKASSHIZYWq/HCuv2q5DlUfw916LjUgygRbuPLaF8YJdqS+HxYsWJFxQu9ZChtb+rWYjCiCkw=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110819" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110819"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YTY3upEgZtcegklKapx3PmBt1eI=</DigestValue></Reference></SignedInfo><SignatureValue>Nma+uO1zfJMPDGNgg2tRR43CQJCalIvz1uEHfWx9xUWzRQt3SZXr/Paemn/8EvmRJ1EkL2v1oZNWH5B/WvEQfWW/m2yL5CHmW1/xFXjkbfsFJ6Dd3irQSiuy+16BNiPl0yJyV3Om+zANm1zepEbAzt1yldOsMInoWTeIcOA33rg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110820" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110820"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>hZA9ZbAfkJ1gGw/5zgVaFfXmuz4=</DigestValue></Reference></SignedInfo><SignatureValue>WUC6gHMQLuJa73yxDSuSzxVqds5ZBjl5OqtzOTLEEp83mKZwkako1zIhF59D2JXh5TnhwulWv7xqDzf3CxELf/rhftYIh108zFR7DDKMim2ofDcJ0ibWwBYYduVydpLQ37nGb0Cs8E8hVf5FDSamauvJhrXfC2jLfPQk1OCOmLc=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110821" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110821"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>mcwN77/JOXRmUj3Un5rnQukgOCk=</DigestValue></Reference></SignedInfo><SignatureValue>fDXHeIDC4hz/dpsT66Mi1aPryUrpuCISosHapZ7VKsvjeC+y4jFAXEXR5+9OuJr1SPzhKyhwbr8do3K6spTKYkOOZFZ4Ujk9xhGIXabtK/WLt6FuIuk98xXZVOtzwU3IyYeObkaJg1SzAKwq0qIW4rkfmn/4uJfayXNXaseJnhc=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110822" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110822"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>1a2RQgN0sJrLDRPQHR59US0EYT0=</DigestValue></Reference></SignedInfo><SignatureValue>jcNqHv8KDQKkcbov9Ffsix5qssBSMdx1kuM2AO3YjbjNOoJgSb+GmMy/j/iVnANeVDNLM4vjapHrPxCEFIG4E1ZuA7hId7JFajNDN1oXa32TtBfThJ27Rw35NJUcWI+YA+8JDnPa2qQCdxUWkiXvwyJ21zQzIZsw5UdvuQUqxm4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110823" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110823"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>XmVTTTXirQvExYZ4yHj2Bz0bw/c=</DigestValue></Reference></SignedInfo><SignatureValue>1RNe6RLJyXBr3/lGcqLipxwcUvUIYznpp8cwEsIPMhVnVK+250ZGyy3ap2NvgnLDvXlmQOVUu6xUthwF8ll58dspBFIfHAqoww/KojAg+6V3Wwm+DwVc7222KbJ6eu451iqI68cUaRYQiciPTa2Y9DfDtxoprKBN488/PkOYyhY=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110824" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110824"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YauB6rHbqykRGk5K/ESVswxJpvs=</DigestValue></Reference></SignedInfo><SignatureValue>iBHHYQzntaGIOO62UUQ/p2svvoR8XjDoO8es7vyJ35PmrFWtocWdM9FEUW1Vp4ql7qmtzXascvw86JdPwZ0UjhPO9qKIIYk8XrzG9AY4SqF99gf1POWHK7xxmk3K3a9GivyQFwQlvNkWHmZJqdOv+s5ezUrQc+Keybnio5+cy0o=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110825" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110825"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>sBG0b72pNgwjtyk2sCcr2SOPgyo=</DigestValue></Reference></SignedInfo><SignatureValue>EMAWKqa79y8wFYN1TProwZcZO20OCPU6rSm41Z+QN5QdT1DcU823Lu+aNfPv70SY9ra5/6kOO1uE4My5UXsyawjPDY5EZV8di9Goyebg27DgDLWcpvwZfrBUOwGo3Q9x/VpWI5qY9OHaWpwxttIIuo2PbZl4k3+VVAkeCdeo7Q0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110826" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110826"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>gDyFrITIpGqBPPeUls+UoQ1eFFw=</DigestValue></Reference></SignedInfo><SignatureValue>p3lSbnCBYnKbz6rpghVwsRzjIleu8R4dlvexNH+lxtYMPMSEll1C6qMHFo393SpKJu0Yufb7NRfDBhQFBYWwHJ5/GDchagr79ihn0hVRo58wDIbWwpHPqP5QlyGttdUm2BMTXaNsvwzJWycZqkkLwvjRO1M+5CD91pYYAB27u2A=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110827" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110827"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>nq3klXHixnYIhGVm/zzRuGSMwv0=</DigestValue></Reference></SignedInfo><SignatureValue>QPp1qTof2JWZjqlWtMLOW2Hz0XrMqMd+Gp+kKqLZDBGbqQ/YCUKXnGjUiEPoO2Zy96Y98JlLaC7yFWkeslM2wMxmQEQoAFlWp5gdtjmzhFBPpuHYsS8WAz2VJVDlGik02JkXDKG/6sbHrxTQkq9ksp5ijygmRSvlxNBnG7AS9oM=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110828" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110828"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>KxutkHGJ8tvxNtSAy8N4b7sgfOU=</DigestValue></Reference></SignedInfo><SignatureValue>GZ9XS/REkXN97VEYMz1AAPZ4J9Lb08TNhsloCuH8QaTaPqIIuT4dlcQgdBX7oysVc1NXUoSxFKUeej2ZMdD/J2EPxPacM8S3XlbZe5CoHKaxqR3hqPW5ANxzN61ldjDKPz+mY7dmgVttyEYQKdy44rt3lf0TqcdWfBiucZYylAM=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110829" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110829"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>9eOPR0G4en+2xpr+R6nlm83gxVM=</DigestValue></Reference></SignedInfo><SignatureValue>t/Iwe+qlyWyuQpAHWdK//Lm+sRes/6EQb3I3XpFId+Xo4b8bdbcqv+Wlb7oPT5He654Yeg88z1mpHSZdtV5fdrr1dlKflrLT9AGKyYGiPcOpH2sUdQ655kJBtu/ByT6gQ8qaA+aufHmEL1CEUA5AbYAWk9CYzOi8BTs5zdsbDCA=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110830" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110830"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>PKubq8TelaLWOEu6e2hUS7KlvBA=</DigestValue></Reference></SignedInfo><SignatureValue>jQPSq10OxqJKbEwlQuW+RqQGV5a9iKKuc2+BZ8Qa1S9hQyg/PjtQHQYBR2LARUZIzfocfGb5+8HyGVxijtuIj2KPIH/8QGoqSHC0Ngtl9VCc7YCnOP10DOsasc6FynGZpa+0LOV+zJO119syZY4feIc67Py84fku/GJ8M1spOzg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110831" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110831"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>fSUS3zUG0gFM15Rb5Xeuowu5q8Y=</DigestValue></Reference></SignedInfo><SignatureValue>WnN/escY4TTLdqKWdlhl9VCaotMF1lkFjxSx32va5+nFXr/gYY+bZw7tYMPq8q0glhE3i5tG08Ai3zewmIIYGLbraf/2HSogXeYbM9PfoNPwlP2tXMWbvwWqg8sm5JviGS/P7kKcbKxtB35oUk0lCo0m72Kt6vaY3bmYRsv/VNQ=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110832" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110832"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>ShPPZLiE8+w2+TYc4IbHUFAJtew=</DigestValue></Reference></SignedInfo><SignatureValue>rQgO5c6bD+bB3WyRfrCb/96/JkH0bjMARhL0Rh744IdvLX+DL/u8+n/F3bTuM5nMg2MxqiCM5dJVhjfBZ8HlpUn2Ed6gTMRGRufrHEYq4Vb8CYiloLQBkXBt1Adf31Rwo1H+ASTu+GrCQyypTSJjlDy0R2+E8keWfabj15xjyts=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110833" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110833"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>vH6jMKDthPy/f/oqcOu3Kl9jQIM=</DigestValue></Reference></SignedInfo><SignatureValue>Cv24RtVaYwqxTJBFFkoji77H/x76K1jKIbuulbZ0Nm9lcYk4sz14YT5ewKlmpbypuUtbl5NCSkSPsWZ4y7QCTpbddmtUX1ZPcbRLPg9I8xWG1NbcyQqlCkpS0h76163wLFjzQp4gf+a9aSVzTkw9r/URj/0m4RcmiA4UhC+mhg4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110834" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110834"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>p7hP4H+8hnM91WiYpcftVEgr+Cw=</DigestValue></Reference></SignedInfo><SignatureValue>FvsM3yhnphCD3/KOg9beknJx1+kcw4RWNJQbXsWUvwQOa6uz6PFuKjHeDdUSa0tTRoRQ8t15TfP38SyOco/DmoMfBmCuj70tQxk78BZ/Z+UjESdaHgv2GSB3TBAVe2GaT6JYAKUSSCAFPY7GfgAQhOPEuk89ztQx7s4qB69IKZA=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110835" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110835"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>VCjVED64OxI7juJhG+0yWNlXusg=</DigestValue></Reference></SignedInfo><SignatureValue>NnmraR5m+J0bapZxL+8xsruVjidhmHqFrQwhHG4xeXeIytfQ3GgtLpaMYWO+Y+U/TrP1wKz10blLRfLa3vSuYEDuy1TI5tNjwPdmdLDXc+65YkYlO1rBYXuYHm0KIf61GPHIhvay5XUnV8VhzS7Utv2lT8p8/JyxqMHKEdg/FPY=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110836" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110836"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>9+uhMXb1wz6fc3iQbovsGOoMKC4=</DigestValue></Reference></SignedInfo><SignatureValue>tW1I5Ai8xb3GMGxkjJLpraqQLKp2dJxfdLUmm8vlpJtlFdAT4S2EYQftsiRI05ojjOrYBWb+pWemZtNhbEHSeGDMzZ6YNJwN6r7sGaRVH8IdM/2j1U87qc6jBok85nAOvAr+qoLNV4rLAca8HdqwX+evgECCvIvPuOFMovCFyi0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110837" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110837"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>pzvez2i5zHJO5NK7aGrsXzawOKM=</DigestValue></Reference></SignedInfo><SignatureValue>qJlA6hsqLbKMrjDavcfvaxG1q5OfvmeU7hVUmhJ2ipn3dKI6VpOuXaepFTA/hDz9+S1P7uc7UZj9tc/ndcUMEY1Fu97KbYpo9wyOZcKc2roxvwFlVah/3dIm3W2aH/nzanOXfx6hWCRzVyFpWlHnfkWiqsFbdyD9Y+dkiaJ6EBg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110838" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110838"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YjkOrMdDzFQvTy/lqIxwm4HXEZU=</DigestValue></Reference></SignedInfo><SignatureValue>5OfLaCwWLSOr1PPrj8mm6TYFynD2TJlsvmontCO2+lZ83GvHCmv/o/az72L4zTJLA+7EjWLXyVDaniVLz0KT580yAAVETdy7Am+ZGWSNgEyp+Fwc5eL4AiHtMPABnhdY1Y7GIZ+m74XPJLW31ybwH8G8tJEkib9bmVUK6LLcal8=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110839" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110839"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>mpqSlfCCvmFn5WrxQ9Dfl5uWuPU=</DigestValue></Reference></SignedInfo><SignatureValue>yISvrdTREuQiZ1uA4dl1HrIuk1VpcYc5bWYWa7Te01UMXNZ/bmqz0LH8oFiVoqPRnHHTSJ7NvgHC79z9z+EuDbrga1uTvLlY7CvtbxD1AuChyPc7IbkM5PGIS2EMuLI74y3FpjXPLf9ZanXisSLLVc7OhbrnCTzS5YsXLSGImyk=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110840" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110840"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>9IyNbREn2DYaDA6UUVNTmUx7Pdo=</DigestValue></Reference></SignedInfo><SignatureValue>MkQ4Ors8jwGneaOz+4cbbyL8u/kBUyx26JXe0skHJmKYq08uvihpylT7DHPr3ysXwMMhjsE5uuQQnKh48JpxmIkOXFTEzKvKnliiIsjFb5ENA+QG66Ae4Wmzt1z0CeUaGLf12qzAHJfxiNklvl1vSS7Gdxt9jGN1p8sm1ziqXU4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110841" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110841"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>KBQvgLVJ/pHIs2mchbP6r+XUV3w=</DigestValue></Reference></SignedInfo><SignatureValue>sTwck2qlVfUm+txPJzt7BshWT3zyUGYiLG4MR0RH2zm/DcjsBj/679m1/7k8lrt2E83jCSwZq8y6lVTSzJJlmXW+TVLyH3wCirheAXsWdCxQaYSeOilCPqb1kgB/qNcPReadT421qJfRGO3nMmd89HI4pCjHH1aYQPeGgytkcm4=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110842" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110842"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>3g5AU6Z5Pat0IPL/OYpTRwx4taQ=</DigestValue></Reference></SignedInfo><SignatureValue>VmXtcslq9V5bKh+ZzPRl9o+h9E04S2XiUwxvz605kN8hzCOPUTNzEMBlm1eiXKg9UAsRrFhCtJcUyqZdwN2ldVN57lxwZlPQ1Qj5DDyhG4MYtynBXNI5DhlrBb0xKOHFxsUJ4YkgtNGxwDfUyUlKwpNrgBABrbxe4W1Ibf/aX7M=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110843" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110843"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>h9UKsUjSbe8JbvsUApBt2psKKAU=</DigestValue></Reference></SignedInfo><SignatureValue>TVt205QhgqS2gZc9S0IxRbgc5x+d/iXhpCQpwYpGHbsVfvjmAPl3+zRKscTC3asPH8Nf2+6IGHwtElFqF2tE9c1RrS3cDuyjiXfKaGC5KmZ/5teXuGN1l4WF4/jitaSLu0nHcfmwxVQj3XH25+gHNXBAZXJCj1mHQO0jsmgDEz0=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110844" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110844"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>HbZModFP0Iui9gfuR7n/4sHi024=</DigestValue></Reference></SignedInfo><SignatureValue>WPU7Sj9DeVV91fBDnlAM/JKlKaC57/ID4/jbFYkcX4uO/tf0fpVUkOEwhxDUKldf/REsxKzOy3LAs/VoOLgqh3PmMBOZkTGWQjasY150ZCZHOIPuUk6wrObozuI+V0g3Xfff6pxId+t7Z3sLMWMggSSKG8+Qs27XJmODe08l+Zg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110845" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110845"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>t72hWlvvtDZ6wNPjniZ2pDoTj/w=</DigestValue></Reference></SignedInfo><SignatureValue>XnKgmioztIbSGyiwYq0Xc5jGA5bxvoqGaNfWSulvY/e4CM6KY95fwMS9GYbEjTxMB8wcIZpziq8jlEMRnNkF+yHn/4QI+8y8K17EF7pebG4XHUuOGAditKlHbC85Fehj40+/+S0kc2iSe2D+FzY1TGe/2B7x78u45LaUtLT9sXE=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110846" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110846"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>YsqTqpi1W7aZmk0w4pmyS9ICgIs=</DigestValue></Reference></SignedInfo><SignatureValue>NgHBGSEmJP4tPp4LViQYbDLfs7fQti90qvTJJ8KR2N0N8SPbmldwI8JRZyTldlQwUlRyaUqEE6OwFPW0vA0b4Upqqyl6p+MM7/ax+pU6PT7c/5xRzpSyPpvbLAYyMDA6dyQwfGgnxw+R1wRlZidxjyU+qX+C6xKc9/EhGC1MUOY=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110847" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110847"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>gjvLgyWmYcXiyBgjtBHrmH3do0E=</DigestValue></Reference></SignedInfo><SignatureValue>wQxpEm1stUvHMiMUQxMVzQlh/GKqusqgA3UGiVHDmFhnx4Fe9m7Kbp8iPzD5zhcRbFl2hVYJa1+2L0tL78unUO60uEjIFt47d/5F++rCgHkfcQAK2mdR4rl51tof8T75lvH/YJWqATZBcm7nyXEUyNlMBTyXt3NbZ4pkvjZPADU=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110848" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110848"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>JxHrYj68TOJrQDYwbNRgpcd31wk=</DigestValue></Reference></SignedInfo><SignatureValue>WC86hQyLd3romAna+vQgzS4Y+6p6qGIzNMKyye3MJU8YWb8NzycRTqXdzmV3vTc1f7JRHZxv7OotOYGkdgO9WQtuqNmy7bUlpTw+VHDaLYk0IKODNS3AalvJ34cEYeERrWJ46VkOeTAGkA0SvO8nheChrUg9316VpQ99PJnxT2M=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110849" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110849"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>SXeCCjCKON99cwODW7wBGEO1vnk=</DigestValue></Reference></SignedInfo><SignatureValue>hlSBLj1DztVcfDubBVkCJ1Tgm5nvAqJF01lK2fbNzYRBozUwd7nQ+fvnHK+UI9OaR7wJKJwSY/nqK7OV1Iz1h+Nu/zFg/YV3hrG+mV+EvOzJEKhp0c7+NO45FQKhB5a+jLFCFCypOJW0OyyVGe1inhI6mC8iCCBy08LElb3x3vg=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe><NFe><infNFe Id="NFe28070413349550000324550010000109000000110850" versao="1.09"><ide><cUF>28</cUF><cNF>000011080</cNF><natOp>VENDAS PRODUCAO PROPRIA</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>10900</nNF><dEmi>2007-04-18</dEmi><dSaiEnt>2007-04-18</dSaiEnt><tpNF>1</tpNF><cMunFG>0352050</cMunFG><tpImp>2</tpImp><tpEmis>1</tpEmis><cDV>9</cDV><tpAmb>2</tpAmb><tpNFe>1</tpNFe></ide><emit><CNPJ>13349550000324</CNPJ><xNome>TOYOTA DO BRASIL LTDA</xNome><xFant>TDB IDT</xFant><enderEmit><xLgr>RODOVIA SP75</xLgr><nro>S/N</nro><xCpl>KM 48</xCpl><xBairro>CALDEIRA</xBairro><cMun>0352050</cMun><xMun>INDAIATUBA</xMun><UF>SE</UF><CEP>13330000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>1938857000</fone></enderEmit><!--IE>353080289118</IE--><IE>270621458</IE><IEST>270969918</IEST></emit><dest><CNPJ>07234453001446</CNPJ><xNome>BENARROS VEICULOS LTDA</xNome><enderDest><xLgr>AVENIDA TANCREDO NEVES</xLgr><nro>5121</nro><xBairro>JABOTIANA</xBairro><cMun>0280030</cMun><xMun>ARACAJU</xMun><UF>SE</UF><CEP>49097000</CEP><cPais>105</cPais><xPais>BRASIL</xPais><fone>7932595252</fone></enderDest><IE>270832980</IE></dest><det nItem="1"><prod><cProd>62</cProd><cEAN></cEAN><xProd>COROLLA SE-G,A/T,1.8L GAS,A/C AUT.</xProd><NCM>87032310</NCM><EXTIPI>01</EXTIPI><CFOP>6401</CFOP><uCom>TESTE</uCom><qCom>1</qCom><vUnCom>99999</vUnCom><vProd>56157.87</vProd><cEANTrib>12345678901234</cEANTrib><uTrib>PC</uTrib><qTrib>1.000</qTrib><vUnTrib>88888</vUnTrib><veicProd><tpOp>1</tpOp><chassi>9BR53ZEC278678265</chassi><cCor>205</cCor><xCor>PRETO PEROLA METALICO</xCor><pot>136</pot><CM3>1794</CM3><pesoL>1185</pesoL><pesoB>1185</pesoB><nSerie>000678265</nSerie><tpComb>GASOLINA</tpComb><nMotor>4650701</nMotor><CMKG>0</CMKG><dist>2600</dist><RENAVAM>000000000</RENAVAM><anoMod>2007</anoMod><anoFab>2007</anoFab><tpPint>M</tpPint><tpVeic>06</tpVeic><espVeic>1</espVeic><VIN>N</VIN><condVeic>1</condVeic><cMod>114810</cMod></veicProd></prod><imposto><ICMS><ICMS70><orig>0</orig><CST>70</CST><modBC>2</modBC><pRedBC>5.16</pRedBC><vBC>53453.46</vBC><pICMS>7.00</pICMS><vICMS>3741.74</vICMS><modBCST>0</modBCST><vBCST>78978.00</vBCST><pICMSST>12.00</pICMSST><vICMSST>5735.62</vICMSST></ICMS70></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>50</CST><vBC>56361.43</vBC><pIPI>13.00</pIPI><vIPI>7326.98</vIPI></IPITrib></IPI><PIS><PISAliq><CST>01</CST><vBC>56361.43</vBC><pPIS>2.00</pPIS><vPIS>1127.23</vPIS></PISAliq></PIS><COFINS><COFINSAliq><CST>01</CST><vBC>56361.43</vBC><pCOFINS>9.60</pCOFINS><vCOFINS>5410.70</vCOFINS></COFINSAliq></COFINS></imposto></det><total><ICMSTot><vBC>53453.46</vBC><vICMS>3741.74</vICMS><vBCST>78978.00</vBCST><vST>5735.62</vST><vProd>56157.87</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0</vII><vIPI>7326.98</vIPI><vPIS>1127.23</vPIS><vCOFINS>5410.70</vCOFINS><vOutro>0.00</vOutro><vNF>69220.47</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CNPJ>60395589000104</CNPJ><xNome>BRAZUL TRANSP.DE VEICULOS LTDA</xNome><IE>635024834114</IE><xEnder>AV. MARIA SERVIDEI DEMARCHI, 1420,</xEnder><xMun>SAO BERNARDO DO CAMPO</xMun><UF>SP</UF></transporta><vol><qVol>1</qVol><esp>VEICULO</esp><marca>TOYOTA</marca><pesoL>1185.000</pesoL><pesoB>1185.000</pesoB></vol></transp><infAdic><infCpl>MARCA TOYOTA, MOTOR TOYOTA GASOLINA 4 TEMPOS, COM SISTEMA DE INJECAO ELETRONICA DE COMBUSTIVEL COMBUSTIVEL GASOLINA, TIPO AUTOMOVEL, 136CV, 4 CILINDROS, 4 PORTAS, TRANSM. AUT. DE 4 VEL. 1.794 CM3, 6.000 RPM,16 VALVULAS, ANO FAB. 2007, ANO MODELO 2007 CAPACIDADE: 5 PASSAGEIROS, COR: PRETO PEROLA METALICO COD.MARCA/MODELO RENAVAM: 114810 TOYOTA/COROLLA SEG18VVT NRO DO CHASSIS: 9BR53ZEC278678265, NRO DO MOTOR: 4650701, NUMERO DA CHAVE: T09175 EQUIPAMENTOS OBRIGATORIOS : 01 EXTINTOR(ES) 01 TRIANGULO(S) 01 MACACO(S) C/CABO, 01 CHAVE(S) DE RODAS OPCIONAIS: PINTURA METALICA/PEROLIZADA - TERMO DE PENHOR MERCANTIL: - VEICULO EM GARANTIA DE PENHOR MERCANTIL, CONFORME CONTRATO DE ABERTURA DE CREDITO ROTATIVO PARA FINANCIAMENTO DE AQUISICAO DE VEICULOS FIRMADO COM BANCO TOYOTA DO BRASIL S/A. ESTA NOTA FISCAL E PARTE INTEGRANTE E COMPLEMENTAR DO REFERIDO CONTRATO, PARA FINS DE CONSTITUICAO DO PENHOR MERCANTIL. ACOMPANHA VEICULO: TERMO DE GARANTIA, MANUAL DO PROPRIETARIO, ACENDEDOR. BASE DE CALCULO REDUZIDA CONFORME. ITEM IV PARAGRAFO 2 DO CONVENIO ICMS 133/02 VALOR SEGURO INCLUSO NO VALOR UNITARIO - BASE DE CALCULO E ALIQUOTA ICMS CONF.CONV.132/92 E DECRETO 45490/00 FRETE JA INCLUSO NO PRECO DO VEICULO. VIA TRANSPORTE: TERRESTRE ORDEM PRODUCAO: 294020 CONSORCIO: PATIO: 1 BASE CALC ICMS/IPI : 56.361,43 BASE RED/VALOR ICMS: 53.453,46/3.741,74</infCpl></infAdic></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod><Reference URI="#NFe28070413349550000324550010000109000000110850"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod><DigestValue>I58ROhWJ1+GlmoKlUDAbplxrJ8w=</DigestValue></Reference></SignedInfo><SignatureValue>jb3X9Sh3OvC+EGDdH3crhS9l1TJbiIpkQ0oPbXDWLnyOCMRx3QoXC6AEqhDqP6M0eiumhDIZr4AtL96gL0KdUedTuoH1e/CV0uOvvKrz0ZQex/6grLG195lm1wiZPk4T6+OzVjez0rOmyB4BQxtC26ER0OlXrJj9uNI4bG0neCQ=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDpzCCAxCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJCUjEQMA4GA1UECBMHU0VSR0lQRTEQMA4GA1UEBxMHQVJBQ0FKVTEOMAwGA1UEChMFU0VGQVoxDzANBgNVBAsTBkdFUlRFQzEfMB0GA1UEAxMWQUMgSU5URVJNIFNFRkFaIERFU0VOVjAeFw0wNzA5MTgxMzE5MjdaFw0wODA5MTcxMzE5MjdaMHwxCzAJBgNVBAYTAkJSMRAwDgYDVQQIEwdTRVJHSVBFMRAwDgYDVQQHEwdBUkFDQUpVMQ8wDQYDVQQKEwZHRVJURUMxDzANBgNVBAsTBkdFUlRFQzEnMCUGA1UEAxMeREVTRU5WT0xWSU1FTlRPOjEzMzQ5NTUwMDAwMzI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlzjg0NkHlxB24FS2fI4h+knKEwh3v5hYRtWGZvYVlMxMU5F9AAAXIaDltPrCp0dETRKYhAVGVAUuHaPHEFiJO5uhFUT6JJEy6ppYN3oH4xNijk/SaJL8yL1hQm8cvc0LNJadnHHLiFlpISTiZK6eX7gjOW6iIFRl44OoYMUtPWQIDAQABo4IBQDCCATwwCQYDVR0TBAIwADBHBgNVHR8EQDA+MDygOqA4hjZodHRwOi8vbmZlZC5zZWZhei5zZS5nb3YuYnIvbmZlL2xjci9JbnRTRUZBWkRlc2Vudi5jcmwwEQYJYIZIAYb4QgEBBAQDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAkBgNVHREEHTAboBkGBWBMAQMDoBAMDjEzMzQ5NTUwMDAwMzI0MBMGA1UdIAQMMAowCAYGYEwBAgEQMAsGA1UdDwQEAwIF4DAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFCbkjsXo4Zjm3aujOOFXRnhhesTXMB8GA1UdIwQYMBaAFCdUULrpSDfI6YnadWVtjen7d/NYMA0GCSqGSIb3DQEBBQUAA4GBAJCV67LXSw37DGcMDxOWn97wrpawYzW9EIFRn0ymeYgz5RNHVeFQNpCbrJHiSgTr6UsghqdQT+QZm94XZmqMp7S5oiCYY69uz8ulsZ6BZWFdCnsSO+Ab3HAbBQX+XhJ72KffwHhZDGtcoLALlakT0Ugqkow1ztw4GB+JAowrnzgq</X509Certificate></X509Data></KeyInfo></Signature></NFe></enviNFe>
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xml
new file mode 100644
index 00000000000..42f08bbee66
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xml
@@ -0,0 +1,70 @@
+
+
+ Test for source tree numbering
+
+ Level A
+
+ Level B
+
+
+ Level B
+
+ Level C
+
+
+
+ Level B
+
+ Level C
+
+ Level D
+
+
+
+
+
+ Level A
+
+ Level B
+
+ Level C
+
+ Level D
+
+ Level E
+
+
+
+
+
+
+ Level A
+
+ Level B
+
+ Level C
+
+ Level D
+
+ Level E
+
+
+
+ Level D
+
+ Level E
+
+
+
+
+ Level C
+
+ Level D
+
+
+
+
+ Level B
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xsl
new file mode 100644
index 00000000000..36117c16a74
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/numbering63.xsl
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/outer.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/outer.xsl
new file mode 100644
index 00000000000..bdf6a4a9005
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/outer.xsl
@@ -0,0 +1,3 @@
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xml
new file mode 100644
index 00000000000..ee6a09c1d5a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xsl
new file mode 100644
index 00000000000..32f4cb360dc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/redirect.xsl
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+ Euro 1: €
+
+
+
+ Euro 1: €
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/sax/Bug6451633.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/sax/Bug6451633.java
new file mode 100644
index 00000000000..855fa6ee1e6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/sax/Bug6451633.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.sax;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.helpers.AttributesImpl;
+
+/*
+ * @bug 6451633
+ * @summary Test TransformerHandler ignores empty text node.
+ */
+public class Bug6451633 {
+
+ @Test
+ public void test() throws Exception {
+ TransformerHandler th = ((SAXTransformerFactory) TransformerFactory.newInstance()).newTransformerHandler();
+
+ DOMResult result = new DOMResult();
+ th.setResult(result);
+
+ th.startDocument();
+ th.startElement("", "root", "root", new AttributesImpl());
+ th.characters(new char[0], 0, 0);
+ th.endElement("", "root", "root");
+ th.endDocument();
+
+ // there's no point in having empty text --- we should remove it
+ Assert.assertEquals(0, ((Document) result.getNode()).getDocumentElement().getChildNodes().getLength());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/src.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/src.xml
new file mode 100644
index 00000000000..a76af7c89f5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/src.xml
@@ -0,0 +1,33 @@
+
+
+
+ localhost
+ 8484
+ Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
+ en
+ /matte
+ /logon.do
+
+
+ org.springframework.web.servlet.support.RequestContext@4bf0ff
+
+
+ You must be logged in and have sufficient access privileges to view the requested page.
+
+
+ http://localhost:8484/matte/home.do
+
+
+
+ */*
+ en
+ gzip, deflate
+ JSESSIONID=42E37E740D15356C0E861590CEA4A421; JSESSIONID=5647B2F0C0A7E5E673970E4A21D2F3FD
+ Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
+ keep-alive
+ localhost:8484
+
+
+ no model
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/template.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/template.xml
new file mode 100644
index 00000000000..954260ef2ff
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/template.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest-in.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest-in.xml
new file mode 100644
index 00000000000..eeb3723c2bc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest-in.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest.xsl
new file mode 100644
index 00000000000..5b10fc88769
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tigertest.xsl
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tmp.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tmp.xml
new file mode 100644
index 00000000000..86dd86d875b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/tmp.xml
@@ -0,0 +1 @@
+<_test01/><_test-04>T%e!s#t$1000509.90.0860833333333333345134545.22916666666667114.44-16.886.70A1Vn2000503.80.08438888888888889-003011-0.503055555555555698.33-61.146.29gG93Psc33 Psc000520.10.08891666666666666-054227-5.707500000000000593.75-65.934.61K0IIIbCN-0.54Peg86 Peg000542.00.09513234613.39611111111111106.19-47.985.51G5III5000616.00.1044444444444444558261258.43666666666666117.03-03.925.96G5V6000619.00.10527777777777779-490430-49.075321.61-66.385.70G1IV7Cas10 Cas000626.50.1073611111111111264114664.19611111111111118.061.755.59B9III8000636.80.1102222222222222229011729.02138888888889111.26-32.836.13K0V9000650.10.11391666666666667-230627-23.107552.21-79.146.18A7V10000718.20.12172222222222222-172311-17.38638888888888874.36-75.906.19A6Vn
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/toys.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/toys.xml
new file mode 100644
index 00000000000..1d9fbe2df66
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/toys.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ Lego-Model01
+ 65.99
+
+
+ Lego-Model2
+ 69.99
+
+
+ Lego-Model3
+ 14.99
+
+
+ Barbie-Pink
+ 12.99
+
+
+ Barbie-Blue
+ 13.99
+
+
+ Barbie-White
+ 13.99
+
+
+ Barbie-Plain
+ 13.99
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/transform.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/transform.xsl
new file mode 100644
index 00000000000..10143526639
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/transform.xsl
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media-form.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media-form.xsl
new file mode 100644
index 00000000000..3d6de738469
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media-form.xsl
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media.xsl
new file mode 100644
index 00000000000..a89c42156b3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/upload-media.xsl
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ no-sub-nav
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util.xsl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util.xsl
new file mode 100644
index 00000000000..6db5619a4cf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util.xsl
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+ "
+ \"
+
+
+
+
+
+
+
+
+ '
+ \'
+
+
+
+
+
+
+
+
+
+
+
+ \
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 350
+
+
+
+
+
+
+
+
+
+
+ …
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/DOMUtil.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/DOMUtil.java
new file mode 100644
index 00000000000..1881299a7c6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/DOMUtil.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.util;
+
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+import org.testng.Assert;
+import org.w3c.dom.Document;
+
+public class DOMUtil extends TransformerUtil {
+
+ DocumentBuilder docBuilder = null;
+
+ private static DOMUtil instance = null;
+
+ /** Creates a new instance of DOMUtil */
+ private DOMUtil() throws Exception {
+ if (docBuilder == null)
+ docBuilder = getDomParser();
+ }
+
+ public static synchronized DOMUtil getInstance() throws Exception {
+ if (instance == null)
+ instance = new DOMUtil();
+ return instance;
+ }
+
+ public Source prepareSource(InputStream is) throws Exception {
+ docBuilder.reset();
+ Document doc1 = docBuilder.parse(is);
+ return new DOMSource(doc1);
+ }
+
+ public Result prepareResult() {
+ Document target = docBuilder.newDocument();
+ return new DOMResult(target);
+ }
+
+ public void checkResult(Result result, String version) {
+ String resultVersion = ((Document) ((DOMResult) result).getNode()).getXmlVersion();
+ Assert.assertTrue(version.equals(resultVersion), "Expected XML Version is 1.1, but actual version " + resultVersion);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/SAXUtil.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/SAXUtil.java
new file mode 100644
index 00000000000..fd7421c23ff
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/SAXUtil.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.util;
+
+import java.io.InputStream;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.VersionDefaultHandler;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXSource;
+
+import org.testng.Assert;
+import org.xml.sax.InputSource;
+
+public class SAXUtil extends TransformerUtil {
+
+ private static SAXUtil instance = null;
+
+ /** Creates a new instance of SAXUtil */
+ private SAXUtil() {
+
+ }
+
+ public static synchronized SAXUtil getInstance() throws Exception {
+ if (instance == null)
+ instance = new SAXUtil();
+ return instance;
+ }
+
+ public Source prepareSource(InputStream is) throws Exception {
+ return new SAXSource(new InputSource(is));
+ }
+
+ public Result prepareResult() throws Exception {
+ VersionDefaultHandler dh = new VersionDefaultHandler();
+ return new SAXResult(dh);
+ }
+
+ public void checkResult(Result result, String inputVersion) throws Exception {
+ String version = ((VersionDefaultHandler) ((SAXResult) result).getHandler()).getVersion();
+ Assert.assertTrue(inputVersion.equals(version), "Expected XML Version is 1.1, but actual version " + version);
+ }
+
+ public void checkResult(Result result, String inputVersion, String encoding) throws Exception {
+ checkResult(result, inputVersion);
+ String resultEncoding = ((VersionDefaultHandler) ((SAXResult) result).getHandler()).getEncoding();
+ Assert.assertTrue(encoding.equals(resultEncoding), "Expected XML Version is " + encoding + " , but actual encoding " + resultEncoding);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StAXUtil.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StAXUtil.java
new file mode 100644
index 00000000000..6c17ffa7829
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StAXUtil.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.util;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerUtilFactory;
+import javax.xml.transform.VersionEventWriter;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stax.StAXSource;
+
+import org.testng.Assert;
+
+public class StAXUtil extends TransformerUtil {
+
+ private static StAXUtil instance = null;
+
+ /** Creates a new instance of StAXUtil */
+ private StAXUtil() {
+ }
+
+ public static synchronized StAXUtil getInstance() throws Exception {
+ if (instance == null)
+ instance = new StAXUtil();
+ return instance;
+ }
+
+ public Source prepareSource(InputStream is) throws Exception {
+ XMLEventReader reader = XMLInputFactory.newInstance().createXMLEventReader(is);
+ return new StAXSource(reader);
+ }
+
+ public Result prepareResult() throws Exception {
+ VersionEventWriter writer = new VersionEventWriter();
+ return new StAXResult(writer);
+ }
+
+ public void checkResult(Result staxResult, String version) throws Exception {
+ VersionEventWriter writer = (VersionEventWriter) ((StAXResult) staxResult).getXMLEventWriter();
+ Assert.assertTrue(writer.getVersion().equals(version), "Expected XML Version is 1.1, but actual version " + writer.getVersion());
+ }
+
+ public void checkResult(Result staxResult, String version, String encoding) throws Exception {
+ VersionEventWriter writer = (VersionEventWriter) ((StAXResult) staxResult).getXMLEventWriter();
+ Assert.assertTrue(writer.getVersion().equals(version), "Expected XML Version is 1.1, but actual version " + writer.getVersion());
+ Assert.assertTrue(writer.getEncoding().equals(encoding), "Expected encoding is " + encoding + ", but actual encoding " + writer.getEncoding());
+ }
+
+ public Source prepareStreamSource(InputStream is) throws Exception {
+ XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is);
+ return new StAXSource(reader);
+ }
+
+ public Result prepareStreamResult() throws Exception {
+ XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(new FileOutputStream(TEMP_FILE));
+ return new StAXResult(writer);
+ }
+
+ public void checkStreamResult(Result staxResult, String version) throws Exception {
+ ((StAXResult) staxResult).getXMLStreamWriter().close();
+ ((StreamUtil) TransformerUtilFactory.getUtil(TransformerUtilFactory.STREAM)).checkStream(new FileInputStream(TEMP_FILE), version);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StreamUtil.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StreamUtil.java
new file mode 100644
index 00000000000..7bbf93f4359
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/StreamUtil.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.VersionDefaultHandler;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.w3c.dom.Document;
+
+public class StreamUtil extends TransformerUtil {
+
+ DocumentBuilder docBuilder = null;
+
+ private static StreamUtil instance = null;
+
+ /** Creates a new instance of StreamUtil */
+ private StreamUtil() throws Exception {
+ if (docBuilder == null)
+ docBuilder = getDomParser();
+ }
+
+ public static synchronized StreamUtil getInstance() throws Exception {
+ if (instance == null)
+ instance = new StreamUtil();
+ return instance;
+ }
+
+ public Source prepareSource(InputStream is) throws Exception {
+ return new StreamSource(is);
+ }
+
+ public Result prepareResult() throws Exception {
+ FileOutputStream fos = new FileOutputStream(TEMP_FILE);
+ return new StreamResult(fos);
+ }
+
+ public void checkResult(Result result, String inputVersion) throws Exception {
+ ((StreamResult) result).getOutputStream().close();
+ FileInputStream fis = new FileInputStream(TEMP_FILE);
+ checkStream(fis, inputVersion);
+ }
+
+ public void checkStream(FileInputStream fis, String inputVersion) throws Exception {
+ docBuilder.reset();
+ Document output = docBuilder.parse(fis);
+ String version = output.getXmlVersion();
+ Assert.assertTrue(inputVersion.equals(version), "Expected XML Version is 1.1, but actual version " + version);
+ }
+
+ public void checkResult(Result result, String version, String encoding) throws Exception {
+ // use sax parser, as encoding info cannot be set on DOM document
+ SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+ VersionDefaultHandler dh = new VersionDefaultHandler();
+ parser.parse(new File(TEMP_FILE), dh);
+ Assert.assertTrue(dh.getVersion().equals(version), "Expected version is " + version + " actual version " + dh.getVersion());
+ Assert.assertTrue(dh.getEncoding().equals(encoding), "Expected version is " + encoding + " actual version " + dh.getEncoding());
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/TransformerUtil.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/TransformerUtil.java
new file mode 100644
index 00000000000..5a92fe77069
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/util/TransformerUtil.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform.util;
+
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+public abstract class TransformerUtil {
+
+ protected String type;
+
+ protected final String TEMP_FILE = "tmp.xml";
+
+ public abstract Source prepareSource(InputStream is) throws Exception;
+
+ public abstract Result prepareResult() throws Exception;
+
+ public abstract void checkResult(Result result, String version) throws Exception;
+
+ public void checkResult(Result result, String version, String encoding) throws Exception {
+ checkResult(result, version);
+ }
+
+ public DocumentBuilder getDomParser() throws Exception {
+ DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance();
+ return docBF.newDocumentBuilder();
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/6773084.policy b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/6773084.policy
new file mode 100644
index 00000000000..b4547934b44
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/6773084.policy
@@ -0,0 +1,23 @@
+grant {
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+ permission java.lang.RuntimePermission "accessDeclaredMembers";
+
+ permission java.io.FilePermission "${test.classes}/../../-", "read, write, delete";
+ permission java.io.FilePermission ".", "read, write, delete";
+ permission java.util.PropertyPermission "*", "read, write";
+
+ permission java.lang.RuntimePermission "setSecurityManager";
+ permission java.lang.RuntimePermission "createSecurityManager";
+ permission java.lang.RuntimePermission "createClassLoader";
+ permission java.lang.RuntimePermission "setIO";
+ permission java.lang.RuntimePermission "setContextClassLoader";
+ permission java.security.SecurityPermission "getPolicy";
+
+ permission java.io.FilePermission "${test.src}/-", "read, write, delete";
+ permission java.io.FilePermission "${user.dir}/-", "read, write, delete";
+ permission java.io.FilePermission "${java.io.tmpdir}/-", "read, write, delete";
+
+
+ permission java.lang.RuntimePermission "modifyThread";
+
+};
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966232.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966232.java
new file mode 100644
index 00000000000..925bf2c9123
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966232.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4966232
+ * @summary Test SchemaFactory.newSchema(Source) returns a Schema instance for DOMSource & SAXSource.
+ */
+public class Bug4966232 {
+
+ // test for W3C XML Schema 1.0 - newSchema(Source schema)
+ // supports and return a valid Schema instance
+ // SAXSource - valid schema
+
+ @Test
+ public void testSchemaFactory01() throws Exception {
+ SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ InputSource is = new InputSource(Bug4966232.class.getResourceAsStream("test.xsd"));
+ SAXSource ss = new SAXSource(is);
+ Schema s = sf.newSchema(ss);
+ Assert.assertNotNull(s);
+ }
+
+ // test for W3C XML Schema 1.0 - newSchema(Source schema)
+ // supports and return a valid Schema instance
+ // DOMSource - valid schema
+
+ @Test
+ public void testSchemaFactory02() throws Exception {
+ Document doc = null;
+ SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ doc = dbf.newDocumentBuilder().parse(Bug4966232.class.getResource("test.xsd").toExternalForm());
+ DOMSource ds = new DOMSource(doc);
+ Schema s = sf.newSchema(ds);
+ Assert.assertNotNull(s);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.java
new file mode 100644
index 00000000000..6d1f0ad2374
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+import util.DraconianErrorHandler;
+
+/*
+ * @bug 4966254
+ * @summary Test validate(StreamSource) & validate(StreamSource,null) works instead of throws IOException.
+ */
+public class Bug4966254 {
+
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void testValidator01() throws Exception {
+ getValidator().validate(getInstance());
+ }
+
+ @Test
+ public void testValidator02() throws Exception {
+ getValidator().validate(getInstance(), null);
+ }
+
+ private StreamSource getInstance() {
+ return new StreamSource(Bug4966254.class.getResource(("Bug4966254.xml")).toExternalForm());
+ }
+
+ private Validator getValidator() throws SAXException {
+ Schema s = getSchema();
+ Validator v = s.newValidator();
+ Assert.assertNotNull(v);
+ v.setErrorHandler(new DraconianErrorHandler());
+ return v;
+ }
+
+ private Schema getSchema() throws SAXException {
+ SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ Schema s = sf.newSchema(Bug4966254.class.getResource("Bug4966254.xsd"));
+ Assert.assertNotNull(s);
+ return s;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xml
new file mode 100644
index 00000000000..251af32866d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xsd
new file mode 100644
index 00000000000..88a29ef37bc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4966254.xsd
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969042.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969042.java
new file mode 100644
index 00000000000..71ad30d61c9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969042.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4969042
+ * @summary Test ValidationHandler shall invoke ignorableWhitespace() of the
+ * user-defined ContentHandler once the validator detects any ignorable whitespaces.
+ */
+public class Bug4969042 {
+
+ public static final String XSD = "\n" + "\n" + " \n"
+ + " \n" + " \n" + " \n" + " \n"
+ + " \n" + " \n" + "\n";
+
+ public static final String XML = "\n" + "\n" + " \n" + " 123abc\n" + " \n"
+ + "\n";
+
+ private ValidatorHandler createValidatorHandler(String xsd) throws SAXException {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ StringReader reader = new StringReader(xsd);
+ StreamSource xsdSource = new StreamSource(reader);
+
+ Schema schema = schemaFactory.newSchema(xsdSource);
+ return schema.newValidatorHandler();
+ }
+
+ private XMLReader createXMLReader() throws ParserConfigurationException, SAXException {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ if (!parserFactory.isNamespaceAware()) {
+ parserFactory.setNamespaceAware(true);
+ }
+
+ return parserFactory.newSAXParser().getXMLReader();
+ }
+
+ private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException {
+ StringReader reader = new StringReader(xml);
+ InputSource inSource = new InputSource(reader);
+
+ xmlReader.parse(inSource);
+ }
+
+ @Test
+ public void test() throws SAXException, ParserConfigurationException, IOException {
+ XMLReader xmlReader = createXMLReader();
+ ValidatorHandler validatorHandler = createValidatorHandler(XSD);
+ xmlReader.setContentHandler(validatorHandler);
+
+ final boolean[] invoked = { false, false };
+ DefaultHandler contentHandler = new DefaultHandler() {
+ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+ invoked[0] = true;
+ }
+
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ invoked[1] = true;
+ }
+ };
+ validatorHandler.setContentHandler(contentHandler);
+
+ parse(xmlReader, XML);
+
+ Assert.assertTrue(invoked[0], "Method ignorableWhitespace() was not invoked.");
+ Assert.assertTrue(invoked[1], "Method characters() was not invoked.");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969089.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969089.java
new file mode 100644
index 00000000000..32477a246b5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969089.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.StringReader;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4969089
+ * @summary Test when an ErrorHandler is set for a SchemaFactory, SchemaFactory.newSchema(Source[])
+ * method throws an exception that is not equal to the exception thrown from the ErrorHandler.
+ */
+public class Bug4969089 {
+
+ @Test
+ public void test1() {
+ String xsd1 = "\n" + "\n" + " \n" + "\n";
+
+ final SAXException EUREKA = new SAXException("NewSchema007");
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ StringReader reader = new StringReader(xsd1);
+ StreamSource source = new StreamSource(reader);
+ DefaultHandler errorHandler = new DefaultHandler() {
+ public void fatalError(SAXParseException unused) throws SAXException {
+ throw EUREKA;
+ }
+
+ public void error(SAXParseException unused) throws SAXException {
+ throw EUREKA;
+ }
+ };
+ schemaFactory.setErrorHandler(errorHandler);
+
+ try {
+ schemaFactory.newSchema(new Source[] { source });
+ Assert.fail("SAXException was not thrown.");
+ } catch (SAXException e) {
+ Assert.assertSame(e, EUREKA);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969110.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969110.java
new file mode 100644
index 00000000000..f9fb0f4adb9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969110.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+
+/*
+ * @bug 4969110
+ * @summary Test ValidationHandler.set/getProperty() throws a correct exception
+ * instead of a sun internal exception in case the "property name" parameter is invalid.
+ */
+public class Bug4969110 {
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ @Test
+ public void test1() throws SAXException {
+ try {
+ ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
+ validatorHandler.getProperty("unknown1234");
+ Assert.fail("SAXNotRecognizedException was not thrown.");
+ } catch (SAXNotRecognizedException e) {
+ }
+ }
+
+ @Test
+ public void test2() throws SAXException {
+ try {
+ doTest(null);
+ Assert.fail("NullPointerException was not thrown.");
+ } catch (NullPointerException e) {
+ }
+ }
+
+ @Test
+ public void test3() throws SAXException {
+ try {
+ doTest("unknown1234");
+ Assert.fail("SAXNotRecognizedException was not thrown.");
+ } catch (SAXNotRecognizedException e) {
+ }
+ }
+
+ public void doTest(String name) throws SAXException {
+ ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
+ validatorHandler.setProperty(name, "123");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969689.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969689.java
new file mode 100644
index 00000000000..6790321bdbf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969689.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+
+
+/*
+ * @bug 4969689
+ * @summary Test SchemaFactory.get/setFeature() throw NullPointerException
+ * instead of SAXNotRecognizedException in case the "feature name" parameter is null.
+ */
+public class Bug4969689 {
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ @Test
+ public void test01() throws SAXNotRecognizedException, SAXNotSupportedException {
+ try {
+ schemaFactory.getFeature(null);
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ; // expected
+ }
+ }
+
+ @Test
+ public void test() throws SAXNotRecognizedException, SAXNotSupportedException {
+ try {
+ schemaFactory.setFeature(null, false);
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969692.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969692.java
new file mode 100644
index 00000000000..e19372242a3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969692.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 4969692
+ * @summary Test Validator.get/setFeature() throw NullPointerException
+ * instead of SAXNotRecognizedException in case the "feature name" parameter is null.
+ */
+public class Bug4969692 {
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ @Test
+ public void test01() throws SAXException {
+ Validator validator = schemaFactory.newSchema().newValidator();
+ try {
+ validator.getFeature(null);
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ;
+ }
+ }
+
+ @Test
+ public void test02() throws SAXException {
+ Validator validator = schemaFactory.newSchema().newValidator();
+ try {
+ validator.setFeature(null, false);
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969693.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969693.java
new file mode 100644
index 00000000000..026da4a3ebf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969693.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 4969693
+ * @summary Test Validator.get/setProperty() throw NullPointerException
+ * instead of SAXNotRecognizedException in case the "property name" parameter is null.
+ */
+public class Bug4969693 {
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ @Test
+ public void test01() throws SAXException {
+ Validator validator = schemaFactory.newSchema().newValidator();
+ try {
+ validator.getProperty(null);
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ;
+ }
+ }
+
+ @Test
+ public void test02() throws SAXException {
+ Validator validator = schemaFactory.newSchema().newValidator();
+ try {
+ validator.setProperty(null, "abc");
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969695.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969695.java
new file mode 100644
index 00000000000..39ea1b7be03
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969695.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+
+/*
+ * @bug 4969695
+ * @summary Test SchemaFactory.get/setProperty() throw NullPointerException
+ * instead of SAXNotRecognizedException in case the "property name" parameter is null.
+ */
+public class Bug4969695 {
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ @Test
+ public void test01() throws SAXNotRecognizedException, SAXNotSupportedException {
+ try {
+ schemaFactory.getProperty(null);
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ; // expected
+ }
+ }
+
+ @Test
+ public void test() throws SAXNotRecognizedException, SAXNotSupportedException {
+ try {
+ schemaFactory.setProperty(null, "123");
+ Assert.fail("exception expected");
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969732.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969732.java
new file mode 100644
index 00000000000..5f298af454d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4969732.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.TypeInfoProvider;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4969732
+ * @summary Test TypeInfoProvider.getElementTypeInfo() throws IllegalStateException
+ * in case the method is not called from method startElement() or endElement().
+ */
+public class Bug4969732 {
+
+ public static final String XSD = "\n" + "\n" + " \n"
+ + "\n";
+
+ public static final String XML = "\n" + "1234abc\n";
+
+ private ValidatorHandler createValidatorHandler(String xsd) throws SAXException {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ StringReader reader = new StringReader(xsd);
+ StreamSource xsdSource = new StreamSource(reader);
+
+ Schema schema = schemaFactory.newSchema(xsdSource);
+ return schema.newValidatorHandler();
+ }
+
+ private XMLReader createXMLReader() throws Exception {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ parserFactory.setNamespaceAware(true);
+
+ return parserFactory.newSAXParser().getXMLReader();
+ }
+
+ private void parse(XMLReader xmlReader, String xml) throws Exception {
+ StringReader reader = new StringReader(xml);
+ InputSource inSource = new InputSource(reader);
+
+ xmlReader.parse(inSource);
+ }
+
+ @Test
+ public void test1() throws Exception {
+ XMLReader xmlReader = createXMLReader();
+ final ValidatorHandler validatorHandler = createValidatorHandler(XSD);
+ xmlReader.setContentHandler(validatorHandler);
+
+ DefaultHandler handler = new DefaultHandler() {
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ TypeInfoProvider infoProvider = null;
+ synchronized (validatorHandler) {
+ infoProvider = validatorHandler.getTypeInfoProvider();
+ }
+ if (infoProvider == null) {
+ Assert.fail("Can't obtain TypeInfo object.");
+ }
+
+ try {
+ infoProvider.getElementTypeInfo();
+ Assert.fail("IllegalStateException was not thrown.");
+ } catch (IllegalStateException e) {
+ // as expected
+ System.out.println("OK");
+ }
+ }
+ };
+ validatorHandler.setContentHandler(handler);
+
+ parse(xmlReader, XML);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970380.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970380.java
new file mode 100644
index 00000000000..b9a0656b002
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970380.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXNotRecognizedException;
+
+/*
+ * @bug 4970380
+ * @summary Test validatorHandler.getFeature(...) with unknown name and "http://xml.org/sax/features/namespace-prefixes".
+ */
+public class Bug4970380 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
+
+ try {
+ validatorHandler.getFeature("unknown1234");
+ Assert.fail("SAXNotRecognizedException was not thrown.");
+ } catch (SAXNotRecognizedException e) {
+ ; // expected
+ }
+
+ if (!validatorHandler.getFeature("http://xml.org/sax/features/namespace-prefixes")) {
+ // as expected
+ System.out.println("getFeature(namespace-prefixes): OK");
+ } else {
+ Assert.fail("Expected false, returned true.");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970383.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970383.java
new file mode 100644
index 00000000000..3ac15277ec4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970383.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4970383
+ * @summary Test validatorHandler.setFeature throws NullPointerException if name parameter is null.
+ */
+public class Bug4970383 {
+
+ @Test
+ public void test() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
+ try {
+ validatorHandler.setFeature(null, false);
+ Assert.fail("should report an error");
+ } catch (NullPointerException e) {
+ ; // expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970400.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970400.java
new file mode 100644
index 00000000000..d0c57b20765
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970400.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4970400
+ * @summary Test ValidatorHandler recognizes namespace-prefixes feature.
+ */
+public class Bug4970400 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
+ validatorHandler.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+ validatorHandler.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970402.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970402.java
new file mode 100644
index 00000000000..55f3d1d9d3d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970402.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.TypeInfoProvider;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4970402
+ * @summary Test TypeInfoProvider's attribute accessing methods throw IndexOutOfBoundsException when index parameter is invalid.
+ */
+public class Bug4970402 {
+
+ public static final String XSD = "\n" + "\n" + " \n"
+ + " \n" + " \n" + " \n" + " \n"
+ + " \n" + " \n" + " \n" + "\n";
+
+ public static final String XML = "\n" + "\n" + " 123abc\n"
+ + "\n";
+
+ private ValidatorHandler createValidatorHandler(String xsd) throws SAXException {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ StringReader reader = new StringReader(xsd);
+ StreamSource xsdSource = new StreamSource(reader);
+
+ Schema schema = schemaFactory.newSchema(xsdSource);
+ return schema.newValidatorHandler();
+ }
+
+ private XMLReader createXMLReader() throws ParserConfigurationException, SAXException {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ parserFactory.setNamespaceAware(true);
+ return parserFactory.newSAXParser().getXMLReader();
+ }
+
+ private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException {
+ StringReader reader = new StringReader(xml);
+ InputSource inSource = new InputSource(reader);
+
+ xmlReader.parse(inSource);
+ }
+
+ @Test
+ public void test() throws Exception {
+ XMLReader xmlReader = createXMLReader();
+ final ValidatorHandler validatorHandler = createValidatorHandler(XSD);
+ xmlReader.setContentHandler(validatorHandler);
+
+ DefaultHandler handler = new DefaultHandler() {
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ if (!"ns:test".equals(qName)) {
+ return;
+ }
+
+ TypeInfoProvider infoProvider = null;
+ synchronized (validatorHandler) {
+ infoProvider = validatorHandler.getTypeInfoProvider();
+ }
+ Assert.assertTrue(infoProvider != null, "Can't obtain TypeInfoProvider object.");
+
+ try {
+ infoProvider.getAttributeTypeInfo(-1);
+ Assert.fail("IndexOutOfBoundsException was not thrown.");
+ } catch (IndexOutOfBoundsException e) {
+ ; // as expected
+ }
+
+ try {
+ infoProvider.isIdAttribute(-1);
+ Assert.fail("IndexOutOfBoundsException was not thrown.");
+ } catch (IndexOutOfBoundsException e) {
+ ; // as expected
+ }
+ }
+ };
+ validatorHandler.setContentHandler(handler);
+
+ parse(xmlReader, XML);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970951.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970951.java
new file mode 100644
index 00000000000..4f986a8920a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4970951.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.TypeInfoProvider;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4970951
+ * @summary Test TypeInfoProvider.isSpecified(...) return true if the attribute was originally present.
+ */
+public class Bug4970951 {
+
+ public static final String XSD = "\n" + "\n" + " \n"
+ + " \n" + " \n" + " \n" + " \n"
+ + " \n" + " \n" + " \n"
+ + " \n" + "\n";
+
+ public static final String XML = "\n" + "\n" + " 123abc\n"
+ + "\n";
+
+ private ValidatorHandler createValidatorHandler(String xsd) throws SAXException {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ StringReader reader = new StringReader(xsd);
+ StreamSource xsdSource = new StreamSource(reader);
+
+ Schema schema = schemaFactory.newSchema(xsdSource);
+ return schema.newValidatorHandler();
+ }
+
+ private XMLReader createXMLReader() throws ParserConfigurationException, SAXException {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ parserFactory.setNamespaceAware(true);
+
+ return parserFactory.newSAXParser().getXMLReader();
+ }
+
+ private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException {
+ StringReader reader = new StringReader(xml);
+ InputSource inSource = new InputSource(reader);
+
+ xmlReader.parse(inSource);
+ }
+
+ @Test
+ public void test() throws Exception {
+ XMLReader xmlReader = createXMLReader();
+ final ValidatorHandler validatorHandler = createValidatorHandler(XSD);
+ xmlReader.setContentHandler(validatorHandler);
+
+ DefaultHandler handler = new DefaultHandler() {
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ if (!"ns:test".equals(qName)) {
+ return;
+ }
+
+ TypeInfoProvider infoProvider = validatorHandler.getTypeInfoProvider();
+ if (infoProvider == null) {
+ throw new SAXException("Can't obtain TypeInfoProvider object.");
+ }
+
+ int index = attributes.getIndex("id");
+ if (index == -1) {
+ throw new SAXException("The attribute 'id' is not in the list.");
+ }
+
+ Assert.assertTrue(infoProvider.isSpecified(index));
+
+ index = attributes.getIndex("date");
+ if (index == -1) {
+ throw new SAXException("The attribute 'date' is not in the list.");
+ }
+
+ Assert.assertFalse(infoProvider.isSpecified(index));
+
+ System.out.println("OK");
+ }
+ };
+ validatorHandler.setContentHandler(handler);
+
+ parse(xmlReader, XML);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971605.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971605.java
new file mode 100644
index 00000000000..09cd588489a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971605.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4971605
+ * @summary Test SchemaFactory.newSchema(Source) returns a Schema instance for DOMSource.
+ */
+public class Bug4971605 {
+
+ @Test
+ public void test1() throws Exception {
+ String xsd = "\n" + "\n" + " \n" + "\n";
+
+ DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
+ docBuilderFactory.setNamespaceAware(true);
+ DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+
+ Node document = docBuilder.parse(new InputSource(new StringReader(xsd)));
+ Assert.assertNotNull(document);
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ Schema schema = schemaFactory.newSchema(new Source[] { new DOMSource(document) });
+ Assert.assertNotNull(schema, "Failed: newSchema returned null.");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971607.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971607.java
new file mode 100644
index 00000000000..e33b040a778
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4971607.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4971607
+ * @summary Test ValidatorHandler.getFeature(...) throws NullPointerException when name parameter is null.
+ */
+public class Bug4971607 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
+
+ try {
+ validatorHandler.getFeature(null);
+ Assert.fail();
+ } catch (NullPointerException e) {
+ e.printStackTrace();
+ ; // as expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4972882.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4972882.java
new file mode 100644
index 00000000000..8e84e840626
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4972882.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+import util.DraconianErrorHandler;
+
+/*
+ * @bug 4972882
+ * @summary Test Validator throws Exception when two identity-constraints are defined with the same {name} and {target namespace}.
+ */
+public class Bug4972882 {
+
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test1() throws Exception {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setValidating(true);
+ dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ dbf.setAttribute(SCHEMA_SOURCE, Bug4972882.class.getResource("targetNS00101m2_stub.xsd").toExternalForm());
+
+ DocumentBuilder builder = dbf.newDocumentBuilder();
+ builder.setErrorHandler(new DraconianErrorHandler());
+
+ try {
+ builder.parse(Bug4972882.class.getResource("targetNS00101m2_stub.xml").toExternalForm());
+ Assert.fail("failure expected");
+ } catch (SAXException e) {
+ Assert.assertTrue(e.getMessage().indexOf("sch-props-correct.2") != -1);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.java
new file mode 100644
index 00000000000..73049545f24
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 4986844
+ * @summary Test SchemaFactory can detect particle restriction.
+ */
+public class Bug4986844 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ try {
+ schemaFactory.newSchema(Bug4986844.class.getResource("Bug4986844.xsd"));
+ Assert.fail("should report an error");
+ } catch (SAXException e) {
+ if (e.getMessage().startsWith("rcase-RecurseUnordered.2"))
+ ; // as expected
+ else
+ throw e;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.xsd
new file mode 100644
index 00000000000..fe8354c5abd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4986844.xsd
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4987574.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4987574.java
new file mode 100644
index 00000000000..a56806a61c8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4987574.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4987574
+ * @summary Test schemaFactory.newSchema doesn't throw NullPointerExceptio for empty schema.
+ */
+public class Bug4987574 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ File tmpFile = File.createTempFile("jaxpri", "bug");
+ tmpFile.deleteOnExit();
+ {
+ PrintWriter pw = new PrintWriter(new FileWriter(tmpFile));
+ pw.println("");
+ pw.close();
+ }
+
+ schemaFactory.newSchema(tmpFile);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.java
new file mode 100644
index 00000000000..4c372f5ad7a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 4988267
+ * @summary Test SchemaFactory can detect particle restriction.
+ */
+public class Bug4988267 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ try {
+ schemaFactory.newSchema(Bug4988267.class.getResource("Bug4988267.xsd"));
+ Assert.fail("should report an error");
+ } catch (SAXException e) {
+ if (e.getMessage().startsWith("cos-nonambig"))
+ ; // as expected
+ else
+ throw e;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.xsd
new file mode 100644
index 00000000000..85923c0c861
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988267.xsd
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.java
new file mode 100644
index 00000000000..d99960674b0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4988268
+ * @summary Test the schema is valid.
+ */
+public class Bug4988268 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ schemaFactory.newSchema(Bug4988268.class.getResource("Bug4988268.xsd"));
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.xsd
new file mode 100644
index 00000000000..e0d14a9f185
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988268.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.java
new file mode 100644
index 00000000000..9ca25216ec6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 4988387
+ * @summary Test SchemaFactory can detect invalid XPath expressions.
+ */
+public class Bug4988387 {
+
+ @Test
+ public void test1() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ try {
+ schemaFactory.newSchema(Bug4988387.class.getResource("Bug4988387.xsd"));
+ Assert.fail("incorrect XPath processed");
+ } catch (SAXException e) {
+ Assert.assertTrue(e.getMessage().startsWith("c-general-xpath"));
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.xsd
new file mode 100644
index 00000000000..6dce12a48ff
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4988387.xsd
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.java
new file mode 100644
index 00000000000..e381e65f59c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.net.URL;
+
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 4996446
+ * @summary Test SchemaFactory can detect violations of the "Schema Component Constraint: Element Declarations Consistent".
+ */
+public class Bug4996446 {
+
+ SchemaFactory schemaFactory = null;
+
+ @BeforeMethod
+ protected void setUp() {
+ schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ }
+
+ @AfterMethod
+ protected void tearDown() {
+ schemaFactory = null;
+ }
+
+ @Test
+ public void testOne() {
+
+ ErrorHandler errorHandler = new ErrorHandler();
+ schemaFactory.setErrorHandler(errorHandler);
+ URL fileName = Bug4996446.class.getResource("Bug4996446.xsd");
+ try {
+ schemaFactory.newSchema(fileName);
+ } catch (SAXException e) {
+ }
+
+ if (errorHandler.errorCounter == 0) {
+ Assert.fail(" No Errors reported: " + errorHandler.errorCounter);
+ }
+ return;
+ }
+}
+
+class ErrorHandler extends DefaultHandler {
+ public int errorCounter = 0;
+
+ public void error(SAXParseException e) throws SAXException {
+ // System.out.println(e);
+ errorCounter++;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ // System.out.println(e);
+ errorCounter++;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.xsd
new file mode 100644
index 00000000000..07f9a64b903
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4996446.xsd
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4997818.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4997818.java
new file mode 100644
index 00000000000..7330d49358b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug4997818.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.StringReader;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSResourceResolver;
+
+/*
+ * @bug 4997818
+ * @summary Test SchemaFactory.newSchema(...) throws an exception, which is thrown from LSResourceResolver.
+ */
+
+public class Bug4997818 {
+
+ @Test
+ public void test1() throws Exception {
+ String xsd1 = "\n" + "\n" + " \n"
+ + " \n" + " \n" + "\n";
+
+ final NullPointerException EUREKA = new NullPointerException("NewSchema015");
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ StringReader reader = new StringReader(xsd1);
+ StreamSource source = new StreamSource(reader);
+ LSResourceResolver resolver = new LSResourceResolver() {
+ public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
+ LSInput input;
+ if (namespaceURI != null && namespaceURI.endsWith("jaxp13_test2")) {
+ throw EUREKA;
+ } else {
+ input = null;
+ }
+
+ return input;
+ }
+ };
+ schemaFactory.setResourceResolver(resolver);
+
+ try {
+ schemaFactory.newSchema(new Source[] { source });
+ Assert.fail("NullPointerException was not thrown.");
+ } catch (RuntimeException e) {
+ if (e != EUREKA)
+ throw e;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5011500.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5011500.java
new file mode 100644
index 00000000000..bc65b4de23b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5011500.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 5011500
+ * @summary Test ValidatorHanlder and Validator can work for the xml document.
+ */
+public class Bug5011500 {
+
+ public static final String XSD = "\n" + "\n" + " \n" + " \n" + " \n"
+ + " \n" + " \n" + " \n"
+ + " \n" + " \n" + "\n";
+
+ public static final String XML = "\n" + "\n" + "\n"
+ + " 123abc\n" + "\n";
+
+ private ValidatorHandler validatorHandler;
+ private Validator validator;
+
+ private XMLReader createXMLReader() throws Exception {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ parserFactory.setNamespaceAware(true);
+
+ return parserFactory.newSAXParser().getXMLReader();
+ }
+
+ private void parse(XMLReader xmlReader, String xml) throws Exception {
+ InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xml.getBytes()));
+ InputSource inSource = new InputSource(reader);
+
+ xmlReader.parse(inSource);
+ }
+
+ @BeforeMethod
+ public void setUp() throws Exception {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(XSD.getBytes()));
+ StreamSource xsdSource = new StreamSource(reader);
+
+ Schema schema = schemaFactory.newSchema(xsdSource);
+
+ this.validatorHandler = schema.newValidatorHandler();
+ this.validator = schema.newValidator();
+ }
+
+ @Test
+ public void test1() throws Exception {
+ DefaultHandler contentHandler = new DefaultHandler();
+ validatorHandler.setContentHandler(contentHandler);
+ validatorHandler.setErrorHandler(contentHandler);
+
+ XMLReader xmlReader = createXMLReader();
+ xmlReader.setContentHandler(validatorHandler);
+ parse(xmlReader, XML);
+ }
+
+ @Test
+ public void test2() throws Exception {
+ InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(XML.getBytes()));
+ StreamSource xmlSource = new StreamSource(reader);
+
+ validator.validate(xmlSource);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.java
new file mode 100644
index 00000000000..327a387e51a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/*
+ * @bug 5072946
+ * @summary Test Validator.validate(DOMSource,DOMResult) outputs to the result.
+ */
+public class Bug5072946 {
+
+ @Test
+ public void test1() throws Exception {
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document dom = parser.parse(Bug5072946.class.getResourceAsStream("Bug5072946.xml"));
+
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema s = sf.newSchema(Bug5072946.class.getResource("Bug5072946.xsd"));
+ Validator v = s.newValidator();
+
+ DOMResult r = new DOMResult();
+ // r.setNode(dbf.newDocumentBuilder().newDocument());
+ v.validate(new DOMSource(dom), r);
+
+ Node node = r.getNode();
+ Assert.assertNotNull(node);
+ Node fc = node.getFirstChild();
+ Assert.assertTrue(fc instanceof Element);
+ Element e = (Element) fc;
+
+ Assert.assertEquals("value", e.getAttribute("foo"));
+ }
+
+ /**
+ * Tests if the identity transformer correctly sets the output node.
+ */
+ @Test
+ public void test2() throws Exception {
+ SAXTransformerFactory sf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
+ TransformerHandler th = sf.newTransformerHandler();
+ DOMResult r = new DOMResult();
+ th.setResult(r);
+
+ XMLReader reader = XMLReaderFactory.createXMLReader();
+ reader.setContentHandler(th);
+ reader.parse(new InputSource(Bug5072946.class.getResourceAsStream("Bug5072946.xml")));
+
+ Assert.assertNotNull(r.getNode());
+ }
+
+ @Test
+ public void test3() throws Exception {
+ SAXTransformerFactory sf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
+ Transformer t = sf.newTransformer();
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Document dom = parser.parse(Bug5072946.class.getResourceAsStream("Bug5072946.xml"));
+
+ DOMResult r = new DOMResult();
+
+ t.transform(new DOMSource(dom), r);
+ Assert.assertNotNull(r.getNode());
+
+ Node n = r.getNode().getFirstChild();
+ r.setNode(n);
+ t.transform(new DOMSource(dom), r);
+ Assert.assertNotNull(r.getNode());
+ Assert.assertSame(r.getNode(), n);
+
+ r.setNextSibling(r.getNode().getFirstChild());
+ t.transform(new DOMSource(dom), r);
+ Assert.assertNotNull(r.getNode());
+ Assert.assertSame(r.getNode(), n);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xml
new file mode 100644
index 00000000000..fe6ba3f75f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xsd
new file mode 100644
index 00000000000..fa9638b380f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug5072946.xsd
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6378043.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6378043.java
new file mode 100644
index 00000000000..6078724f89c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6378043.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6378043
+ * @summary Test XPath expression "child::" can be parsed.
+ */
+public class Bug6378043 {
+
+ static String SCHEMA_LANG = "http://www.w3.org/2001/XMLSchema";
+
+ @Test
+ public void testSelectorXPath() {
+ try {
+ Schema schema = SchemaFactory.newInstance(SCHEMA_LANG).newSchema(this.getClass().getResource("idI009.xsd"));
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.java
new file mode 100644
index 00000000000..ca24b94281f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.validation;
+
+import javax.xml.XMLConstants;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6449797
+ * @summary Test SchemaFactory can parse the specified attribute value with a specified namespace.
+ */
+public class Bug6449797 {
+
+ @Test
+ public void test() throws SAXException {
+ // this shouldn't fail
+ SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(getClass().getResource("Bug6449797.xsd"));
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.xsd
new file mode 100644
index 00000000000..73f653f9672
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6449797.xsd
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6457662.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6457662.java
new file mode 100644
index 00000000000..84bfa2681f3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6457662.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.StringReader;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6457662
+ * @summary Test a Validator checks sequence maxOccurs correctly when it validates document repeatedly.
+ */
+public class Bug6457662 {
+
+ public static final String xml = "" + "" + "CheetahTech"
+ + "CheetahView" + "" + "";
+ /** Schema */
+ public static final String schema = ""
+ + ""
+ + "" + "" + ""
+ + "" + "" + ""
+ + "" + ""
+ + "" + ""
+ + "";
+ /** Schema factory */
+ private static final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ @Test
+ public void test() {
+ try {
+ final Schema sc = factory.newSchema(writeSchema());
+ final Validator validator = sc.newValidator();
+ validator.validate(new StreamSource(new StringReader(xml)));
+ validator.validate(new StreamSource(new StringReader(xml)));
+ validator.validate(new StreamSource(new StringReader(xml)));
+ validator.validate(new StreamSource(new StringReader(xml)));
+ } catch (Throwable ex) {
+ Assert.fail("Exception: " + ex.getMessage());
+ }
+ }
+
+ private File writeSchema() throws IOException {
+ final File rtn = File.createTempFile("scheam", "xsd");
+ final OutputStream out = new FileOutputStream(rtn);
+ final OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8");
+ writer.write(schema);
+ writer.close();
+ out.close();
+ return rtn;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xml
new file mode 100644
index 00000000000..2d42d364da4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+ Narayanan Jayaratchagan
+
+
+
+
+
+ Daniel Steinberg
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xsd
new file mode 100644
index 00000000000..194829f6d26
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424.xsd
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424Test.java
new file mode 100644
index 00000000000..76cf2a30699
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6467424Test.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6467424
+ * @summary Test Validator augments the default delement value if feature element-default is on.
+ */
+public class Bug6467424Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ // System.setSecurityManager(new SecurityManager());
+ try {
+ SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ File schemaLocation = new File(getClass().getResource("Bug6467424.xsd").getFile());
+ Schema schema = factory.newSchema(schemaLocation);
+ Validator validator = schema.newValidator();
+
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(true); // never forget this
+ DocumentBuilder builder = domFactory.newDocumentBuilder();
+ Document doc = builder.parse(new File(getClass().getResource("Bug6467424.xml").getFile()));
+
+ DOMSource source = new DOMSource(doc);
+ DOMResult result = new DOMResult();
+
+ validator.validate(source, result);
+ Document augmented = (Document) result.getNode();
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+
+ Transformer transformer = tFactory.newTransformer();
+
+ DOMSource domSource = new DOMSource(augmented);
+ StringWriter sw = new StringWriter();
+ // StreamResult streamResult = new StreamResult(System.out);
+ StreamResult streamResult = new StreamResult(sw);
+ transformer.transform(domSource, streamResult);
+ String s = sw.toString();
+ if (s.indexOf("Schema Validation") == -1) {
+ Assert.fail("Failed: result is expected to be augmented");
+ }
+ }
+
+ catch (TransformerConfigurationException e) {
+ // e.printStackTrace();
+ System.out.println(e.getMessage());
+ } catch (TransformerException e) {
+ System.out.println(e.getMessage());
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ } catch (ParserConfigurationException e) {
+ System.out.println(e.getMessage());
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+ /**
+ * this test is to make sure the element-default feature works for
+ * validation using DOM parser reference: parser feature:
+ * http://xerces.apache.org/xerces2-j/feature.html#validation
+ */
+ @Test
+ public void testDOMValidation() throws Exception {
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ // domFactory.setFeature("http://xml.org/sax/features/validation",
+ // true);
+ domFactory.setNamespaceAware(true); // never forget this
+ domFactory.setValidating(true);
+
+ domFactory.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ domFactory.setAttribute(SCHEMA_SOURCE, Bug6467424Test.class.getResource("Bug6467424.xsd").toExternalForm());
+
+ domFactory.setFeature("http://apache.org/xml/features/validation/schema", true);
+ domFactory.setFeature("http://apache.org/xml/features/validation/schema/element-default", true);
+ DocumentBuilder builder = domFactory.newDocumentBuilder();
+ Document doc = builder.parse(new File(getClass().getResource("Bug6467424.xml").getFile()));
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+
+ Transformer transformer = tFactory.newTransformer();
+ DOMSource domSource = new DOMSource(doc);
+ StringWriter sw = new StringWriter();
+ // StreamResult streamResult = new StreamResult(System.out);
+ StreamResult streamResult = new StreamResult(sw);
+ transformer.transform(domSource, streamResult);
+ String s = sw.toString();
+ if (s.indexOf("Schema Validation") == -1) {
+ Assert.fail("Failed: result is expected to be augmented");
+ }
+
+ }
+
+ catch (TransformerConfigurationException e) {
+ System.out.println(e.getMessage());
+ } catch (TransformerException e) {
+ System.out.println(e.getMessage());
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ } catch (ParserConfigurationException e) {
+ System.out.println(e.getMessage());
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testDOMValidation1() throws Exception {
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ // domFactory.setFeature("http://xml.org/sax/features/validation",
+ // true);
+ domFactory.setNamespaceAware(true); // never forget this
+ domFactory.setValidating(true);
+
+ domFactory.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ domFactory.setAttribute(SCHEMA_SOURCE, Bug6467424Test.class.getResource("Bug6467424.xsd").toExternalForm());
+
+ domFactory.setFeature("http://apache.org/xml/features/validation/schema", true);
+ domFactory.setFeature("http://apache.org/xml/features/validation/schema/element-default", false);
+ DocumentBuilder builder = domFactory.newDocumentBuilder();
+ Document doc = builder.parse(new File(getClass().getResource("Bug6467424.xml").getFile()));
+
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+
+ Transformer transformer = tFactory.newTransformer();
+ DOMSource domSource = new DOMSource(doc);
+ StringWriter sw = new StringWriter();
+ // StreamResult streamResult = new StreamResult(System.out);
+ StreamResult streamResult = new StreamResult(sw);
+ transformer.transform(domSource, streamResult);
+ String s = sw.toString();
+ if (s.indexOf("Schema Validation") > 0) {
+ Assert.fail("Failed: result is not expected to be augmented");
+ }
+
+ }
+
+ catch (TransformerConfigurationException e) {
+ System.out.println(e.getMessage());
+ } catch (TransformerException e) {
+ System.out.println(e.getMessage());
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ } catch (ParserConfigurationException e) {
+ System.out.println(e.getMessage());
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6483188.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6483188.java
new file mode 100644
index 00000000000..848a545bec8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6483188.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.net.URL;
+
+import javax.xml.XMLConstants;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6483188
+ * @summary Test Schema Validator can handle element with having large maxOccurs, but doesn't accept sequence with having large maxOccurs in FEATURE_SECURE_PROCESSING mode.
+ */
+public class Bug6483188 {
+ static boolean _isSecureMode = false;
+ static {
+ if (System.getSecurityManager() != null) {
+ _isSecureMode = true;
+ System.out.println("Security Manager is present");
+ } else {
+ System.out.println("Security Manager is NOT present");
+ }
+ }
+
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ @Test
+ public void testLargeElementNoSecurity() {
+ if (_isSecureMode)
+ return; // jaxp secure feature can not be turned off when security
+ // manager is present
+ try {
+ sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.FALSE);
+ URL url = getClass().getResource("test-element.xsd");
+ Schema s = sf.newSchema(url);
+ Validator v = s.newValidator();
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testLargeElementWithSecurity() {
+ try {
+ sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
+ URL url = getClass().getResource("test-element.xsd");
+ Schema s = sf.newSchema(url);
+ Validator v = s.newValidator();
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testLargeSequenceWithSecurity() {
+ try {
+ sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
+ URL url = getClass().getResource("test-sequence.xsd");
+ Schema s = sf.newSchema(url);
+ Validator v = s.newValidator();
+ Assert.fail("Schema was accepted even with secure processing enabled.");
+ } catch (SAXParseException e) {
+ // falls through - exception expected
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.java
new file mode 100644
index 00000000000..5034d3d29f6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 6493687
+ * @summary Test validator.validate(new DOMSource(node)) without any exception.
+ */
+public class Bug6493687 {
+
+ @Test
+ public void test() throws Exception {
+ System.out.println("Got here");
+ Document doc = new XMLDocBuilder("Bug6493687.xml", "UTF-8", "Bug6493687.xsd").getDocument();
+ System.out.println("Got here2");
+ System.out.println(doc);
+ System.out.println(doc.getDocumentElement().getNodeName());
+ System.out.println("Got here3");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xml
new file mode 100644
index 00000000000..2b5d6e07758
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xsd
new file mode 100644
index 00000000000..1907e8a8648
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6493687.xsd
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6509668.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6509668.java
new file mode 100644
index 00000000000..094c8a6eac9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6509668.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.TypeInfoProvider;
+import javax.xml.validation.ValidatorHandler;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.TypeInfo;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6509668
+ * @summary Test TypeInfoProvider.getElementTypeInfo() for union type when startElement and endElement.
+ */
+public class Bug6509668 {
+
+ public static final String XSD = "\n" + "\n"
+ + " \n" + " \n" + " \n"
+ + " \n" + "\n";
+
+ public static final String XML = "\n" + "abc\n";
+
+ private ValidatorHandler createValidatorHandler(String xsd) throws SAXException {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xsd.getBytes()));
+ StreamSource xsdSource = new StreamSource(reader);
+
+ Schema schema = schemaFactory.newSchema(xsdSource);
+ return schema.newValidatorHandler();
+ }
+
+ private XMLReader createXMLReader() throws ParserConfigurationException, SAXException {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ if (!parserFactory.isNamespaceAware()) {
+ parserFactory.setNamespaceAware(true);
+ }
+
+ return parserFactory.newSAXParser().getXMLReader();
+ }
+
+ private void parse(XMLReader xmlReader, String xml) throws SAXException, IOException {
+ InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xml.getBytes()));
+ InputSource inSource = new InputSource(reader);
+
+ xmlReader.parse(inSource);
+ }
+
+ @Test
+ public void testGetElementTypeInfo() throws ParserConfigurationException, SAXException, IOException {
+ XMLReader xmlReader;
+ xmlReader = createXMLReader();
+
+ final ValidatorHandler validatorHandler;
+ validatorHandler = createValidatorHandler(XSD);
+
+ xmlReader.setContentHandler(validatorHandler);
+
+ DefaultHandler handler = new DefaultHandler() {
+ public void startElement(String uri, String localName, String qName, Attributes attr) throws SAXException {
+ TypeInfoProvider infoProvider = null;
+ synchronized (validatorHandler) {
+ infoProvider = validatorHandler.getTypeInfoProvider();
+ }
+ if (infoProvider == null) {
+ throw new SAXException("Can't obtain TypeInfoProvider object.");
+ }
+
+ try {
+ TypeInfo typeInfo = infoProvider.getElementTypeInfo();
+ Assert.assertEquals(typeInfo.getTypeName(), "intOrString");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ throw new SAXException("Unexpected IllegalStateException was thrown.");
+ }
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ TypeInfoProvider infoProvider = null;
+ synchronized (validatorHandler) {
+ infoProvider = validatorHandler.getTypeInfoProvider();
+ }
+ if (infoProvider == null) {
+ throw new SAXException("Can't obtain TypeInfoProvider object.");
+ }
+
+ try {
+ TypeInfo typeInfo = infoProvider.getElementTypeInfo();
+ Assert.assertEquals(typeInfo.getTypeName(), "string");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ throw new SAXException("Unexpected IllegalStateException was thrown.");
+ }
+ }
+ };
+ validatorHandler.setContentHandler(handler);
+
+ parse(xmlReader, XML);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.java
new file mode 100644
index 00000000000..dfbf550e560
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6526547
+ * @summary Test document parsed without setting NamespaceAware can be validated with a Schema.
+ */
+public class Bug6526547 {
+
+ @Test
+ public void test() {
+ try {
+ // parse an XML document into a DOM tree
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder parser = dbf.newDocumentBuilder();
+ Assert.assertFalse(parser.isNamespaceAware());
+ Document document = parser.parse(getClass().getResourceAsStream("Bug6526547.xml"));
+
+ // create a SchemaFactory capable of understanding WXS schemas
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ // load a WXS schema, represented by a Schema instance
+ Source schemaFile = new StreamSource(getClass().getResourceAsStream("Bug6526547.xsd"));
+ Schema schema = factory.newSchema(schemaFile);
+
+ // create a Validator instance, which can be used to validate an
+ // instance document
+ Validator validator = schema.newValidator();
+
+ // validate the DOM tree
+ try {
+ validator.validate(new DOMSource(document));
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail("Document is reported as invalid but it is not!");
+ }
+ } catch (Exception e) {
+ Assert.fail("Unable to configure validator");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xml
new file mode 100644
index 00000000000..fe6ba3f75f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xsd
new file mode 100644
index 00000000000..fa9638b380f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6526547.xsd
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6531160.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6531160.java
new file mode 100644
index 00000000000..7c682dbd4fb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6531160.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.StringReader;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6531160
+ * @summary Test document generated by newDocument() can be validated with a Schema.
+ */
+public class Bug6531160 {
+
+ private static final String XSD = "\n" + " \n"
+ + "";
+
+ @Test
+ public void testDOMLevel1Validation() throws Exception {
+ SchemaFactory fact = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = fact.newSchema(new StreamSource(new StringReader(XSD)));
+ DocumentBuilderFactory docfact = DocumentBuilderFactory.newInstance();
+ docfact.setNamespaceAware(true);
+
+ Document doc = docfact.newDocumentBuilder().newDocument();
+ doc.appendChild(doc.createElement("root"));
+
+ try {
+ schema.newValidator().validate(new DOMSource(doc));
+ } catch (SAXParseException e) {
+ Assert.fail("Validation failed: " + e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xml
new file mode 100644
index 00000000000..2bb4ff1e66b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xml
@@ -0,0 +1,6 @@
+
+
+
+ commentZZZZZZZZZZZZZZZZZZ
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xsd
new file mode 100644
index 00000000000..b8e96c44372
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843.xsd
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843Test.java
new file mode 100644
index 00000000000..fde9fb2e420
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6695843Test.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6695843
+ * @summary Test Validator should report accurate element type if there is a violation on a complexType with simpleContent that extends a base complexType.
+ */
+public class Bug6695843Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void testValidateComplexTypeWithSimpleContent() throws IOException, ParserConfigurationException, SAXException {
+ try {
+ DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
+ dFactory.setNamespaceAware(true);
+
+ DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
+ Document document = dBuilder.parse(getClass().getResourceAsStream("Bug6695843.xsd"));
+ DOMSource domSource = new DOMSource(document);
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(domSource);
+
+ String xmlFileName = "Bug6695843.xml";
+ Document document1 = dBuilder.parse(getClass().getResourceAsStream(xmlFileName));
+ DOMSource domSource1 = new DOMSource(document1);
+
+ Validator validator = schema.newValidator();
+ validator.validate(domSource1);
+ } catch (Exception e) {
+ String msg = e.getMessage();
+ System.out.println(e.getMessage());
+ if (msg.indexOf("maxLength '20' for type 'null'") > 0) {
+ Assert.fail("vague error message");
+ }
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084.xsd
new file mode 100644
index 00000000000..1fbb8726d6b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084.xsd
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_1.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_1.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_1.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_10.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_10.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_10.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_11.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_11.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_11.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_12.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_12.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_12.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_13.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_13.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_13.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_14.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_14.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_14.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_15.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_15.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_15.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_16.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_16.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_16.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_17.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_17.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_17.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_18.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_18.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_18.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_19.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_19.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_19.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_2.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_2.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_2.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_20.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_20.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_20.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_21.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_21.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_21.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_22.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_22.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_22.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_23.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_23.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_23.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_24.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_24.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_24.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_25.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_25.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_25.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_3.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_3.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_3.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_4.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_4.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_4.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_5.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_5.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_5.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_6.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_6.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_6.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_7.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_7.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_7.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_8.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_8.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_8.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_9.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_9.xml
new file mode 100644
index 00000000000..aaef453696f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084In/Bug6773084_9.xml
@@ -0,0 +1,78 @@
+
+
+
+ b972115d-829e-43ff-aebb-c7157ef25c71
+ 01AP
+ A9901017
+ A0500823
+ 221
+
+
+ 89
+ 01AP
+ 2008
+ A
+ 68
+ KJ091
+ 5000
+
+
+ 97
+
+
+
+
+ LL091
+ 68700
+
+
+ 98
+
+
+
+
+ HH098
+ 8000
+
+
+ 96
+
+
+
+
+ PO091
+ 7500
+
+
+ 92
+
+
+
+
+ 098
+ 14000
+
+
+
+
+ 21
+ EF01
+ 26800
+
+
+ 22
+ G
+ 15000
+
+
+ 20
+ HH
+ 9810
+
+
+ 20
+ DEE
+ 51590
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084Test.java
new file mode 100644
index 00000000000..41103d20b13
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6773084Test.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6773084
+ * @summary Test Schema object is thread safe.
+ */
+public class Bug6773084Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ private static final int NTHREADS = 25;
+ private static final ExecutorService EXEC = Executors.newCachedThreadPool();
+
+ private static final CyclicBarrier BARRIER = new CyclicBarrier(NTHREADS);
+
+ public static final String IN_FOLDER = Bug6773084Test.class.getResource("Bug6773084In").getPath();
+ public static final String XSD_PATH = Bug6773084Test.class.getResource("Bug6773084.xsd").getPath();
+
+ private static Schema schema;
+
+ @BeforeClass
+ public void setup(){
+ policy.PolicyUtil.changePolicy(getClass().getResource("6773084.policy").getFile());
+ }
+
+ @Test
+ public void test() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Source schemaFile = new StreamSource(XSD_PATH);
+ try {
+ schema = factory.newSchema(schemaFile);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ File incoming = new File(IN_FOLDER);
+ File[] files = incoming.listFiles(new FileFilter() {
+ public boolean accept(File file) {
+ return file.isFile() && file.getName().endsWith(".xml");
+ }
+ });
+
+ for (int i = 0; i < files.length; i++) {
+ EXEC.execute(new XMLValiddator(files[i], i));
+ }
+ EXEC.shutdown();
+
+ }
+
+ private static class XMLValiddator implements Runnable {
+
+ private File file;
+ private int index;
+
+ public XMLValiddator(File file, int index) {
+ this.file = file;
+ this.index = index;
+ }
+
+ public void run() {
+
+ try {
+ System.out.printf("Waiting for barrier: %s%n", index);
+ BARRIER.await();
+ System.out.println("Validating....");
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document document = builder.parse(file);
+
+ Validator validator = schema.newValidator();
+ validator.setErrorHandler(new ErrorHandlerImpl());
+ validator.validate(new DOMSource(document));
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail("Test failed.");
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (BrokenBarrierException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+ private static class ErrorHandlerImpl implements ErrorHandler {
+
+ public void warning(SAXParseException exception) throws SAXException {
+ System.out
+ .printf("**Parsing Warning. Line: %s URI: %s Message: %s%n", exception.getLineNumber(), exception.getSystemId(), exception.getMessage());
+ }
+
+ public void error(SAXParseException exception) throws SAXException {
+ String msg = String.format("**Parsing Error. Line: %s URI: %s Message: %s%n", exception.getLineNumber(), exception.getSystemId(),
+ exception.getMessage());
+ System.out.println(msg);
+ throw new SAXException(msg);
+ }
+
+ public void fatalError(SAXParseException exception) throws SAXException {
+ String msg = String.format("**Parsing Fatal Error. Line: %s URI: %s Message: %s%n", exception.getLineNumber(), exception.getSystemId(),
+ exception.getMessage());
+ System.out.println(msg);
+ throw new SAXException(msg);
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6859210.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6859210.java
new file mode 100644
index 00000000000..322a7dc4fa2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6859210.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6859210
+ * @summary Test Schema Validator can parse xml when maxOccurs is large.
+ */
+public class Bug6859210 {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public Bug6859210() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("CREMAS01.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testGeneratedSample() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("CREMAS01.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6925531Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6925531Test.java
new file mode 100644
index 00000000000..03b2efd3a53
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6925531Test.java
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.AllPermission;
+import java.security.Permission;
+import java.security.Permissions;
+import java.security.PrivilegedAction;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+
+/*
+ * @bug 6925531
+ * @summary Test Validator can validate SAXSource when SecurityManager is set or FEATURE_SECURE_PROCESSING is on.
+ */
+public class Bug6925531Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+ String xsd = "\n" + "\n" + " \n"
+ + "\n";
+
+ String xml = "\n" + "\n" + " abc\n" + "\n";
+
+ StreamSource xsdSource;
+ SAXSource xmlSource;
+
+ public void init() {
+ InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xsd.getBytes()));
+ xsdSource = new StreamSource(reader);
+ reader = new InputStreamReader(new ByteArrayInputStream(xml.getBytes()));
+ InputSource inSource = new InputSource(reader);
+ xmlSource = new SAXSource(inSource);
+ }
+
+ /**
+ * when security manager is present, secure feature is on automatically
+ */
+ @Test
+ public void test_SM() {
+ init();
+ Permissions granted = new java.security.Permissions();
+ granted.add(new AllPermission());
+
+ System.setSecurityManager(new MySM(granted));
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ Schema schema = null;
+ try {
+ schema = schemaFactory.newSchema(xsdSource);
+ } catch (SAXException e) {
+ Assert.fail(e.toString());
+ }
+
+ Validator validator = schema.newValidator();
+
+ try {
+ validator.validate(xmlSource, null);
+ } catch (SAXException e) {
+ Assert.fail(e.toString());
+ } catch (IOException e) {
+ Assert.fail(e.toString());
+ } finally {
+ System.setSecurityManager(null);
+ }
+
+ System.out.println("OK");
+ }
+
+ /**
+ * set secure feature on SchemaFactory
+ */
+ @Test
+ public void test_SF() {
+ init();
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ System.setSecurityManager(null);
+ return null; // nothing to return
+ }
+ });
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ try {
+ schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ } catch (SAXNotRecognizedException ex) {
+ System.out.println(ex.getMessage());
+ } catch (SAXNotSupportedException ex) {
+ System.out.println(ex.getMessage());
+ }
+
+ Schema schema = null;
+ try {
+ schema = schemaFactory.newSchema(xsdSource);
+ } catch (SAXException e) {
+ Assert.fail(e.toString());
+ }
+
+ Validator validator = schema.newValidator();
+
+ try {
+ validator.validate(xmlSource, null);
+ } catch (SAXException e) {
+ Assert.fail(e.toString());
+ } catch (IOException e) {
+ Assert.fail(e.toString());
+ }
+ System.out.println("OK");
+ }
+
+ /**
+ * set secure feature on the Validator
+ */
+ @Test
+ public void test_Val() {
+ init();
+ System.setSecurityManager(null);
+ SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+ Schema schema = null;
+ try {
+ schema = schemaFactory.newSchema(xsdSource);
+ } catch (SAXException e) {
+ Assert.fail(e.toString());
+ }
+
+ Validator validator = schema.newValidator();
+ try {
+ validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ } catch (SAXNotRecognizedException ex) {
+ System.out.println(ex.getMessage());
+ } catch (SAXNotSupportedException ex) {
+ System.out.println(ex.getMessage());
+ }
+
+ try {
+ validator.validate(xmlSource, null);
+ } catch (SAXException e) {
+ Assert.fail(e.toString());
+ } catch (IOException e) {
+ Assert.fail(e.toString());
+ }
+ System.out.println("OK");
+ }
+
+ class MySM extends SecurityManager {
+ Permissions granted;
+
+ public MySM(Permissions perms) {
+ granted = perms;
+ }
+
+ /**
+ * The central point in checking permissions. Overridden from
+ * java.lang.SecurityManager
+ *
+ * @param perm The permission requested.
+ */
+ @Override
+ public void checkPermission(Permission perm) {
+ if (granted.implies(perm)) {
+ return;
+ }
+ super.checkPermission(perm);
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312.xml
new file mode 100644
index 00000000000..ffe59835074
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312.xml
@@ -0,0 +1,4 @@
+
+text
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312Test.java
new file mode 100644
index 00000000000..b93c1ac8f62
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6946312Test.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+/*
+ * @bug 6946312
+ * @summary Test XML parser shall callback to ContentHandler when receiving characters data.
+ */
+public class Bug6946312Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+ String xmlSchema = "\n" + "\n" + "\n"
+ + "\n" + "\n" + "\n" + "\n" + "\n"
+ + "";
+
+ boolean charEvent = false;
+
+ @Test
+ public void test() throws SAXException, ParserConfigurationException, IOException {
+ Schema schema = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema(new StreamSource(new StringReader(xmlSchema)));
+
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setNamespaceAware(true);
+ saxParserFactory.setSchema(schema);
+ // saxParserFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace",
+ // true);
+
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+
+ XMLReader xmlReader = saxParser.getXMLReader();
+
+ xmlReader.setContentHandler(new MyContentHandler());
+
+ // InputStream input =
+ // ClassLoader.getSystemClassLoader().getResourceAsStream("test/test.xml");
+
+ InputStream input = getClass().getResourceAsStream("Bug6946312.xml");
+ System.out.println("Parse InputStream:");
+ xmlReader.parse(new InputSource(input));
+ if (!charEvent) {
+ Assert.fail("missing character event");
+ }
+ }
+
+ public class MyContentHandler implements ContentHandler {
+ public void characters(char[] ch, int start, int length) {
+ charEvent = true;
+ System.out.println("Characters called: " + new String(ch, start, length));
+ }
+
+ public void endDocument() throws SAXException {
+ }
+
+ public void endElement(String arg0, String arg1, String arg2) throws SAXException {
+ }
+
+ public void endPrefixMapping(String arg0) throws SAXException {
+ }
+
+ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+ System.out.println("ignorableWhitespace called: " + new String(ch, start, length));
+ }
+
+ public void processingInstruction(String arg0, String arg1) throws SAXException {
+ }
+
+ public void setDocumentLocator(Locator arg0) {
+ }
+
+ public void skippedEntity(String arg0) throws SAXException {
+ }
+
+ public void startDocument() throws SAXException {
+ }
+
+ public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException {
+ }
+
+ public void startPrefixMapping(String arg0, String arg1) throws SAXException {
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xml
new file mode 100644
index 00000000000..a1e5e69cbe0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xml
@@ -0,0 +1,4 @@
+
+
+ 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xsd
new file mode 100644
index 00000000000..596513f3471
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738_Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738_Test.java
new file mode 100644
index 00000000000..da5bb1a4cab
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Bug6954738_Test.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6954738
+ * @summary Test Validator can process a XML document containing an element with 8000 characters.
+ */
+public class Bug6954738_Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ //if StackOverflowError is thrown, it shall escape from both the ErrorHandler and catch block
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6954738_Test.class.getResourceAsStream("Bug6954738.xsd")));
+ Validator validator = schema.newValidator();
+ validator.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+
+ public void fatalError(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+
+ public void warning(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+ });
+ validator.validate(new StreamSource(Bug6954738_Test.class.getResourceAsStream("Bug6954738.xml")));
+
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6708840Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6708840Test.java
new file mode 100644
index 00000000000..932c8fb43b8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6708840Test.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.FileWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stax.StAXSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6708840
+ * @summary Test Validator can process StAXSource.
+ */
+public class CR6708840Test {
+
+ @Test
+ public final void testStream() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schemaGrammar = schemaFactory.newSchema(new File(getClass().getResource("gMonths.xsd").getFile()));
+
+ Validator schemaValidator = schemaGrammar.newValidator();
+ Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(CR6708840Test.class.getResource("gMonths.xml").toURI()));
+ schemaValidator.validate(xmlSource);
+
+ } catch (NullPointerException ne) {
+ Assert.fail("NullPointerException when result is not specified.");
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * refer to http://forums.java.net/jive/thread.jspa?threadID=41626&tstart=0
+ */
+ @Test
+ public final void testStAX() {
+ try {
+ XMLInputFactory xmlif = XMLInputFactory.newInstance();
+
+ // XMLStreamReader staxReader =
+ // xmlif.createXMLStreamReader((Source)new
+ // StreamSource(getClass().getResource("Forum31576.xml").getFile()));
+ XMLStreamReader staxReader = xmlif.createXMLStreamReader(this.getClass().getResourceAsStream("gMonths.xml"));
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schemaGrammar = schemaFactory.newSchema(new File(getClass().getResource("gMonths.xsd").getFile()));
+
+ Validator schemaValidator = schemaGrammar.newValidator();
+
+ Source staxSrc = new StAXSource(staxReader);
+ schemaValidator.validate(staxSrc);
+
+ while (staxReader.hasNext()) {
+ int eventType = staxReader.next();
+ System.out.println("Event of type: " + eventType);
+ }
+ } catch (NullPointerException ne) {
+ Assert.fail("NullPointerException when result is not specified.");
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * workaround before the fix: provide a result
+ */
+ @Test
+ public final void testStAXWResult() {
+ try {
+ XMLInputFactory xmlif = XMLInputFactory.newInstance();
+
+ // XMLStreamReader staxReader =
+ // xmlif.createXMLStreamReader((Source)new
+ // StreamSource(getClass().getResource("Forum31576.xml").getFile()));
+ XMLStreamReader staxReader = xmlif.createXMLStreamReader(this.getClass().getResourceAsStream("gMonths.xml"));
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schemaGrammar = schemaFactory.newSchema(new File(getClass().getResource("gMonths.xsd").getFile()));
+
+ Validator schemaValidator = schemaGrammar.newValidator();
+
+ Source staxSrc = new StAXSource(staxReader);
+ File resultFile = new File("gMonths.result.xml");
+ if (resultFile.exists()) {
+ resultFile.delete();
+ }
+
+ Result xmlResult = new javax.xml.transform.stax.StAXResult(XMLOutputFactory.newInstance().createXMLStreamWriter(new FileWriter(resultFile)));
+ schemaValidator.validate(staxSrc, xmlResult);
+
+ while (staxReader.hasNext()) {
+ int eventType = staxReader.next();
+ System.out.println("Event of type: " + eventType);
+ }
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.java
new file mode 100644
index 00000000000..7ef779eb0a9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import org.w3c.dom.Document;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @bug 6740048
+ * @summary Test DocumentBuilder can be reused when the DocumentBuilderFactory sets schema.
+ */
+public class CR6740048 {
+ private static final String TAG_INFO = "containerInfo";
+ private static final String SCHEMA_LANGUAGE_URL = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ private static final String SCHEMA_SOURCE_URL = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+ private static final String XML_SCHEMA_URL = "http://www.w3.org/2001/XMLSchema";
+
+ @Test
+ public final void testReusingDocumentBuilder() {
+
+ try {
+ //ClassLoader loader = CR6740048.class.getClassLoader();
+
+ // Object xsd = loader.getResourceAsStream("CR6740048.xsd");
+ InputStream xsd = this.getClass().getResourceAsStream("CR6740048.xsd");
+ // create document builder
+ DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
+ docBuilderFactory.setNamespaceAware(true);
+
+ if (xsd != null) {
+ docBuilderFactory.setValidating(true);
+ docBuilderFactory.setAttribute(SCHEMA_LANGUAGE_URL, XML_SCHEMA_URL);
+ docBuilderFactory.setAttribute(SCHEMA_SOURCE_URL, xsd);
+ }
+
+ final DocumentBuilder documentBuilder = docBuilderFactory.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+
+ public void error(SAXParseException exception) throws SAXException {
+ throw exception;
+ }
+
+ public void fatalError(SAXParseException exception) throws SAXException {
+ throw exception;
+ }
+
+ public void warning(SAXParseException exception) throws SAXException {
+ throw exception;
+ }
+ });
+
+ // TODO set the system properties in order to match the ones from
+ // the server environment
+ /**
+ * Properties props = new Properties();
+ * props.load(loader.getResourceAsStream("sysprops.properties"));
+ * System.setProperties(props);
+ */
+
+ // now parse the document
+ // InputStream is = loader.getResourceAsStream("CR6740048.xml");
+ InputStream is = this.getClass().getResourceAsStream("CR6740048.xml");
+ try {
+ Document doc = documentBuilder.parse(is);
+ } catch (Exception se) {
+
+ se.printStackTrace();
+ Assert.fail(se.getMessage());
+
+ } finally {
+ is.close();
+ }
+
+ // now use the parser object as second time
+ // is = loader.getResourceAsStream("CR6740048.xml");
+ is = this.getClass().getResourceAsStream("CR6740048.xml");
+ try {
+ Document doc = documentBuilder.parse(is);
+ } catch (Exception se) {
+
+ se.printStackTrace();
+ Assert.fail(se.getMessage());
+
+ } finally {
+ is.close();
+ }
+
+ System.err.println("Parse successful");
+
+ is.close();
+ } catch (ParserConfigurationException pce) {
+ pce.printStackTrace();
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xml
new file mode 100644
index 00000000000..5ac7d14055b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xml
@@ -0,0 +1,3 @@
+
+falseresource80.stoppedJ2EEtruetruefalse
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xsd
new file mode 100644
index 00000000000..426858ff03d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CR6740048.xsd
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xml
new file mode 100644
index 00000000000..5a88686f115
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xml
@@ -0,0 +1,1138 @@
+
+
+
+
+
+
+
+ EDI_DC40
+
+
+
+
+ 1
+
+
+
+ CREMAS01
+
+ CREMAS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xsd
new file mode 100644
index 00000000000..18d63291d62
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/CREMAS01.xsd
@@ -0,0 +1,3541 @@
+
+
+
+
+
+
+
+
+
+
+
+ Segment for general vendor data
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Title
+
+
+
+
+
+
+
+
+
+
+
+ Train station
+
+
+
+
+
+
+
+
+
+
+
+ International location number (part 1)
+
+
+
+
+
+
+
+
+
+
+
+ International location number (part 2)
+
+
+
+
+
+
+
+
+
+
+
+ Authorization group
+
+
+
+
+
+
+
+
+
+
+
+ Industry key
+
+
+
+
+
+
+
+
+
+
+
+ Check digit for the international location number
+
+
+
+
+
+
+
+
+
+
+
+ Number of data communication line
+
+
+
+
+
+
+
+
+
+
+
+ Indicator 'report to Central Bank' for data medium exchange
+
+
+
+
+
+
+
+
+
+
+
+ Instruction key for data medium exchange
+
+
+
+
+
+
+
+
+
+
+
+ Date on which the record was created
+
+
+
+
+
+
+
+
+
+
+
+ Name of person who created object
+
+
+
+
+
+
+
+
+
+
+
+ POR subscriber number
+
+
+
+
+
+
+
+
+
+
+
+ Group key
+
+
+
+
+
+
+
+
+
+
+
+ Vendor account group
+
+
+
+
+
+
+
+
+
+
+
+ Customer number
+
+
+
+
+
+
+
+
+
+
+
+ Country of company
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Central deletion flag for master record
+
+
+
+
+
+
+
+
+
+
+
+ Last name of employee
+
+
+
+
+
+
+
+
+
+
+
+ Last name of employee
+
+
+
+
+
+
+
+
+
+
+
+ Last name of employee
+
+
+
+
+
+
+
+
+
+
+
+ Last name of employee
+
+
+
+
+
+
+
+
+
+
+
+ City
+
+
+
+
+
+
+
+
+
+
+
+ District
+
+
+
+
+
+
+
+
+
+
+
+ Post office box
+
+
+
+
+
+
+
+
+
+
+
+ Postal code
+
+
+
+
+
+
+
+
+
+
+
+ Postal code
+
+
+
+
+
+
+
+
+
+
+
+ Region (State, Province, County)
+
+
+
+
+
+
+
+
+
+
+
+ Character field length = 10
+
+
+
+
+
+
+
+
+
+
+
+ Central posting block
+
+
+
+
+
+
+
+
+
+
+
+ Centrally imposed purchasing block
+
+
+
+
+
+
+
+
+
+
+
+ Language keys
+
+
+
+
+
+
+
+
+
+
+
+ Tax number 1
+
+
+
+
+
+
+
+
+
+
+
+ Tax number 2
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Business partner subject to equalization tax ?
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Business partner subject to tax on sales/purch. ?
+
+
+
+
+
+
+
+
+
+
+
+ Street and house number
+
+
+
+
+
+
+
+
+
+
+
+ Telebox number
+
+
+
+
+
+
+
+
+
+
+
+ First telephone number
+
+
+
+
+
+
+
+
+
+
+
+ Second telephone number
+
+
+
+
+
+
+
+
+
+
+
+ Fax number
+
+
+
+
+
+
+
+
+
+
+
+ Teletex number
+
+
+
+
+
+
+
+
+
+
+
+ Telex number
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Is the account a one-time account?
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Alternative payee in document allowed ?
+
+
+
+
+
+
+
+
+
+
+
+ Company ID of trading partner
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the master record with fiscal address
+
+
+
+
+
+
+
+
+
+
+
+ VAT registration number
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Business partner a sole proprietor ?
+
+
+
+
+
+
+
+
+
+
+
+ Functions that will be blocked
+
+
+
+
+
+
+
+
+
+
+
+ Address
+
+
+
+
+
+
+
+
+
+
+
+ Search string for matchcode usage
+
+
+
+
+
+
+
+
+
+
+
+ Search string for using matchcodes
+
+
+
+
+
+
+
+
+
+
+
+ Search string for matchcode usage
+
+
+
+
+
+
+
+
+
+
+
+ Place of birth of the person subject to withholding tax
+
+
+
+
+
+
+
+
+
+
+
+ Date of birth
+
+
+
+
+
+
+
+
+
+
+
+ Key for the sex of the person subject to withholding tax
+
+
+
+
+
+
+
+
+
+
+
+ Credit information number
+
+
+
+
+
+
+
+
+
+
+
+ Last review (external)
+
+
+
+
+
+
+
+
+
+
+
+ Vendor's QM system
+
+
+
+
+
+
+
+
+
+
+
+ Reference account group for one-time account (vendor)
+
+
+
+
+
+
+
+
+
+
+
+ PO box city
+
+
+
+
+
+
+
+
+
+
+
+ Plant
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: vendor sub-range relevant
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: plant level relevant
+
+
+
+
+
+
+
+
+
+
+
+ Factory calendar key
+
+
+
+
+
+
+
+
+
+
+
+ Status of data transfer into subsequent release
+
+
+
+
+
+
+
+
+
+
+
+ Jurisdiction for tax calculation - tax jurisdiction code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment for bank details of vendor SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Bank country key
+
+
+
+
+
+
+
+
+
+
+
+ Bank key
+
+
+
+
+
+
+
+
+
+
+
+ Bank account number
+
+
+
+
+
+
+
+
+
+
+
+ Bank control key
+
+
+
+
+
+
+
+
+
+
+
+ Partner bank type
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Is there collection authorization ?
+
+
+
+
+
+
+
+
+
+
+
+ Name of the bank
+
+
+
+
+
+
+
+
+
+
+
+ Region (no longer used as of release 3.0D!!!)
+
+
+
+
+
+
+
+
+
+
+
+ Street (no longer used as of release 3.0D!!!)
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+
+
+
+
+
+
+
+
+
+ SWIFT code for international payments
+
+
+
+
+
+
+
+
+
+
+
+ Bank group (bank network)
+
+
+
+
+
+
+
+
+
+
+
+ Checkbox
+
+
+
+
+
+
+
+
+
+
+
+ Bank number
+
+
+
+
+
+
+
+
+
+
+
+ Post office bank current account number
+
+
+
+
+
+
+
+
+
+
+
+ Reference specifications for bank details
+
+
+
+
+
+
+
+
+
+
+
+ Bank branch
+
+
+
+
+
+
+
+
+
+
+
+ Region (State, Province, County)
+
+
+
+
+
+
+
+
+
+
+
+ Street and house number
+
+
+
+
+
+
+
+
+
+
+
+ City
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reminder data for vendor SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Company code
+
+
+
+
+
+
+
+
+
+
+
+ Dunning area
+
+
+
+
+
+
+
+
+
+
+
+ Dunning procedure
+
+
+
+
+
+
+
+
+
+
+
+ Dunning block
+
+
+
+
+
+
+
+
+
+
+
+ Last dunned on
+
+
+
+
+
+
+
+
+
+
+
+ Character field of length 1
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the dunning recipient
+
+
+
+
+
+
+
+
+
+
+
+ Date of the legal dunning proceedings
+
+
+
+
+
+
+
+
+
+
+
+ Accounting clerk
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TABNAM
+
+
+
+
+
+
+ MANDT
+
+
+
+
+
+
+
+
+
+
+
+ DOCNUM
+
+
+
+
+
+
+
+
+
+
+
+ DOCREL
+
+
+
+
+
+
+
+
+
+
+
+ STATUS
+
+
+
+
+
+
+
+
+
+
+
+ DIRECT
+
+
+
+
+
+
+
+ Outbound
+
+
+
+
+
+
+ Inbound
+
+
+
+
+
+
+
+
+
+ OUTMOD
+
+
+
+
+
+
+
+
+
+
+
+ EXPRSS
+
+
+
+
+
+
+
+
+
+
+
+ TEST
+
+
+
+
+
+
+
+
+
+
+
+ IDOCTYP
+
+
+
+
+
+
+ CIMTYP
+
+
+
+
+
+
+
+
+
+
+
+ MESTYP
+
+
+
+
+
+
+ MESCOD
+
+
+
+
+
+
+
+
+
+
+
+ MESFCT
+
+
+
+
+
+
+
+
+
+
+
+ STD
+
+
+
+
+
+
+
+
+
+
+
+ STDVRS
+
+
+
+
+
+
+
+
+
+
+
+ STDMES
+
+
+
+
+
+
+
+
+
+
+
+ SNDPOR
+
+
+
+
+
+
+
+
+
+
+
+ SNDPRT
+
+
+
+
+
+
+
+
+
+
+
+ SNDPFC
+
+
+
+
+
+
+
+
+
+
+
+ SNDPRN
+
+
+
+
+
+
+
+
+
+
+
+ SNDSAD
+
+
+
+
+
+
+
+
+
+
+
+ SNDLAD
+
+
+
+
+
+
+
+
+
+
+
+ RCVPOR
+
+
+
+
+
+
+
+
+
+
+
+ RCVPRT
+
+
+
+
+
+
+
+
+
+
+
+ RCVPFC
+
+
+
+
+
+
+
+
+
+
+
+ RCVPRN
+
+
+
+
+
+
+
+
+
+
+
+ RCVSAD
+
+
+
+
+
+
+
+
+
+
+
+ RCVLAD
+
+
+
+
+
+
+
+
+
+
+
+ CREDAT
+
+
+
+
+
+
+
+
+
+
+
+ CRETIM
+
+
+
+
+
+
+
+
+
+
+
+ REFINT
+
+
+
+
+
+
+
+
+
+
+
+ REFGRP
+
+
+
+
+
+
+
+
+
+
+
+ REFMES
+
+
+
+
+
+
+
+
+
+
+
+ ARCKEY
+
+
+
+
+
+
+
+
+
+
+
+ SERIAL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment for EU tax numbers vendors
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Country key
+
+
+
+
+
+
+
+
+
+
+
+ VAT registration number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment for vendor sub-range identification SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Language keys
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Vendor sub-range
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment purchasing data for vendor MMS SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing organization
+
+
+
+
+
+
+
+
+
+
+
+ Vendor sub-range
+
+
+
+
+
+
+
+
+
+
+
+ Plant
+
+
+
+
+
+
+
+
+
+
+
+ Date on which the record was created
+
+
+
+
+
+
+
+
+
+
+
+ Name of person who created object
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing block at purchasing organization level
+
+
+
+
+
+
+
+
+
+
+
+ Deletion indicator
+
+
+
+
+
+
+
+
+
+
+
+ ABC indicator
+
+
+
+
+
+
+
+
+
+
+
+ Purchase order currency
+
+
+
+
+
+
+
+
+
+
+
+ Responsible salesperson at vendor's office
+
+
+
+
+
+
+
+
+
+
+
+ Vendor's telephone number
+
+
+
+
+
+
+
+
+
+
+
+ Minimum order value
+
+
+
+
+
+
+
+
+
+
+
+ Terms of payment key
+
+
+
+
+
+
+
+
+
+
+
+ Incoterms (part 1)
+
+
+
+
+
+
+
+
+
+
+
+ Incoterms (part 2)
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: GR-based invoice verification
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: acknowledgment required
+
+
+
+
+
+
+
+
+
+
+
+ Group for calculation schema (vendor)
+
+
+
+
+
+
+
+
+
+
+
+ Automatic generation of purchase order allowed
+
+
+
+
+
+
+
+
+
+
+
+ Mode of transport (when goods cross border)
+
+
+
+
+
+
+
+
+
+
+
+ Customs office
+
+
+
+
+
+
+
+
+
+
+
+ Pricing date control
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing group
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: vendor subject to subseq. settlement accounting
+
+
+
+
+
+
+
+
+
+
+
+ Comparison/agreement of business volumes necessary
+
+
+
+
+
+
+
+
+
+
+
+ Evaluated receipt settlement (ERS)
+
+
+
+
+
+
+
+
+
+
+
+ Planned delivery time in days
+
+
+
+
+
+
+
+
+
+
+
+ Planning calendar
+
+
+
+
+
+
+
+
+
+
+
+ Planning cycle
+
+
+
+
+
+
+
+
+
+
+
+ Delivery cycle
+
+
+
+
+
+
+
+
+
+
+
+ Purchase order entry: vendor
+
+
+
+
+
+
+
+
+
+
+
+ Price marking, vendor
+
+
+
+
+
+
+
+
+
+
+
+ Rack-jobbing: vendor
+
+
+
+
+
+
+
+
+
+
+
+ MRP controller
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment for company code data for vendors SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Company code
+
+
+
+
+
+
+
+
+
+
+
+ Date on which the record was created
+
+
+
+
+
+
+
+
+
+
+
+ Name of person who created object
+
+
+
+
+
+
+
+
+
+
+
+ Posting block for company code
+
+
+
+
+
+
+
+
+
+
+
+ Deletion flag for master record (company code level)
+
+
+
+
+
+
+
+
+
+
+
+ Key for sorting according to allocation numbers
+
+
+
+
+
+
+
+
+
+
+
+ Reconciliation account in general ledger
+
+
+
+
+
+
+
+
+
+
+
+ Authorization group
+
+
+
+
+
+
+
+
+
+
+
+ Interest calculation indicator
+
+
+
+
+
+
+
+
+
+
+
+ List of the payment methods to be considered
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Clearing between customer and vendor?
+
+
+
+
+
+
+
+
+
+
+
+ Block key for payment
+
+
+
+
+
+
+
+
+
+
+
+ Terms of payment key
+
+
+
+
+
+
+
+
+
+
+
+ Our account number at the customer or vendor
+
+
+
+
+
+
+
+
+
+
+
+ User at vendor
+
+
+
+
+
+
+
+
+
+
+
+ Memo
+
+
+
+
+
+
+
+
+
+
+
+ Planning group
+
+
+
+
+
+
+
+
+
+
+
+ Accounting clerk
+
+
+
+
+
+
+
+
+
+
+
+ Head office account number
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the alternative payee
+
+
+
+
+
+
+
+
+
+
+
+ Key date of the last interest calculation
+
+
+
+
+
+
+
+
+
+
+
+ Interest calculation frequency in months
+
+
+
+
+
+
+
+
+
+
+
+ Date of the last interest calculation run
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: local processing?
+
+
+
+
+
+
+
+
+
+
+
+ Bill of exchange limit (in local currency)
+
+
+
+
+
+
+
+
+
+
+
+ Probable time until check is paid
+
+
+
+
+
+
+
+
+
+
+
+ Check flag for double invoices or credit memos
+
+
+
+
+
+
+
+
+
+
+
+ Tolerance group for the business partner
+
+
+
+
+
+
+
+
+
+
+
+ Short key for a house bank
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: Pay all items separately ?
+
+
+
+
+
+
+
+
+
+
+
+ Certificate number of the withholding tax exemption
+
+
+
+
+
+
+
+
+
+
+
+ Validity date for withholding tax exemption certificate
+
+
+
+
+
+
+
+
+
+
+
+ Withholding tax code
+
+
+
+
+
+
+
+
+
+
+
+ Subsidy indicator for determining the reduction rates
+
+
+
+
+
+
+
+
+
+
+
+ Minority indicators
+
+
+
+
+
+
+
+
+
+
+
+ Previous master record number
+
+
+
+
+
+
+
+
+
+
+
+ Key for payment grouping
+
+
+
+
+
+
+
+
+
+
+
+ Key for dunning notice grouping
+
+
+
+
+
+
+
+
+
+
+
+ Payment method supplement
+
+
+
+
+
+
+
+
+
+
+
+ Vendor recipient type
+
+
+
+
+
+
+
+
+
+
+
+ Authority for exemption from withholding tax
+
+
+
+
+
+
+
+
+
+
+
+ Withholding tax country key
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: send payment advices by EDI
+
+
+
+
+
+
+
+
+
+
+
+ Release approval group
+
+
+
+
+
+
+
+
+
+
+
+ Accounting clerk's fax number at the customer/vendor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment for purchasing organization data vendor SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Vendor's account number
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing organization
+
+
+
+
+
+
+
+
+
+
+
+ Date on which the record was created
+
+
+
+
+
+
+
+
+
+
+
+ Name of person who created object
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing block at purchasing organization level
+
+
+
+
+
+
+
+
+
+
+
+ Delete flag for vendor at purchasing level
+
+
+
+
+
+
+
+
+
+
+
+ ABC indicator
+
+
+
+
+
+
+
+
+
+
+
+ Purchase order currency
+
+
+
+
+
+
+
+
+
+
+
+ Responsible salesperson at vendor's office
+
+
+
+
+
+
+
+
+
+
+
+ Vendor's telephone number
+
+
+
+
+
+
+
+
+
+
+
+ Minimum order value
+
+
+
+
+
+
+
+
+
+
+
+ Terms of payment key
+
+
+
+
+
+
+
+
+
+
+
+ Incoterms (part 1)
+
+
+
+
+
+
+
+
+
+
+
+ Incoterms (part 2)
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: GR-based invoice verification
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: acknowledgment required
+
+
+
+
+
+
+
+
+
+
+
+ Group for calculation schema (vendor)
+
+
+
+
+
+
+
+
+
+
+
+ Automatic generation of purchase order allowed
+
+
+
+
+
+
+
+
+
+
+
+ Mode of transport (when goods cross border)
+
+
+
+
+
+
+
+
+
+
+
+ Customs office
+
+
+
+
+
+
+
+
+
+
+
+ Pricing date control
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing group
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: vendor subject to subseq. settlement accounting
+
+
+
+
+
+
+
+
+
+
+
+ Comparison/agreement of business volumes necessary
+
+
+
+
+
+
+
+
+
+
+
+ Evaluated receipt settlement (ERS)
+
+
+
+
+
+
+
+
+
+
+
+ Planned delivery time in days
+
+
+
+
+
+
+
+
+
+
+
+ Planning calendar
+
+
+
+
+
+
+
+
+
+
+
+ Planning cycle
+
+
+
+
+
+
+
+
+
+
+
+ Delivery cycle
+
+
+
+
+
+
+
+
+
+
+
+ Purchase order entry: vendor
+
+
+
+
+
+
+
+
+
+
+
+ Price marking, vendor
+
+
+
+
+
+
+
+
+
+
+
+ Rack-jobbing: vendor
+
+
+
+
+
+
+
+
+
+
+
+ Indicator: index compilation for subseq. settlement active
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Segment for vendor sub-range MMS SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Vendor sub-range
+
+
+
+
+
+
+
+
+
+
+
+ Name of person who created object
+
+
+
+
+
+
+
+
+
+
+
+ Date on which the record was created
+
+
+
+
+
+
+
+
+
+
+
+ Language keys
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Vendor master data distribution ALE
+
+
+
+
+
+
+
+
+
+
+
+ Segment for addresses of vendors MMS SMD
+
+
+
+
+
+
+ Function
+
+
+
+
+
+
+
+
+
+
+
+ Account number of the vendor or creditor
+
+
+
+
+
+
+
+
+
+
+
+ Purchasing organization
+
+
+
+
+
+
+
+
+
+
+
+ Vendor sub-range
+
+
+
+
+
+
+
+
+
+
+
+ Plant
+
+
+
+
+
+
+
+
+
+
+
+ Partner function ID (e.g. SH for ship-to party)
+
+
+
+
+
+
+
+
+
+
+
+ Partner counter
+
+
+
+
+
+
+
+
+
+
+
+ Name of person who created object
+
+
+
+
+
+
+
+
+
+
+
+ Date on which the record was created
+
+
+
+
+
+
+
+
+
+
+
+ Reference to other vendor
+
+
+
+
+
+
+
+
+
+
+
+ Default partner
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ErrorHandlerImpl.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ErrorHandlerImpl.java
new file mode 100644
index 00000000000..6fbd8570d88
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ErrorHandlerImpl.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+public class ErrorHandlerImpl implements ErrorHandler {
+ /** Creates a new instance of ErrorHandlerImpl */
+ public ErrorHandlerImpl() {
+ }
+
+ public void error(SAXParseException sAXParseException) throws SAXException {
+ throw new SAXException(sAXParseException);
+ }
+
+ public void fatalError(SAXParseException sAXParseException) throws SAXException {
+ throw new SAXException(sAXParseException);
+ }
+
+ public void warning(SAXParseException sAXParseException) throws SAXException {
+ throw new SAXException(sAXParseException);
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xml
new file mode 100644
index 00000000000..fe4f3df7e3e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xsd
new file mode 100644
index 00000000000..279b01f7de5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682.xsd
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682Test.java
new file mode 100644
index 00000000000..9301f3bd6b8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/Issue682Test.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @summary Test comination of fields in , for https://issues.apache.org/jira/browse/XERCESJ-682.
+ */
+public class Issue682Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ File testFile = new File(getClass().getResource("Issue682.xsd").getFile());
+
+ @Test
+ public void test() {
+ try {
+ Schema schema = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema(new StreamSource(testFile));
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setNamespaceAware(true);
+ saxParserFactory.setSchema(schema);
+ // saxParserFactory.setFeature("http://java.sun.com/xml/schema/features/report-ignored-element-content-whitespace",
+ // true);
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+ xmlReader.setContentHandler(new DefaultHandler());
+ // InputStream input =
+ // ClassLoader.getSystemClassLoader().getResourceAsStream("test/test.xml");
+ InputStream input = getClass().getResourceAsStream("Issue682.xml");
+ System.out.println("Parse InputStream:");
+ xmlReader.parse(new InputSource(input));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.toString());
+ }
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30.java
new file mode 100644
index 00000000000..afde0f092a4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test maxOccurs validation.
+ */
+public class IssueTracker30 {
+
+ boolean errorFound;
+
+ @Test
+ public void testMaxOccursErrorNoOptimization() throws Exception {
+
+ // Parsing this document should result in an error
+ try {
+ if (!testMaxOccurs("IssueTracker30_occurs-error.xml", "IssueTracker30_occurs.xsd"))
+ Assert.fail("Expected validation error not reported");
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage(), ex);
+ }
+ }
+
+ @Test
+ public void testMaxOccursOKNoOptimization() throws Exception {
+
+ // Parsing this document should *not* result in an error
+ try {
+ if (testMaxOccurs("IssueTracker30_occurs-ok.xml", "IssueTracker30_occurs.xsd"))
+ Assert.fail("Unexpected validation error reported");
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage(), ex);
+ }
+ }
+
+ @Test
+ public void testMaxOccursErrorOptimization() throws Exception {
+
+ // Parsing this document should result in an error
+ try {
+ if (!testMaxOccurs("IssueTracker30_occurs-optimize-error.xml", "IssueTracker30_occurs-optimize.xsd"))
+ Assert.fail("Expected validation error not reported");
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage(), ex);
+ }
+ }
+
+ @Test
+ public void testMaxOccursOKOptimization() throws Exception {
+
+ // Parsing this document should *not* result in an error
+ try {
+ if (testMaxOccurs("IssueTracker30_occurs-optimize-ok.xml", "IssueTracker30_occurs-optimize.xsd"))
+ Assert.fail("Unexpected validation error reported");
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage(), ex);
+ }
+ }
+
+
+ private boolean testMaxOccurs(String xmlFileName, String xsdFileName) throws Exception {
+ File xmlFile = new File(getClass().getResource(xmlFileName).getFile());
+
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource(xsdFileName).getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ DocumentBuilder documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ throw e;
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ return errorFound;
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-error.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-error.xml
new file mode 100644
index 00000000000..b987f12d68d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-error.xml
@@ -0,0 +1,18 @@
+
+
+
+ Hege Refsnes
+ Cecilie
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+ Borge
+
+
+ Stale Refsnes
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-ok.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-ok.xml
new file mode 100644
index 00000000000..1c74eb70f4d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-ok.xml
@@ -0,0 +1,17 @@
+
+
+
+ Hege Refsnes
+ Cecilie
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+
+
+ Stale Refsnes
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-error.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-error.xml
new file mode 100644
index 00000000000..5e1b1eac0b2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-error.xml
@@ -0,0 +1,10 @@
+
+
+
+ Hege
+ Stale
+ Jim
+ Borge
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-ok.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-ok.xml
new file mode 100644
index 00000000000..00cb274e909
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize-ok.xml
@@ -0,0 +1,9 @@
+
+
+
+ Hege
+ Stale
+ Jim
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize.xsd
new file mode 100644
index 00000000000..e77fc023340
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs-optimize.xsd
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs.xsd
new file mode 100644
index 00000000000..a1a8ca39381
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/IssueTracker30_occurs.xsd
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue43Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue43Test.java
new file mode 100644
index 00000000000..5a451ca7a6e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue43Test.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/*
+ * @bug 6631318
+ * @summary Test creating schema from a DOM fragment with namespace.
+ */
+public class JaxpIssue43Test {
+
+ @Test
+ public void test() throws Exception {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Source[] sources = getSchemaSources();
+ Schema schema = sf.newSchema(sources);
+ Validator validator = schema.newValidator();
+ }
+
+ private Source[] getSchemaSources() throws Exception {
+ List list = new ArrayList();
+ String file = getClass().getResource("hello_literal.wsdl").getFile();
+ Source source = new StreamSource(new FileInputStream(file), file);
+
+ Transformer trans = TransformerFactory.newInstance().newTransformer();
+ DOMResult result = new DOMResult();
+ trans.transform(source, result);
+
+ // Look for element in wsdl
+ Element e = ((Document) result.getNode()).getDocumentElement();
+ NodeList typesList = e.getElementsByTagNameNS("http://schemas.xmlsoap.org/wsdl/", "types");
+ NodeList schemaList = ((Element) typesList.item(0)).getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "schema");
+ Element elem = (Element) schemaList.item(0);
+ list.add(new DOMSource(elem, file + "#schema0"));
+
+ // trans.transform(new DOMSource(elem), new StreamResult(System.out));
+
+ return list.toArray(new Source[list.size()]);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.java
new file mode 100644
index 00000000000..85522e9503d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.FileInputStream;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Node;
+
+/*
+ * @bug 6684227
+ * @summary Test property current-element-node works.
+ */
+public class JaxpIssue49 {
+
+ private Schema schema;
+ private Validator validator;
+
+ @Test
+ public void testValidatorTest() throws Exception {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String file = getClass().getResource("types.xsd").getFile();
+ Source[] sources = new Source[] { new StreamSource(new FileInputStream(file), file) };
+ Schema schema = sf.newSchema(sources);
+ validator = schema.newValidator();
+ validate();
+ } catch (Exception e) {
+ Node node = (Node) validator.getProperty("http://apache.org/xml/properties/dom/current-element-node");
+ if (node != null) {
+ System.out.println("Node: " + node.getLocalName());
+ } else
+ Assert.fail("No node returned");
+ }
+ }
+
+ public void validate() throws Exception {
+ validator.reset();
+ Source source = new StreamSource(getClass().getResourceAsStream("JaxpIssue49.xml"));
+ // If you comment the following line, it works
+ source = toDOMSource(source);
+ validator.validate(source);
+ }
+
+ DOMSource toDOMSource(Source source) throws Exception {
+ if (source instanceof DOMSource) {
+ return (DOMSource) source;
+ }
+ Transformer trans = TransformerFactory.newInstance().newTransformer();
+ DOMResult result = new DOMResult();
+ trans.transform(source, result);
+ trans.transform(new DOMSource(result.getNode()), new StreamResult(System.out));
+ return new DOMSource(result.getNode());
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.xml
new file mode 100644
index 00000000000..f4b8398f19b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/JaxpIssue49.xml
@@ -0,0 +1,10 @@
+
+
+
+ ToyotaCamry1998white
+
+
+
+ ToyotaCorolla1999red
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/LargeMaxOccursTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/LargeMaxOccursTest.java
new file mode 100644
index 00000000000..4a4e06235d2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/LargeMaxOccursTest.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test Validator shall report error for maxOccurs > 5000 when FEATURE_SECURE_PROCESSING is on, except the schema can be applied for constant-space algorithm.
+ */
+public class LargeMaxOccursTest {
+
+ @Test
+ public void testParticlesR005() {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String xsdFile = "particlesR005.xsd";
+ Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI()));
+ Validator validator = schema.newValidator();
+ } catch (Exception ex) {
+ return; // expected
+ }
+ Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply");
+ }
+
+ @Test
+ public void testParticlesIe003() {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String xsdFile = "particlesIe003.xsd";
+ Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI()));
+ Validator validator = schema.newValidator();
+ } catch (Exception ex) {
+ return; // expected
+ }
+ Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply");
+ }
+
+ @Test
+ public void testmgG014() {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String xsdFile = "mgG014.xsd";
+ Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI()));
+ Validator validator = schema.newValidator();
+ } catch (Exception ex) {
+ return; // expected
+ }
+ Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply");
+ }
+
+ @Test
+ public void testmgJ014() {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String xsdFile = "mgJ014.xsd";
+ Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI()));
+ Validator validator = schema.newValidator();
+ } catch (Exception ex) {
+ return; // expected
+ }
+ Assert.fail("Parser configuration error expected since maxOccurs > 5000 " + "and constant-space optimization does not apply");
+ }
+
+ // particlesOptimize.xsd missing.
+ @Test
+ public void testParticlesOptimize() {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String xsdFile = "particlesOptimize.xsd";
+ Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI()));
+ Validator validator = schema.newValidator();
+ } catch (Exception ex) {
+ Assert.fail("Parser configuration error not expected since maxOccurs " + "> 5000 but constant-space optimization applies");
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursTest.java
new file mode 100644
index 00000000000..7f0dbddebee
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursTest.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class MultiOccursTest {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public MultiOccursTest() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("multi-occurs.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testMultiOccursMaxMinOk() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("multi-occurs-ok.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+ @Test
+ public void testMultiOccursMaxMinErrorMin() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("multi-occurs-error-min.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+ @Test
+ public void testMultiOccursMaxMinErrorMax() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("multi-occurs-error-max.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+ @Test
+ public void testMultiOccursMaxMinErrorMinMax() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("multi-occurs-error-min-max.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursUnboundedTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursUnboundedTest.java
new file mode 100644
index 00000000000..8d7d5163756
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/MultiOccursUnboundedTest.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class MultiOccursUnboundedTest {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public MultiOccursUnboundedTest() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("multi-occurs-unbounded.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testMultiOccursMaxMinOk() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("multi-occurs-unbounded-ok.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+ @Test
+ public void testMultiOccursMaxMinErrorMin() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("multi-occurs-unbounded-error-min.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursTest.java
new file mode 100644
index 00000000000..be3ed12bf0f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursTest.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class OccursTest {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public OccursTest() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("occurs.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testOccursMaxMinOk() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-ok.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+ @Test
+ public void testOccursMaxMinErrorMin() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-error-min.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+ @Test
+ public void testOccursMaxMinErrorMax() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-error-max.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+ @Test
+ public void testOccursMaxMinErrorMinMax() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-error-min-max.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursUnboundedTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursUnboundedTest.java
new file mode 100644
index 00000000000..47d1ba9af91
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursUnboundedTest.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class OccursUnboundedTest {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public OccursUnboundedTest() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("occurs-unbounded.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testOccursUnboundedMaxMinOk() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-unbounded-ok.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+ @Test
+ public void testOccursUnboundedMaxMinErrorMin() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-unbounded-error-min.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardTest.java
new file mode 100644
index 00000000000..36b21cdf8bd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardTest.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class OccursWildcardTest {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public OccursWildcardTest() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("occurs-wildcard.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testOccursMaxMinOk() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-ok.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+ @Test
+ public void testOccursMaxMinErrorMin() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-error-min.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+ @Test
+ public void testOccursMaxMinErrorMax() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-error-max.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+ @Test
+ public void testOccursMaxMinErrorMinMax() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-error-min-max.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardUnbounded.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardUnbounded.java
new file mode 100644
index 00000000000..e11fa92fd47
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/OccursWildcardUnbounded.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class OccursWildcardUnbounded {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public OccursWildcardUnbounded() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("occurs-wildcard-unbounded.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testOccursUnboundedMaxMinOk() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-unbounded-ok.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+ @Test
+ public void testOccursUnboundedMaxMinErrorMin() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("occurs-unbounded-error-min.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (!errorFound) {
+ Assert.fail("Expected validation error not reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesId005Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesId005Test.java
new file mode 100644
index 00000000000..429ea2d9d83
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesId005Test.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class ParticlesId005Test {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public ParticlesId005Test() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("particlesId005.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testNoOptimizationWithChoice() throws Exception {
+ printMethodName();
+
+ File xmlFile = new File(getClass().getResource("particlesId005.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesIg004Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesIg004Test.java
new file mode 100644
index 00000000000..c1618505e34
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesIg004Test.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @summary Test particlesIg004.xsd.
+ */
+public class ParticlesIg004Test {
+
+ @Test
+ public void testParticleslg004() {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ String xsdFile = "particlesIg004.xsd";
+ Schema schema = sf.newSchema(new File(getClass().getResource(xsdFile).toURI()));
+ Validator validator = schema.newValidator();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail(ex.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesQ013Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesQ013Test.java
new file mode 100644
index 00000000000..ef589d13847
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ParticlesQ013Test.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/*
+ * @summary Test Schema Validator can parse multiple or unbounded occurs.
+ */
+public class ParticlesQ013Test {
+
+ boolean errorFound;
+
+ DocumentBuilder documentBuilder;
+
+ private void printMethodName() {
+ StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+ System.out.println(stack[2].getMethodName());
+ }
+
+ public ParticlesQ013Test() throws Exception {
+ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = factory.newSchema(new File(getClass().getResource("particlesQ013.xsd").getFile()));
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setSchema(schema);
+
+ documentBuilder = dbf.newDocumentBuilder();
+ documentBuilder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e) throws SAXException {
+ System.out.println("Error: " + e.getMessage());
+ errorFound = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+ System.out.println("Fatal error: " + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+ System.out.println("Warning: " + e.getMessage());
+ }
+ });
+ }
+
+ @Test
+ public void testNoOptimizationWithChoice() throws Exception {
+ printMethodName();
+ File xmlFile = new File(getClass().getResource("particlesQ013.xml").getFile());
+ try {
+ errorFound = false;
+ documentBuilder.parse(xmlFile);
+ } catch (SAXException ex) {
+ Assert.fail(ex.getMessage());
+ }
+ if (errorFound) {
+ Assert.fail("Unexpected validation error reported");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/TCKGroupA008Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/TCKGroupA008Test.java
new file mode 100644
index 00000000000..e097422fbdf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/TCKGroupA008Test.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test groupA008.xsd.
+ */
+public class TCKGroupA008Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ // System.setSecurityManager(new SecurityManager());
+ try {
+ SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+ File schemaLocation = new File(getClass().getResource("groupA008.xsd").getFile());
+ Schema schema = factory.newSchema(schemaLocation);
+ Validator validator = schema.newValidator();
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ValidatorTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ValidatorTest.java
new file mode 100644
index 00000000000..5a84c5211a7
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/ValidatorTest.java
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stax.StAXResult;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+
+/*
+ * @summary Test Validator.validate(Source, Result).
+ */
+public class ValidatorTest {
+
+ @Test
+ public void testValidateStAX() {
+
+ File resultFile = null;
+ try {
+ resultFile = new File("stax.result");
+ if (resultFile.exists()) {
+ resultFile.delete();
+ }
+
+ Result xmlResult = new javax.xml.transform.stax.StAXResult(XMLOutputFactory.newInstance().createXMLStreamWriter(new FileWriter(resultFile)));
+ Source xmlSource = new javax.xml.transform.stax.StAXSource(getXMLEventReader("toys.xml"));
+ validate("toys.xsd", xmlSource, xmlResult);
+
+ ((StAXResult) xmlResult).getXMLStreamWriter().close();
+ Assert.assertTrue(resultFile.exists(), "result file is not created");
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Exception : " + ex.getMessage());
+ } finally {
+ if (resultFile != null && resultFile.exists()) {
+ resultFile.delete();
+ }
+ }
+ }
+
+ @Test
+ public void testValidateStream() {
+
+ File resultFile = null;
+ try {
+ resultFile = new File("stax.result");
+ if (resultFile.exists()) {
+ resultFile.delete();
+ }
+
+ // Validate this instance document against the
+ // Instance document supplied
+ Result xmlResult = new javax.xml.transform.stream.StreamResult(resultFile);
+ Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(ValidatorTest.class.getResource("toys.xml").toURI()));
+
+ validate("toys.xsd", xmlSource, xmlResult);
+ Assert.assertTrue(resultFile.exists(), "result file is not created");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Exception : " + ex.getMessage());
+ } finally {
+ if (resultFile != null && resultFile.exists()) {
+ resultFile.delete();
+ }
+ }
+ }
+
+ @Test
+ public void testValidateGMonth() {
+
+ // test valid gMonths
+ File resultFile = null;
+ try {
+ resultFile = new File("gMonths.result.xml");
+ if (resultFile.exists()) {
+ resultFile.delete();
+ }
+
+ // Validate this instance document against the
+ // Instance document supplied
+ Result xmlResult = new javax.xml.transform.stream.StreamResult(resultFile);
+ Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(ValidatorTest.class.getResource("gMonths.xml").toURI()));
+
+ validate("gMonths.xsd", xmlSource, xmlResult);
+
+ Assert.assertTrue(resultFile.exists(), "result file is not created");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Exception : " + ex.getMessage());
+ } finally {
+ if (resultFile != null && resultFile.exists()) {
+ resultFile.delete();
+ }
+ }
+
+ // test invalid gMonths
+ File invalidResultFile = null;
+ try {
+ invalidResultFile = new File("gMonths-invalid.result.xml");
+ if (invalidResultFile.exists()) {
+ invalidResultFile.delete();
+ }
+
+ // Validate this instance document against the
+ // Instance document supplied
+ Result xmlResult = new javax.xml.transform.stream.StreamResult(resultFile);
+ Source xmlSource = new javax.xml.transform.stream.StreamSource(new File(ValidatorTest.class.getResource("gMonths-invalid.xml").toURI()));
+
+ validate("gMonths.xsd", xmlSource, xmlResult);
+
+ // should have failed with an Exception due to invalid gMonths
+ Assert.fail("invalid gMonths were accepted as valid in " + ValidatorTest.class.getResource("gMonths-invalid.xml").toURI());
+ } catch (Exception ex) {
+ // expected failure
+ System.out.println("Expected failure: " + ex.toString());
+ } finally {
+ if (invalidResultFile != null && invalidResultFile.exists()) {
+ invalidResultFile.delete();
+ }
+ }
+ }
+
+ private void validate(final String xsdFile, final Source src, final Result result) throws Exception {
+ try {
+ SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = sf.newSchema(new File(ValidatorTest.class.getResource(xsdFile).toURI()));
+
+ // Get a Validator which can be used to validate instance document
+ // against this grammar.
+ Validator validator = schema.newValidator();
+ ErrorHandler eh = new ErrorHandlerImpl();
+ validator.setErrorHandler(eh);
+
+ // Validate this instance document against the
+ // Instance document supplied
+ validator.validate(src, result);
+ } catch (Exception ex) {
+ throw ex;
+ }
+ }
+
+ private XMLEventReader getXMLEventReader(final String filename) {
+
+ XMLInputFactory xmlif = null;
+ XMLEventReader xmlr = null;
+ try {
+ xmlif = XMLInputFactory.newInstance();
+ xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE);
+ xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
+ xmlif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+ xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
+
+ // FileInputStream fis = new FileInputStream(filename);
+ FileInputStream fis = new FileInputStream(new File(ValidatorTest.class.getResource(filename).toURI()));
+ xmlr = xmlif.createXMLEventReader(filename, fis);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Exception : " + ex.getMessage());
+ }
+ return xmlr;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLDocBuilder.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLDocBuilder.java
new file mode 100644
index 00000000000..f0513bb3683
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLDocBuilder.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+public class XMLDocBuilder {
+
+ private DocumentBuilderFactory factory = null;
+ private DocumentBuilder builder = null;
+ private Document doc = null;
+ private Reader reader = null;
+ private Reader schema = null;
+ private String encoding = null;
+ private String entityPath = null;
+
+ public XMLDocBuilder(String file, String encoding, String schema) {
+ this.encoding = encoding;
+ reader = getReaderFromSystemResource(file, encoding);
+ this.schema = getReaderFromSystemResource(schema, encoding);
+ }
+
+ public Document getDocument() {
+ if (reader == null)
+ return null;
+
+ try {
+ factory = DocumentBuilderFactory.newInstance();
+
+ builder = factory.newDocumentBuilder();
+ builder.setErrorHandler(new myErrorHandler());
+ builder.setEntityResolver(new myEntityResolver());
+
+ InputSource source = new InputSource(reader);
+ source.setEncoding(encoding);
+
+ try {
+ doc = builder.parse(source);
+ new XMLSchemaValidator(doc, schema).validate();
+
+ } catch (SAXException e) {
+ System.err.println(getClass() + " SAXException: " + e.getMessage());
+ return null;
+ } catch (IOException e) {
+ System.err.println(getClass() + " IOException: " + e.getMessage());
+ return null;
+ } catch (OutOfMemoryError e) {
+ e.printStackTrace();
+ System.err.println(e.getCause().getLocalizedMessage());
+ return null;
+ }
+
+ } catch (ParserConfigurationException e) {
+ System.err.println(getClass() + " ParserConfigurationException: " + e.getMessage());
+ return null;
+ }
+ return doc;
+ }
+
+ public Reader getReaderFromSystemResource(String file, String encoding) {
+
+ try {
+ return new InputStreamReader(getClass().getResourceAsStream(file), encoding);
+ } catch (UnsupportedEncodingException e) {
+ System.err.println(getClass() + " UnsupportedEncodingException: " + e.getMessage());
+ } catch (IOException e) {
+ System.err.println(getClass() + " IOException: " + e.getMessage());
+ }
+ return null;
+ }
+
+ public void setEntityPath(String entityPath) {
+ this.entityPath = entityPath;
+ }
+
+ private class myErrorHandler implements ErrorHandler {
+
+ public void warning(SAXParseException e) {
+ showErrorMessage(e);
+ }
+
+ public void error(SAXParseException e) {
+ showErrorMessage(e);
+ }
+
+ public void fatalError(SAXParseException e) {
+ showErrorMessage(e);
+ }
+
+ private void showErrorMessage(SAXParseException e) {
+ System.err.println(getClass() + " SAXParseException" + e.getMessage());
+ System.err.println("Line: " + e.getLineNumber() + " Column: " + e.getColumnNumber());
+ }
+ }
+
+ private class myEntityResolver implements EntityResolver {
+ public InputSource resolveEntity(String publicId, String systemId) {
+ if (entityPath == null)
+ return null;
+
+ systemId = entityPath + systemId.subSequence(systemId.lastIndexOf("/"), systemId.length());
+
+ return new InputSource(systemId);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLSchemaValidator.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLSchemaValidator.java
new file mode 100644
index 00000000000..c1722a190e5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/XMLSchemaValidator.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation;
+
+import java.io.IOException;
+import java.io.Reader;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+public class XMLSchemaValidator {
+
+ private SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ private Node node = null;
+ private Reader schema = null;
+
+ public XMLSchemaValidator(Node doc, Reader schema) {
+ this.node = doc;
+ this.schema = schema;
+ }
+
+ public synchronized void validate() throws SAXException, IOException {
+
+ if (node == null || schema == null)
+ return;
+
+ Source schemaFile = new StreamSource(schema);
+ Schema schema = factory.newSchema(schemaFile);
+ Validator validator = schema.newValidator();
+ validator.validate(new DOMSource(node));
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths-invalid.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths-invalid.xml
new file mode 100644
index 00000000000..a3071b50bab
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths-invalid.xml
@@ -0,0 +1,32 @@
+
+
+
+
+ --01--
+ --01--Z
+ --01---08:00
+ foo
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xml
new file mode 100644
index 00000000000..65020ee63d9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xml
@@ -0,0 +1,31 @@
+
+
+
+
+ --01
+ --01Z
+ --01-08:00
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xsd
new file mode 100644
index 00000000000..c18b5dc7518
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/gMonths.xsd
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008.xsd
new file mode 100644
index 00000000000..a21071f9529
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008ea.red b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008ea.red
new file mode 100644
index 00000000000..6349040a5c8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008ea.red
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008eb.red b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008eb.red
new file mode 100644
index 00000000000..87dc2027fdf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/groupA008eb.red
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/hello_literal.wsdl b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/hello_literal.wsdl
new file mode 100644
index 00000000000..20e2e09c16f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/hello_literal.wsdl
@@ -0,0 +1,294 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idI009.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idI009.xsd
new file mode 100644
index 00000000000..92d9af034fd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idI009.xsd
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIimp.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIimp.xsd
new file mode 100644
index 00000000000..731d8521dfd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIimp.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns.xsd
new file mode 100644
index 00000000000..941695faf53
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns.xsd
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns1.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns1.xsd
new file mode 100644
index 00000000000..d0ff89a7805
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/idIxpns1.xsd
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgG014.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgG014.xsd
new file mode 100644
index 00000000000..279372d8402
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgG014.xsd
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgJ014.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgJ014.xsd
new file mode 100644
index 00000000000..f284389bfcd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/mgJ014.xsd
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-max.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-max.xml
new file mode 100644
index 00000000000..e3743f1a2fd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-max.xml
@@ -0,0 +1,34 @@
+
+
+
+ Hege Refsnes
+
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ John
+
+
+ Hege Refsnes
+
+ Jim
+ Hege
+ Stale
+
+
+ Hege Refsnes
+
+ Jim
+ Hege
+ Stale
+
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ John
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min-max.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min-max.xml
new file mode 100644
index 00000000000..aae039cb5b0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min-max.xml
@@ -0,0 +1,25 @@
+
+
+
+ Hege Refsnes
+
+ Jim
+ Hege
+ Stale
+
+
+
+ Hege Refsnes Jr.
+
+ Jim
+ Hege
+ Stale
+
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ John
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min.xml
new file mode 100644
index 00000000000..e52e5266bf4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-error-min.xml
@@ -0,0 +1,13 @@
+
+
+
+ Hege Refsnes
+
+
+
+ Hege Refsnes
+ John
+ Doe
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-ok.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-ok.xml
new file mode 100644
index 00000000000..06f23371e2e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-ok.xml
@@ -0,0 +1,38 @@
+
+
+
+ Hege Refsnes
+ Cecilie
+
+
+ Hege Refsnes
+ Peter
+ Cecilie
+ Hege
+
+
+ Tove Refsnes
+ Peter
+ Pan
+ Hege
+ Stale
+ Jim
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+ Sheldon
+
+
+ Stale Refsnes
+ Peter
+ Pan
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-error-min.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-error-min.xml
new file mode 100644
index 00000000000..ba1fc71c28b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-error-min.xml
@@ -0,0 +1,20 @@
+
+
+
+ Hege Refsnes
+
+
+
+
+ Hege Refsnes
+
+ John
+
+
+
+ Hege Refsnes
+
+ John
+ Doe
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-ok.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-ok.xml
new file mode 100644
index 00000000000..a9d696e18fa
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded-ok.xml
@@ -0,0 +1,24 @@
+
+
+
+ Hege Refsnes
+ Peter
+ Pan
+ Cecilie
+ Hege
+ Jim
+
+
+ Stale Refsnes
+ Peter
+ Pan
+ Jim
+ Morris
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ Billy
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded.xsd
new file mode 100644
index 00000000000..d53a8fb98d2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs-unbounded.xsd
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs.xsd
new file mode 100644
index 00000000000..d6cb815d80d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/multi-occurs.xsd
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-max.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-max.xml
new file mode 100644
index 00000000000..cd6768d7990
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-max.xml
@@ -0,0 +1,13 @@
+
+
+
+ Hege Refsnes
+
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ John
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min-max.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min-max.xml
new file mode 100644
index 00000000000..bdda93a7f76
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min-max.xml
@@ -0,0 +1,17 @@
+
+
+
+ Hege Refsnes
+
+
+
+ Hege Refsnes Jr.
+
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ John
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min.xml
new file mode 100644
index 00000000000..67948360ff3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-error-min.xml
@@ -0,0 +1,7 @@
+
+
+
+ Hege Refsnes
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-ok.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-ok.xml
new file mode 100644
index 00000000000..29d3f37ccf3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-ok.xml
@@ -0,0 +1,33 @@
+
+
+
+ Hege Refsnes
+ Cecilie
+
+
+ Hege Refsnes
+ Cecilie
+ Hege
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+ Sheldon
+
+
+ Stale Refsnes
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-error-min.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-error-min.xml
new file mode 100644
index 00000000000..ba00d962738
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-error-min.xml
@@ -0,0 +1,9 @@
+
+
+
+ Hege Refsnes
+
+ Hege
+ Stale
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-ok.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-ok.xml
new file mode 100644
index 00000000000..177b18b2e09
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded-ok.xml
@@ -0,0 +1,37 @@
+
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+
+
+ Tove Refsnes
+ Hege
+ Stale
+ Jim
+ Sheldon
+
+
+ Stale Refsnes
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+
+
+ Stale Refsnes
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+ Jim
+ Hege
+ Stale
+ Sheldon
+ Penny
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded.xsd
new file mode 100644
index 00000000000..ae39e098efb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-unbounded.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard-unbounded.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard-unbounded.xsd
new file mode 100644
index 00000000000..5c543cadf52
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard-unbounded.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard.xsd
new file mode 100644
index 00000000000..a21f20b064d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs-wildcard.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs.xsd
new file mode 100644
index 00000000000..62a7d2f266c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/occurs.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xml
new file mode 100644
index 00000000000..8b579e2cac1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xsd
new file mode 100644
index 00000000000..58ed89a2473
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesId005.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIe003.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIe003.xsd
new file mode 100644
index 00000000000..251c9699b8a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIe003.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIg004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIg004.xsd
new file mode 100644
index 00000000000..2f1f0414135
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesIg004.xsd
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesOptimize.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesOptimize.xsd
new file mode 100644
index 00000000000..9bffaa06a36
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesOptimize.xsd
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xml
new file mode 100644
index 00000000000..95216a47721
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xsd
new file mode 100644
index 00000000000..1fb12be8fad
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesQ013.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesR005.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesR005.xsd
new file mode 100644
index 00000000000..13b38bffbae
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/particlesR005.xsd
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2.xsd
new file mode 100644
index 00000000000..21d78ecd0f5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xml
new file mode 100644
index 00000000000..27e01aa3961
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xml
@@ -0,0 +1,5 @@
+
+
+ Stub document
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xsd
new file mode 100644
index 00000000000..63b36a95f67
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2_stub.xsd
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2a.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2a.xsd
new file mode 100644
index 00000000000..1a20a499e5c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/targetNS00101m2a.xsd
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits004.xsd
new file mode 100644
index 00000000000..928815e966c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits007.xsd
new file mode 100644
index 00000000000..5614e85ffc1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/byte_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits004.xsd
new file mode 100644
index 00000000000..f73163bad45
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits007.xsd
new file mode 100644
index 00000000000..af779fefe18
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/int_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits004.xsd
new file mode 100644
index 00000000000..d51cca4e55b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits007.xsd
new file mode 100644
index 00000000000..68e3126a8da
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/integer_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits004.xsd
new file mode 100644
index 00000000000..e52f98582a4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits007.xsd
new file mode 100644
index 00000000000..a22732c90d1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/long_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits004.xsd
new file mode 100644
index 00000000000..3f5a859a89d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits007.xsd
new file mode 100644
index 00000000000..53c04b1cedb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/negativeInteger_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits004.xsd
new file mode 100644
index 00000000000..067f1775e28
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits007.xsd
new file mode 100644
index 00000000000..3eeb2d56f2c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonNegativeInteger_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits004.xsd
new file mode 100644
index 00000000000..044d0093275
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits007.xsd
new file mode 100644
index 00000000000..fc1a4133338
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/nonPositiveInteger_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits004.xsd
new file mode 100644
index 00000000000..3f7cd0e8b20
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits007.xsd
new file mode 100644
index 00000000000..0a210e57f21
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/positiveInteger_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits004.xsd
new file mode 100644
index 00000000000..f0a39652a48
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits007.xsd
new file mode 100644
index 00000000000..102f16becaa
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/short_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits004.xsd
new file mode 100644
index 00000000000..0691fa47239
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits007.xsd
new file mode 100644
index 00000000000..e90db8e1b9a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedByte_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits004.xsd
new file mode 100644
index 00000000000..88ba0587162
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits007.xsd
new file mode 100644
index 00000000000..713f7c728e3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedInt_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits004.xsd
new file mode 100644
index 00000000000..d8d56074dea
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits007.xsd
new file mode 100644
index 00000000000..e9accfcd561
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedLong_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits004.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits004.xsd
new file mode 100644
index 00000000000..bf49587c672
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits004.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits007.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits007.xsd
new file mode 100644
index 00000000000..9747be35d92
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252In/unsignedShort_fractionDigits007.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252Test.java
new file mode 100644
index 00000000000..c9de30f5d49
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6943252Test.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6943252
+ * @summary Test Schema doesn't allow to use value more than allowed by base type.
+ */
+public class Bug6943252Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+
+ String dir = Bug6943252Test.class.getResource("Bug6943252In").getPath();
+ File inputs = new File(dir);
+ File[] files = inputs.listFiles();
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ for (int i = 0; i < files.length; i++) {
+ try {
+ Schema schema = schemaFactory.newSchema(new StreamSource(files[i]));
+ Assert.fail(files[i].getName() + "should fail");
+ } catch (SAXException e) {
+ // expected
+ System.out.println(files[i].getName() + ":");
+ System.out.println(e.getMessage());
+ }
+ }
+
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124.xsd
new file mode 100644
index 00000000000..c3e78e12b8d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124.xsd
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124Test.java
new file mode 100644
index 00000000000..fc1f3286e02
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963124Test.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6963124
+ * @summary Test Schema doesn't allow maxOccurs > 1 for reference to all model group.
+ */
+public class Bug6963124Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6963124Test.class.getResourceAsStream("Bug6963124.xsd")));
+ Assert.fail("JCK negative test");
+ } catch (SAXException e) {
+ // e.printStackTrace();
+ System.out
+ .println("The XML Schema spec [1] states that if the {term} property of a particle is a model group with {compositor} all then {maxOccurs} of that particle must equal 1.");
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xml
new file mode 100644
index 00000000000..8076d953da2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xml
@@ -0,0 +1,14 @@
+
+
+ 1
+ true
+ false
+ x
+ y
+ 1
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xsd
new file mode 100644
index 00000000000..5b2bca83dbf
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468.xsd
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468Test.java
new file mode 100644
index 00000000000..59fab2b21c4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6963468Test.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6963468
+ * @summary Test Validation allows element a is a union type and element b specifies a as its substitution group and b type is or is derived from one of the member types of the union.
+ */
+public class Bug6963468Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6963468Test.class.getResourceAsStream("Bug6963468.xsd")));
+
+ Validator validator = schema.newValidator();
+ validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ validator.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+
+ public void fatalError(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+
+ public void warning(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+ });
+
+ validator.validate(new StreamSource(Bug6963468Test.class.getResourceAsStream("Bug6963468.xml")));
+
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ // fail(e.getMessage());
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ // fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testInstance() throws ParserConfigurationException, SAXException, IOException {
+ System.out.println(Bug6963468Test.class.getResource("Bug6963468.xsd").getPath());
+ File schemaFile = new File(Bug6963468Test.class.getResource("Bug6963468.xsd").getPath());
+ SAXParser parser = createParser(schemaFile);
+
+ try {
+ parser.parse(Bug6963468Test.class.getResource("Bug6963468.xml").getPath(), new DefaultHandler());
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail("Fatal Error: " + strException(e));
+ }
+
+ }
+
+ protected SAXParser createParser(File schema) throws ParserConfigurationException, SAXException {
+
+ // create and initialize the parser
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+
+ // set schemaLocation if possible
+ try {
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schema);
+ } catch (SAXNotRecognizedException e) {
+ System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not recognized.");
+ } catch (SAXNotSupportedException e) {
+ System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not supported.");
+ }
+
+ return parser;
+ }
+
+ protected static String strException(Exception ex) {
+ StringBuffer sb = new StringBuffer();
+
+ while (ex != null) {
+ if (ex instanceof SAXParseException) {
+ SAXParseException e = (SAXParseException) ex;
+ sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage());
+ ex = e.getException();
+ } else {
+ sb.append(ex);
+ ex = null;
+ }
+ }
+ return sb.toString();
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720.xsd
new file mode 100644
index 00000000000..2b4a00795eb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720.xsd
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720Test.java
new file mode 100644
index 00000000000..4c287f77f35
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6964720Test.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6964720
+ * @summary Test Schema doesn't allow the inexpressible union of two attribute wildcards.
+ */
+public class Bug6964720Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6964720Test.class.getResourceAsStream("Bug6964720.xsd")));
+ Assert.fail("should produce an error message");
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/RegexTest_1258.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/RegexTest_1258.xsd
new file mode 100644
index 00000000000..1ae5e992989
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/RegexTest_1258.xsd
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD10.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD10.xsd
new file mode 100644
index 00000000000..65e32e116f5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD10.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD11.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD11.xsd
new file mode 100644
index 00000000000..98408c75f3d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD11.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD12.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD12.xsd
new file mode 100644
index 00000000000..c148d59333c
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reD12.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reE9.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reE9.xsd
new file mode 100644
index 00000000000..907efb9e4fb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214/reE9.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214Test.java
new file mode 100644
index 00000000000..6f9a81998ce
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6967214Test.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6967214
+ * @summary Test Schema doesn't allow unpaired parenthesises in regex.
+ */
+public class Bug6967214Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ File dir = new File(Bug6967214Test.class.getResource("Bug6967214").getPath());
+ File files[] = dir.listFiles();
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ for (int i = 0; i < files.length; i++) {
+ try {
+ System.out.println(files[i].getName());
+ Schema schema = schemaFactory.newSchema(new StreamSource(files[i]));
+ Assert.fail("should report error");
+ } catch (org.xml.sax.SAXParseException spe) {
+ continue;
+ }
+ }
+ } catch (SAXException e) {
+ e.printStackTrace();
+
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890.xsd
new file mode 100644
index 00000000000..c332826ceb8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890.xsd
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890Test.java
new file mode 100644
index 00000000000..6daab87a8a2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890Test.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6970890
+ * @summary Test Schema allows [-] in regex.
+ */
+public class Bug6970890Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test_RegexTest_1319() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6970890Test.class.getResourceAsStream("Bug6970890.xsd")));
+
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail("The - character is a valid character range at the beginning or end of a positive character group");
+ }
+ }
+
+ @Test
+ public void test_reH16() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6970890Test.class.getResourceAsStream("Bug6970890_1.xsd")));
+
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail("The - character is a valid character range at the beginning or end of a positive character group");
+
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890_1.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890_1.xsd
new file mode 100644
index 00000000000..b48c7553b98
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6970890_1.xsd
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xml
new file mode 100644
index 00000000000..d8b94d4b31e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xml
@@ -0,0 +1,210 @@
+
+
+
+
+
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+٠
+١
+٢
+٣
+٤
+٥
+٦
+٧
+٨
+٩
+۰
+۱
+۲
+۳
+۴
+۵
+۶
+۷
+۸
+۹
+०
+१
+२
+३
+४
+५
+६
+७
+८
+९
+০
+১
+২
+৩
+৪
+৫
+৬
+৭
+৮
+৯
+੦
+੧
+੨
+੩
+੪
+੫
+੬
+੭
+੮
+੯
+૦
+૧
+૨
+૩
+૪
+૫
+૬
+૭
+૮
+૯
+୦
+୧
+୨
+୩
+୪
+୫
+୬
+୭
+୮
+୯
+௧
+௨
+௩
+௪
+௫
+௬
+௭
+௮
+௯
+౦
+౧
+౨
+౩
+౪
+౫
+౬
+౭
+౮
+౯
+೦
+೧
+೨
+೩
+೪
+೫
+೬
+೭
+೮
+೯
+൦
+൧
+൨
+൩
+൪
+൫
+൬
+൭
+൮
+൯
+๐
+๑
+๒
+๓
+๔
+๕
+๖
+๗
+๘
+๙
+໐
+໑
+໒
+໓
+໔
+໕
+໖
+໗
+໘
+໙
+༠
+༡
+༢
+༣
+༤
+༥
+༦
+༧
+༨
+༩
+၀
+၁
+၂
+၃
+၄
+၅
+၆
+၇
+၈
+၉
+፩
+፪
+፫
+፬
+፭
+፮
+፯
+፰
+፱
+០
+១
+២
+៣
+៤
+៥
+៦
+៧
+៨
+៩
+᠐
+᠑
+᠒
+᠓
+᠔
+᠕
+᠖
+᠗
+᠘
+᠙
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+
+ 𝟎
+ 𝟿
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xsd
new file mode 100644
index 00000000000..aaa885040e3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190Test.java
new file mode 100644
index 00000000000..0d20968ae0a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190Test.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6971190
+ * @summary Test Validation accepts UTF lexical presentation.
+ */
+public class Bug6971190Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190.xsd")));
+ Validator validator = schema.newValidator();
+ /**
+ * validator.setErrorHandler(new ErrorHandler() { public void
+ * error(SAXParseException exception) throws SAXException {
+ * exception.printStackTrace(); }
+ *
+ * public void fatalError(SAXParseException exception) throws
+ * SAXException { exception.printStackTrace(); }
+ *
+ * public void warning(SAXParseException exception) throws
+ * SAXException { exception.printStackTrace(); } });
+ */
+ validator.validate(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190.xml")));
+
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ Assert.fail(e.getMessage());
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ // test \W negative tests with positibve \w
+ @Test
+ public void testNegative() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190_v.xsd")));
+ Validator validator = schema.newValidator();
+
+ validator.validate(new StreamSource(Bug6971190Test.class.getResourceAsStream("Bug6971190_v.xml")));
+
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail(e.getMessage());
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xml
new file mode 100644
index 00000000000..22d377e7e23
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ ʰ
+ ʰ
+ ゚
+ 𪘀
+
+
+
+
+
+
+
+
+
+ 𝟿
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 𝞨
+ 𝟉
+ Dž
+ Dž
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xsd
new file mode 100644
index 00000000000..0ebfd866c04
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6971190_v.xsd
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xml
new file mode 100644
index 00000000000..02818c373fd
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xml
@@ -0,0 +1,10 @@
+
+
+
+ test
+
+
+
+ information
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xsd
new file mode 100644
index 00000000000..3a4d762f785
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551.xsd
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551Test.java
new file mode 100644
index 00000000000..0b4f7e53678
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6974551Test.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6974551
+ * @summary Test Validation for SAXParser can expose whitespace facet for xs:anySimpleType.
+ */
+public class Bug6974551Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ static String _xml = Bug6974551Test.class.getResource("Bug6974551.xml").getPath();
+ static String _xsd = Bug6974551Test.class.getResource("Bug6974551.xsd").getPath();
+
+ @Test
+ public void testSAX() {
+ try {
+ Schema schema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(_xsd));
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ spf.setSchema(schema);
+ SAXParser parser = spf.newSAXParser();
+ MyErrorHandler errorHandler = new MyErrorHandler();
+ parser.parse(_xml, errorHandler);
+ if (!errorHandler.errorOccured) {
+ Assert.fail("should report error");
+ }
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testValidationAPI() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(_xsd));
+ Validator validator = schema.newValidator();
+ validator.validate(new StreamSource(_xml));
+
+ Assert.fail("should report error");
+ } catch (SAXException e) {
+ // expected, pass
+ System.out.println(e.getMessage());
+ } catch (IOException e) {
+ Assert.fail(e.getMessage());
+ System.out.println(e.getMessage());
+ }
+ }
+
+ class MyErrorHandler extends DefaultHandler {
+
+ public boolean errorOccured = false;
+
+ public void error(SAXParseException e) throws SAXException {
+
+ System.err.println("Error: " + "[[" + e.getPublicId() + "]" + "[" + e.getSystemId() + "]]" + "[[" + e.getLineNumber() + "]" + "["
+ + e.getColumnNumber() + "]] " + e);
+
+ errorOccured = true;
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException {
+
+ System.err.println("Fatal Error: " + e);
+
+ errorOccured = true;
+ }
+
+ public void warning(SAXParseException e) throws SAXException {
+
+ System.err.println("Warning: " + e);
+
+ errorOccured = true;
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF025.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF025.xsd
new file mode 100644
index 00000000000..c1d05fea41e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF025.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF037.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF037.xsd
new file mode 100644
index 00000000000..b5f49849f97
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF037.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF041.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF041.xsd
new file mode 100644
index 00000000000..0218d1b9118
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF041.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF045.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF045.xsd
new file mode 100644
index 00000000000..f4ef36408da
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF045.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF049.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF049.xsd
new file mode 100644
index 00000000000..c7eadd610c1
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265/notatF049.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265Test.java
new file mode 100644
index 00000000000..8149e386d50
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6975265Test.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.File;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6975265
+ * @summary Test Schema doesn't allow some Element Information Items contain other element information item.
+ */
+public class Bug6975265Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ File dir = new File(Bug6975265Test.class.getResource("Bug6975265").getPath());
+ File files[] = dir.listFiles();
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ for (int i = 0; i < files.length; i++) {
+ try {
+ System.out.println(files[i].getName());
+ Schema schema = schemaFactory.newSchema(new StreamSource(files[i]));
+ Assert.fail("should report error");
+ } catch (org.xml.sax.SAXParseException spe) {
+ System.out.println(spe.getMessage());
+ continue;
+ }
+ }
+ } catch (SAXException e) {
+ e.printStackTrace();
+
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xml
new file mode 100644
index 00000000000..7a6886461ad
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ a
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xsd
new file mode 100644
index 00000000000..50ae25d71fa
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA2.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xml
new file mode 100644
index 00000000000..0afddb9c781
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xsd
new file mode 100644
index 00000000000..3df7ad7fe72
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA3.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xml
new file mode 100644
index 00000000000..b4314254a55
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ #xD;
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xsd
new file mode 100644
index 00000000000..30368e846ab
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA4.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xml
new file mode 100644
index 00000000000..04468dbbf60
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xsd
new file mode 100644
index 00000000000..db8516d06a0
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA5.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xml
new file mode 100644
index 00000000000..06d45074c99
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ #xA;
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xsd
new file mode 100644
index 00000000000..ce66fdbe81b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201/reA6.xsd
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201Test.java
new file mode 100644
index 00000000000..2b886fdc06a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6977201Test.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6977201
+ * @summary Test Validator interprets regex "" correctly.
+ */
+public class Bug6977201Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ @Test
+ public void test() {
+ validate(Bug6977201Test.class.getResource("Bug6977201/reA2.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA2.xml").getPath());
+ validate(Bug6977201Test.class.getResource("Bug6977201/reA3.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA3.xml").getPath());
+ validate(Bug6977201Test.class.getResource("Bug6977201/reA4.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA4.xml").getPath());
+ validate(Bug6977201Test.class.getResource("Bug6977201/reA5.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA5.xml").getPath());
+ validate(Bug6977201Test.class.getResource("Bug6977201/reA6.xsd").getPath(), Bug6977201Test.class.getResource("Bug6977201/reA6.xml").getPath());
+ }
+
+ // JCK negative test
+ public void validate(String xsd, String xml) {
+ try {
+ Schema schema = schemaFactory.newSchema(new StreamSource(xsd));
+ Validator validator = schema.newValidator();
+ validator.validate(new StreamSource(xml));
+ Assert.fail("should report error");
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ // e.printStackTrace();
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xml
new file mode 100644
index 00000000000..2a94e7bb546
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xml
@@ -0,0 +1,5 @@
+
+ 1
+ x
+ y
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xsd
new file mode 100644
index 00000000000..971aba3af5f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956.xsd
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956Test.java
new file mode 100644
index 00000000000..82cdf3fabc4
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug6989956Test.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/*
+ * @bug 6989956
+ * @summary Test Validation can process correctly that maxOccurs in Choice less than maxOccurs in Elements contained in the Choice.
+ */
+public class Bug6989956Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug6989956Test.class.getResourceAsStream("Bug6989956.xsd")));
+
+ Validator validator = schema.newValidator();
+ validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+ validator.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+
+ public void fatalError(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+
+ public void warning(SAXParseException exception) throws SAXException {
+ exception.printStackTrace();
+ }
+ });
+
+ validator.validate(new StreamSource(Bug6989956Test.class.getResourceAsStream("Bug6989956.xml")));
+
+ } catch (SAXException e) {
+ System.out.println(e.getMessage());
+ // fail(e.getMessage());
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.out.println(e.getMessage());
+ // fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testInstance() throws ParserConfigurationException, SAXException, IOException {
+ System.out.println(Bug6989956Test.class.getResource("Bug6989956.xsd").getPath());
+ File schemaFile = new File(Bug6989956Test.class.getResource("Bug6989956.xsd").getPath());
+ SAXParser parser = createParser(schemaFile);
+
+ try {
+ parser.parse(Bug6989956Test.class.getResource("Bug6989956.xml").getPath(), new DefaultHandler());
+ } catch (SAXException e) {
+ e.printStackTrace();
+ Assert.fail("Fatal Error: " + strException(e));
+ }
+
+ }
+
+ protected SAXParser createParser(File schema) throws ParserConfigurationException, SAXException {
+
+ // create and initialize the parser
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ spf.setValidating(true);
+ SAXParser parser = spf.newSAXParser();
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+
+ // set schemaLocation if possible
+ try {
+ parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schema);
+ } catch (SAXNotRecognizedException e) {
+ System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not recognized.");
+ } catch (SAXNotSupportedException e) {
+ System.out.println("Warning: Property 'http://java.sun.com/xml/jaxp/properties/schemaSource' is not supported.");
+ }
+
+ return parser;
+ }
+
+ protected static String strException(Exception ex) {
+ StringBuffer sb = new StringBuffer();
+
+ while (ex != null) {
+ if (ex instanceof SAXParseException) {
+ SAXParseException e = (SAXParseException) ex;
+ sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage());
+ ex = e.getException();
+ } else {
+ sb.append(ex);
+ ex = null;
+ }
+ }
+ return sb.toString();
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246.xsd
new file mode 100644
index 00000000000..5966f8a356a
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246.xsd
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246Test.java
new file mode 100644
index 00000000000..0da53f664e3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/tck/Bug7014246Test.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.validation.tck;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 7014246
+ * @summary Test Schema doesn't allow maxInclusive of derived time type greater than the base.
+ */
+public class Bug7014246Test {
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test() {
+ try {
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(new StreamSource(Bug7014246Test.class.getResourceAsStream("Bug7014246.xsd")));
+ Assert.fail("STATUS:Failed.The negative testcase unexpectedly passed.");
+ } catch (SAXException e) {
+ e.printStackTrace();
+
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-element.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-element.xsd
new file mode 100644
index 00000000000..ca1fb690bd5
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-element.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-sequence.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-sequence.xsd
new file mode 100644
index 00000000000..649bd0c5886
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test-sequence.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test.xsd
new file mode 100644
index 00000000000..d964bf86ff3
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/test.xsd
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xml
new file mode 100644
index 00000000000..1d9fbe2df66
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ Lego-Model01
+ 65.99
+
+
+ Lego-Model2
+ 69.99
+
+
+ Lego-Model3
+ 14.99
+
+
+ Barbie-Pink
+ 12.99
+
+
+ Barbie-Blue
+ 13.99
+
+
+ Barbie-White
+ 13.99
+
+
+ Barbie-Plain
+ 13.99
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xsd
new file mode 100644
index 00000000000..31df3f1476f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/toys.xsd
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/types.xsd b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/types.xsd
new file mode 100644
index 00000000000..4bcc81d97b2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/validation/types.xsd
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991857.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991857.java
new file mode 100644
index 00000000000..9c71f1929b2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991857.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+
+/*
+ * @bug 4991857
+ * @summary XPath.evaluate(...) throws XPathExpressionException when context is null and expression refers to the context.
+ */
+public class Bug4991857 {
+
+ Document d = null;
+
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+
+ @Test
+ public void testXPath09() throws Exception {
+ try {
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+
+ Double result = (Double) xpath.evaluate("1+2", d, XPathConstants.NUMBER);
+ } catch (XPathExpressionException unused) {
+ Assert.fail("Unexpected XPathExpressionException thrown");
+ }
+ }
+
+ @Test
+ public void testXPath10() throws Exception {
+ try {
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+
+ xpath.evaluate(".", d, XPathConstants.STRING);
+ Assert.fail("XPathExpressionException not thrown");
+ } catch (XPathExpressionException e) {
+ // Expected exception as context node is null
+ }
+ }
+
+ @Test
+ public void testXPath11() throws Exception {
+ try {
+ Document d = null;
+
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ Assert.assertNotNull(xpathFactory);
+
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+
+ String quantity = (String) xpath.evaluate("/widgets/widget[@name='a']/@quantity", d, XPathConstants.STRING);
+ Assert.fail("XPathExpressionException not thrown");
+ } catch (XPathExpressionException e) {
+ // Expected exception as context node is null
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991939.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991939.java
new file mode 100644
index 00000000000..55ad3df3763
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4991939.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 4991939
+ * @summary XPath.evaluate(...) throws IllegalArgumentException if returnType is not one of the types defined in XPathConstants.
+ */
+public class Bug4991939 {
+
+ @Test
+ public void testXPath13() throws Exception {
+ QName qname = new QName(XMLConstants.XML_NS_URI, "");
+
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ Assert.assertNotNull(xpathFactory);
+
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+
+ try {
+ xpath.evaluate("1+1", (Object) null, qname);
+ Assert.fail("failed , expected IAE not thrown");
+ } catch (IllegalArgumentException e) {
+ ; // as expected
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992788.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992788.java
new file mode 100644
index 00000000000..3fe5f923b27
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992788.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFactoryConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4992788
+ * @summary Test XPath.evaluate(expression,source,returnType) throws NPE if source is null.
+ */
+public class Bug4992788 {
+
+ private static String expression = "/widgets/widget[@name='a']/@quantity";
+
+ // test for XPath.evaluate(java.lang.String expression, InputSource source)
+ // - default returnType is String
+ // source is null , should throw NPE
+ @Test
+ public void testXPath23() throws Exception {
+ try {
+ createXPath().evaluate(expression, (InputSource) null);
+ Assert.fail();
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+
+ // test for XPath.evaluate(java.lang.String expression, InputSource source,
+ // QName returnType)
+ // source is null , should throw NPE
+ @Test
+ public void testXPath28() throws Exception {
+ try {
+ createXPath().evaluate(expression, (InputSource) null, XPathConstants.STRING);
+ Assert.fail();
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+
+ private XPath createXPath() throws XPathFactoryConfigurationException {
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ Assert.assertNotNull(xpathFactory);
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+ return xpath;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992793.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992793.java
new file mode 100644
index 00000000000..8552559019e
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992793.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFactoryConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4992793
+ * @summary Test XPath.evaluate(expression,source,returnType) throws NPE if expression is null.
+ */
+public class Bug4992793 {
+
+
+ // test for XPath.evaluate(java.lang.String expression, InputSource source)
+ // - default returnType is String
+ // source is null , should throw NPE
+ @Test
+ public void testXPath24() throws Exception {
+ try {
+ createXPath().evaluate(null, new InputSource(new StringReader("")));
+ Assert.fail();
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+
+ // test for XPath.evaluate(java.lang.String expression, InputSource source,
+ // QName returnType)
+ // source is null , should throw NPE
+ @Test
+ public void testXPath29() throws Exception {
+ try {
+ createXPath().evaluate(null, new InputSource(new StringReader("")), XPathConstants.STRING);
+ Assert.fail();
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+
+ private XPath createXPath() throws XPathFactoryConfigurationException {
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ Assert.assertNotNull(xpathFactory);
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+ return xpath;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992805.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992805.java
new file mode 100644
index 00000000000..71ab8d6c298
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/Bug4992805.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFactoryConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4992805
+ * @summary Test XPath.evaluate(expression,source,returnType) throws NPE if returnType is null.
+ */
+public class Bug4992805 {
+
+ private static String expression = "/widgets/widget[@name='a']/@quantity";
+
+ // test for XPath.evaluate(java.lang.String expression, InputSource source,
+ // QName returnType)
+ // source is null , should throw NPE
+ @Test
+ public void testXPath30() throws Exception {
+ try {
+ createXPath().evaluate(expression, new InputSource(new StringReader("")), null);
+ Assert.fail();
+ } catch (NullPointerException e) {
+ ; // as expected
+ }
+ }
+
+ private XPath createXPath() throws XPathFactoryConfigurationException {
+ XPathFactory xpathFactory = XPathFactory.newInstance();
+ Assert.assertNotNull(xpathFactory);
+ XPath xpath = xpathFactory.newXPath();
+ Assert.assertNotNull(xpath);
+ return xpath;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/ClassLoaderTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/ClassLoaderTest.java
new file mode 100644
index 00000000000..3ae3585ec16
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/ClassLoaderTest.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import javax.xml.xpath.XPathFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6354969
+ * @summary Test XPathFactory newInstance() with ContextClassLoader.
+ */
+public class ClassLoaderTest {
+
+ @Test
+ public void testClassLoader() {
+ MyClassLoader cl = new MyClassLoader();
+ Thread.currentThread().setContextClassLoader(cl);
+ XPathFactory xPathFactory = XPathFactory.newInstance();
+
+ if (!cl.isCalled()) {
+ Assert.fail("Context class loader should be used.");
+ }
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/MyClassLoader.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/MyClassLoader.java
new file mode 100644
index 00000000000..73b86547214
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/MyClassLoader.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.xml.xpath;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+
+public class MyClassLoader extends ClassLoader {
+ boolean isCalled = false;
+
+ public URL getResource(String name) {
+ isCalled = true;
+ return super.getResource(name);
+ }
+
+ public Enumeration getResources(String name) throws IOException {
+ isCalled = true;
+ return super.getResources(name);
+ }
+
+ public void reset() {
+ isCalled = false;
+ }
+
+ public boolean isCalled() {
+ return isCalled;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.java
new file mode 100644
index 00000000000..50eea2738ed
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * @summary Test when FEATURE_SECURE_PROCESSING is true, calling an external function will cause XPathFunctionException.
+ */
+public class SecureProcessingTest {
+ static boolean _isSecureMode = false;
+ static {
+ if (System.getSecurityManager() != null) {
+ _isSecureMode = true;
+ System.out.println("Security Manager is present");
+ } else {
+ System.out.println("Security Manager is NOT present");
+ }
+ }
+
+ @Test
+ public final void testSecureProcessing() {
+
+ final String XPATH_EXPRESSION = "ext:helloWorld()";
+
+ // the xml source
+ InputStream xmlStream = this.getClass().getResourceAsStream("SecureProcessingTest.xml");
+
+ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder documentBuilder = null;
+ Document document = null;
+
+ try {
+ documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ document = documentBuilder.parse(xmlStream);
+ } catch (ParserConfigurationException parserConfigurationException) {
+ parserConfigurationException.printStackTrace();
+ Assert.fail(parserConfigurationException.toString());
+ } catch (SAXException saxException) {
+ saxException.printStackTrace();
+ Assert.fail(saxException.toString());
+ } catch (IOException ioException) {
+ ioException.printStackTrace();
+ Assert.fail(ioException.toString());
+ }
+
+ // the XPath
+ XPathFactory xPathFactory = null;
+ XPath xPath = null;
+ String xPathResult = null;
+
+ // SECURE_PROCESSING == false
+ // evaluate an expression with a user defined function with a non-secure
+ // XPath
+ // expect success
+ if (!_isSecureMode) { // jaxp secure feature can not be turned off when
+ // security manager is present
+ try {
+ xPathFactory = xPathFactory.newInstance();
+ xPathFactory.setXPathFunctionResolver(new MyXPathFunctionResolver());
+ xPathFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+
+ xPath = xPathFactory.newXPath();
+ xPath.setNamespaceContext(new MyNamespaceContext());
+
+ xPathResult = xPath.evaluate(XPATH_EXPRESSION, document);
+ } catch (XPathFactoryConfigurationException xPathFactoryConfigurationException) {
+ xPathFactoryConfigurationException.printStackTrace();
+ Assert.fail(xPathFactoryConfigurationException.toString());
+ } catch (XPathExpressionException xPathExpressionException) {
+ xPathExpressionException.printStackTrace();
+ Assert.fail(xPathExpressionException.toString());
+ }
+
+ // expected success
+ System.out.println("XPath result (SECURE_PROCESSING == false) = \"" + xPathResult + "\"");
+ }
+ // now try with SECURE_PROCESSING == true
+ // evaluate an expression with a user defined function with a secure
+ // XPath
+ // expect Exception
+ boolean securityException = false;
+ try {
+ xPathFactory = xPathFactory.newInstance();
+ xPathFactory.setXPathFunctionResolver(new MyXPathFunctionResolver());
+ xPathFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+
+ xPath = xPathFactory.newXPath();
+ xPath.setNamespaceContext(new MyNamespaceContext());
+
+ xPathResult = xPath.evaluate(XPATH_EXPRESSION, document);
+ } catch (XPathFactoryConfigurationException xPathFactoryConfigurationException) {
+ xPathFactoryConfigurationException.printStackTrace();
+ Assert.fail(xPathFactoryConfigurationException.toString());
+ } catch (XPathFunctionException xPathFunctionException) {
+ // expected security exception
+ securityException = true;
+ xPathFunctionException.printStackTrace(System.out);
+ } catch (XPathExpressionException xPathExpressionException) {
+ xPathExpressionException.printStackTrace();
+ Assert.fail(xPathExpressionException.toString());
+ }
+
+ // expected Exception
+ if (!securityException) {
+ Assert.fail("XPath result (SECURE_PROCESSING == true) = \"" + xPathResult + "\"");
+ }
+ }
+
+ public class MyXPathFunctionResolver implements XPathFunctionResolver {
+
+ public XPathFunction resolveFunction(QName functionName, int arity) {
+
+ // not a real ewsolver, always return a default XPathFunction
+ return new MyXPathFunction();
+ }
+ }
+
+ public class MyXPathFunction implements XPathFunction {
+
+ public Object evaluate(List list) throws XPathFunctionException {
+
+ return "Hello World";
+ }
+ }
+
+ public class MyNamespaceContext implements NamespaceContext {
+
+ public String getNamespaceURI(String prefix) {
+ if (prefix == null) {
+ throw new IllegalArgumentException("The prefix cannot be null.");
+ }
+
+ if (prefix.equals("ext")) {
+ return "http://ext.com";
+ } else {
+ return null;
+ }
+ }
+
+ public String getPrefix(String namespace) {
+
+ if (namespace == null) {
+ throw new IllegalArgumentException("The namespace uri cannot be null.");
+ }
+
+ if (namespace.equals("http://ext.com")) {
+ return "ext";
+ } else {
+ return null;
+ }
+ }
+
+ public Iterator getPrefixes(String namespace) {
+ return null;
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.xml b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.xml
new file mode 100644
index 00000000000..bc916a958f9
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/SecureProcessingTest.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/XPathTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/XPathTest.java
new file mode 100644
index 00000000000..34fe8e3c4bb
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/xpath/XPathTest.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.xpath;
+
+import javax.xml.namespace.NamespaceContext;
+
+import org.testng.annotations.Test;
+
+/*
+ * @bug 6376058
+ * @summary Test XPath.getNamespaceContext() is supported.
+ */
+public class XPathTest {
+
+ @Test
+ public void testNamespaceContext() {
+
+ XPathFactory xPathFactory = XPathFactory.newInstance();
+ XPath xPath = xPathFactory.newXPath();
+
+ NamespaceContext namespaceContext = xPath.getNamespaceContext();
+
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915524.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915524.java
new file mode 100644
index 00000000000..f496447619d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915524.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
+/*
+ * @bug 4915524
+ * @summary Test Document.adoptNode() shall not throw Exception when the source document object is created from different implementation.
+ */
+
+public class Bug4915524 {
+
+ String data = "" + "" + " " + "]>" + "";
+
+ DocumentBuilder docBuilder = null;
+
+ /*
+ * This method tries to adopt a node from Defered document to non-defered
+ * document.
+ */
+ @Test
+ public void testAdoptNode() {
+ try {
+ DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance();
+ docBuilder = docBF.newDocumentBuilder();
+
+ Document doc1 = parse(data);
+ Document doc2 = docBuilder.newDocument();
+
+ Node element = doc2.adoptNode(doc1.getDocumentElement());
+
+ System.out.println("OK.");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Excpetion while adopting node: " + e.getMessage());
+ }
+
+ }
+
+ private Document parse(String xmlData) throws Exception {
+ StringReader in = new StringReader(xmlData);
+ InputSource source = new InputSource(in);
+ return docBuilder.parse(source);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915748.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915748.java
new file mode 100644
index 00000000000..9e04b082254
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4915748.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 4915748
+ * @summary Test DOMErrorHandler is called in case CDATA section is split by termination marker ']]>'.
+ */
+public class Bug4915748 {
+
+ @Test
+ public void testMain() throws Exception {
+
+ final boolean[] hadError = new boolean[1];
+
+ DocumentBuilderFactory docBF = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docBF.newDocumentBuilder();
+
+ Document doc = docBuilder.getDOMImplementation().createDocument("namespaceURI", "ns:root", null);
+
+ CDATASection cdata = doc.createCDATASection("text1]]>text2");
+ doc.getDocumentElement().appendChild(cdata);
+
+ DOMConfiguration config = doc.getDomConfig();
+ DOMErrorHandler erroHandler = new DOMErrorHandler() {
+ public boolean handleError(DOMError error) {
+ System.out.println(error.getMessage());
+ Assert.assertEquals(error.getType(), "cdata-sections-splitted");
+ Assert.assertFalse(hadError[0], "two errors were reported");
+ hadError[0] = true;
+ return false;
+ }
+ };
+ config.setParameter("error-handler", erroHandler);
+ doc.normalizeDocument();
+ Assert.assertTrue(hadError[0]);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.java
new file mode 100644
index 00000000000..3bc3c357443
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+
+/*
+ * @bug 4966082
+ * @summary Test Element.getSchemaTypeInfo() returns an instance of TypeInfo instead of null when the document's schema is an XML DTD.
+ */
+public class Bug4966082 {
+
+ @Test
+ public void testOne() {
+ try {
+ Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(Bug4966082.class.getResource("Bug4966082.xml").toExternalForm());
+ if (document.getDocumentElement().getSchemaTypeInfo() == null) {
+ Assert.fail("getSchemaTypeInfo returns null");
+ }
+ } catch (Exception ex) {
+ Assert.fail("Unexpected error" + ex);
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.xml b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.xml
new file mode 100644
index 00000000000..261e1dc6b95
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966082.xml
@@ -0,0 +1,5 @@
+
+
+]>
+xxx
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966138.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966138.java
new file mode 100644
index 00000000000..ddd0bf5ff89
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966138.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.TypeInfo;
+
+/*
+ * @bug 4966138
+ * @summary Test Element's TypeInfo.getTypeName() returns a name instead of null in case the element is declared using anonymous simple type.
+ */
+public class Bug4966138 {
+
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test1() throws Exception {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setValidating(true);
+ dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ dbf.setAttribute(SCHEMA_SOURCE, Bug4966138.class.getResource("test.xsd").toExternalForm());
+
+ Document document = dbf.newDocumentBuilder().parse(Bug4966138.class.getResource("test.xml").toExternalForm());
+
+ TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();
+
+ String typeName = type.getTypeName();
+ System.out.println(typeName);
+ Assert.assertNotNull(typeName);
+ Assert.assertTrue(typeName.length() != 0, "returned typeName shouldn't be empty");
+
+ String typeNs = type.getTypeNamespace();
+ System.out.println(typeNs);
+ Assert.assertNotNull(typeNs);
+ Assert.assertTrue(typeNs.length() != 0, "returned typeNamespace shouldn't be empty");
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.java
new file mode 100644
index 00000000000..dd55013d571
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.TypeInfo;
+
+/*
+ * @bug 4966142
+ * @summary Test TypeInfo.isDerivedFrom(...) works instead of throws UnsupportedOperationException when the TypeInfo instance refers to a simple type.
+ */
+public class Bug4966142 {
+
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test1() throws Exception {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setValidating(true);
+ dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ dbf.setAttribute(SCHEMA_SOURCE, Bug4966142.class.getResource("Bug4966142.xsd").toExternalForm());
+
+ Document document = dbf.newDocumentBuilder().parse(Bug4966142.class.getResource("Bug4966142.xml").toExternalForm());
+
+ TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();
+
+ Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xml b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xml
new file mode 100644
index 00000000000..c920ced635d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xml
@@ -0,0 +1,2 @@
+
+the test
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xsd b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xsd
new file mode 100644
index 00000000000..e295919d57b
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966142.xsd
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.java
new file mode 100644
index 00000000000..7133089d296
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.TypeInfo;
+
+/*
+ * @bug 4966143
+ * @summary Test isDerivedFrom(...) returns true only if the parameter is DERIVATION_EXTENSION,
+ * in case TypeInfo instance refers to a complex type derived from another complex type by extension.
+ */
+public class Bug4966143 {
+
+ static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
+
+ @Test
+ public void test1() throws Exception {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setValidating(true);
+ dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ dbf.setAttribute(SCHEMA_SOURCE, Bug4966143.class.getResource("Bug4966143.xsd").toExternalForm());
+
+ Document document = dbf.newDocumentBuilder().parse(Bug4966143.class.getResource("Bug4966143.xml").toExternalForm());
+
+ TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();
+
+ Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
+ Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_LIST));
+ Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_RESTRICTION));
+ Assert.assertTrue(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_EXTENSION));
+ Assert.assertTrue(type.isDerivedFrom("testNS", "Test", 0));
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xml b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xml
new file mode 100644
index 00000000000..251af32866d
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xml
@@ -0,0 +1,2 @@
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xsd b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xsd
new file mode 100644
index 00000000000..88a29ef37bc
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug4966143.xsd
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6339023.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6339023.java
new file mode 100644
index 00000000000..273708cc209
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6339023.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.DOMStringList;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSParser;
+import org.w3c.dom.ls.LSSerializer;
+
+/*
+ * @bug 6339023
+ * @summary Test normalize-characters.
+ */
+public class Bug6339023 {
+
+ /*
+ * This test checks DOMConfiguration for DOM Level3 Load and Save
+ * implementation.
+ */
+ @Test
+ public void testLSSerializer() {
+ try {
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ DOMImplementation impln = parser.getDOMImplementation();
+ DOMImplementationLS lsImpln = (DOMImplementationLS) impln.getFeature("LS", "3.0");
+ LSSerializer serializer = lsImpln.createLSSerializer();
+ DOMConfiguration domConfig = serializer.getDomConfig();
+ System.out.println("DOMConfig: " + domConfig.toString());
+ Assert.assertTrue(domConfig.getParameter("normalize-characters") == null);
+ System.out.println("value: " + domConfig.getParameter("normalize-characters"));
+
+ DOMStringList list = domConfig.getParameterNames();
+ for (int i = 0; i < list.getLength(); i++) {
+ System.out.println("Param Name: " + list.item(i));
+ Assert.assertFalse(list.item(i).equals("normalize-characters"));
+ }
+
+ Assert.assertFalse(domConfig.canSetParameter("normalize-characters", Boolean.FALSE));
+ Assert.assertFalse(domConfig.canSetParameter("normalize-characters", Boolean.TRUE));
+
+ try {
+ domConfig.setParameter("normalize-characters", Boolean.TRUE);
+ Assert.fail("Exception expected as 'normalize-characters' is not supported");
+ } catch (Exception e) {
+ }
+
+ try {
+ domConfig.setParameter("normalize-characters", Boolean.FALSE);
+ Assert.fail("Exception expected as 'normalize-characters' is not supported");
+ } catch (Exception e) {
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception: " + e.getMessage());
+ }
+ }
+
+ /*
+ * This test checks DOMConfiguration for DOM Level3 Core implementation.
+ */
+ @Test
+ public void testLSParser() {
+ try {
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ DOMImplementation impln = parser.getDOMImplementation();
+ DOMImplementationLS lsImpln = (DOMImplementationLS) impln.getFeature("Core", "3.0");
+ LSParser lsparser = lsImpln.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema");
+ DOMConfiguration domConfig = lsparser.getDomConfig();
+ System.out.println("DOMConfig: " + domConfig.toString());
+ Assert.assertTrue(domConfig.getParameter("normalize-characters").toString().equalsIgnoreCase("false"));
+ System.out.println("value: " + domConfig.getParameter("normalize-characters"));
+
+ DOMStringList list = domConfig.getParameterNames();
+ boolean flag = false;
+ for (int i = 0; i < list.getLength(); i++) {
+ System.out.println("Param Name: " + list.item(i));
+ if (list.item(i).equals("normalize-characters")) {
+ flag = true;
+ break;
+ }
+ }
+ Assert.assertTrue(flag, "'normalize-characters' doesnot exist in the list returned by domConfig.getParameterNames()");
+
+ Assert.assertTrue(domConfig.canSetParameter("normalize-characters", Boolean.FALSE));
+ Assert.assertFalse(domConfig.canSetParameter("normalize-characters", Boolean.TRUE));
+
+ try {
+ domConfig.setParameter("normalize-characters", Boolean.TRUE);
+ Assert.fail("Exception expected as 'normalize-characters' is not supported");
+ } catch (Exception e) {
+ }
+
+ try {
+ domConfig.setParameter("normalize-characters", Boolean.FALSE);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception expected as 'normalize-characters' is not supported");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception: " + e.getMessage());
+ }
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6355326.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6355326.java
new file mode 100644
index 00000000000..911baf4a07f
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6355326.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.StringBufferInputStream;
+import java.io.UnsupportedEncodingException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSParser;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6355326
+ * @summary Test DOM implementation encoding.
+ */
+public class Bug6355326 {
+
+ DOMImplementationLS implLS = null;
+ String encodingXML = "";
+
+ @BeforeMethod
+ protected void setUp() {
+ Document doc = null;
+ DocumentBuilder parser = null;
+ String xml1 = "";
+ try {
+ parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ }
+ StringBufferInputStream is = new StringBufferInputStream(xml1);
+ try {
+ doc = parser.parse(is);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ DOMImplementation impl = doc.getImplementation();
+ implLS = (DOMImplementationLS) impl.getFeature("LS", "3.0");
+ }
+
+ @Test
+ public void testExternalEncoding() {
+
+ try {
+ LSInput src = null;
+ LSParser dp = null;
+
+ src = createLSInputEncoding();
+ dp = createLSParser();
+
+ src.setEncoding("UTF-16");
+ Document doc = dp.parse(src);
+ Assert.assertTrue("encodingXML".equals(doc.getDocumentElement().getNodeName()), "XML document is not parsed correctly");
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+
+ private LSInput createLSInputEncoding() {
+ LSInput src = implLS.createLSInput();
+ Assert.assertFalse(src == null, "Could not create LSInput from DOMImplementationLS");
+
+ try {
+ src.setByteStream(new ByteArrayInputStream(encodingXML.getBytes("UTF-16")));
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ return src;
+ }
+
+ private LSParser createLSParser() {
+ LSParser p = implLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, "http://www.w3.org/2001/XMLSchema");
+ Assert.assertFalse(p == null, "Could not create Synchronous LSParser from DOMImplementationLS");
+ return p;
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6367542.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6367542.java
new file mode 100644
index 00000000000..fa77a70df16
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6367542.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+
+/*
+ * @bug 6367542
+ * @summary Test DOMImplementationRegistry.getDOMImplementation("XML") returns a DOMImplementation instance.
+ */
+public class Bug6367542 {
+
+ @Test
+ public void testDOMImplementationRegistry() {
+ try {
+ DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
+ DOMImplementation domImpl = registry.getDOMImplementation("XML");
+ Assert.assertTrue(domImpl != null, "Non null implementation is expected for getDOMImplementation('XML')");
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Exception occured: " + e.getMessage());
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6520131.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6520131.java
new file mode 100644
index 00000000000..c30f43070da
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6520131.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Text;
+
+/*
+ * @bug 6520131
+ * @summary Test DOMErrorHandler reports an error for invalid character.
+ */
+public class Bug6520131 {
+
+ @Test
+ public void test() {
+ String string = new String("\u0001");
+
+ try {
+ // create document
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder documentBuilder = dbf.newDocumentBuilder();
+ Document document = documentBuilder.newDocument();
+
+ DOMConfiguration domConfig = document.getDomConfig();
+ domConfig.setParameter("well-formed", Boolean.TRUE);
+ domConfig.setParameter("error-handler", new DOMErrorHandler() {
+ public boolean handleError(DOMError e) {
+ throw new RuntimeException(e.getMessage());
+ }
+ });
+
+ // add text element
+ Element textElement = document.createElementNS("", "Text");
+ Text text = document.createTextNode(string);
+ textElement.appendChild(text);
+ document.appendChild(textElement);
+
+ // normalize document
+ document.normalizeDocument();
+
+ Assert.fail("Invalid character exception not thrown");
+ } catch (ParserConfigurationException e) {
+ Assert.fail("Unable to configure parser");
+ } catch (RuntimeException e) {
+ // This exception is expected!
+ }
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6521260.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6521260.java
new file mode 100644
index 00000000000..bcfa894ed53
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6521260.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6521260
+ * @summary Test setAttributeNS doesn't result in an unsorted internal list of attributes.
+ */
+public class Bug6521260 {
+
+ @Test
+ public void test() throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+
+ String docStr = "";
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(docStr.getBytes());
+
+ Document doc = builder.parse(bais);
+
+ Element root = doc.getDocumentElement();
+
+ String systemId = root.getAttribute("systemId");
+
+ // Change the prefix on the "time" attribute so that the list would
+ // become unsorted
+ // before my fix to
+ // xml-xerces/java/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java
+ root.setAttributeNS("http://xmlresolver.org/ns/catalog", "xc:time", "100");
+
+ String systemId2 = root.getAttribute("systemId");
+
+ Assert.assertEquals(systemId, systemId2);
+ }
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545.xml b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545.xml
new file mode 100644
index 00000000000..8f48009e839
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545Test.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545Test.java
new file mode 100644
index 00000000000..2966d0accc6
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6582545Test.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.w3c.dom;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+/*
+ * @bug 6582545
+ * @summary Test the value is correct when iterating attributes.
+ */
+public class Bug6582545Test {
+ private DocumentBuilder xmlParser = null;
+ private Document document = null;
+ private String FWS1 = "FWS1";
+ private String KEY_ARROW_UP = "KEY_ARROW_UP";
+ private String VALUE_ARROW_UP = "root%LRM%Tmp_CPIOM-C1%VLIN_For_ECP%ECP_IN_Port_1%IOM-A7_Msg_cd30%FDS_1_ECP_to_FWS-1%A31_ECP_ARROW_UP";
+
+ @Test
+ public void testAttributeCaching() {
+
+ File xmlFile = new File(getClass().getResource("Bug6582545.xml").getFile());
+
+ try {
+ DocumentBuilderFactory aDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
+ xmlParser = aDocumentBuilderFactory.newDocumentBuilder();
+
+ // works fine with JDK 1.4.2, 1.5
+ // does not work with JDK 1.6
+ document = xmlParser.parse(xmlFile);
+ printNode(FWS1);
+ } catch (SAXException saxException) {
+ saxException.printStackTrace();
+ } catch (ParserConfigurationException parserConfigurationException) {
+ parserConfigurationException.printStackTrace();
+ } catch (IOException ioException) {
+ ioException.printStackTrace();
+ } catch (IllegalArgumentException illegalArgumentException) {
+ illegalArgumentException.printStackTrace();
+ }
+ }
+
+ private void printNode(String aNode) {
+ boolean error = true;
+ NodeList nodeList;
+ NamedNodeMap attributes;
+
+ nodeList = document.getElementsByTagName(aNode);
+ attributes = nodeList.item(0).getAttributes();
+
+ String name;
+ String value;
+ // Print all nodes
+ for (int k = 0; k < attributes.getLength(); k++) {
+ name = attributes.item(k).getNodeName();
+ value = attributes.item(k).getNodeValue();
+ System.out.println(name + "=" + value);
+ }
+
+ // Test specifique a node
+ String javaSpecificationVersion = System.getProperty("java.specification.version");
+ for (int k = 0; k < attributes.getLength(); k++) {
+ name = attributes.item(k).getNodeName();
+ value = attributes.item(k).getNodeValue();
+ if (KEY_ARROW_UP.equals(name)) {
+ if (VALUE_ARROW_UP.equals(value)) {
+ // Parser OK
+ System.out.println("Parser in Java " + javaSpecificationVersion + " returned correct value.");
+ error = false;
+ } else {
+ // Parser NOK
+ System.out.println("Parser in Java " + javaSpecificationVersion + " returned wrong value");
+ }
+ System.out.println("for node = " + KEY_ARROW_UP);
+ System.out.println("expecting value =" + VALUE_ARROW_UP);
+ System.out.println("value from parser=" + value);
+ }
+ }
+
+ Assert.assertTrue(!error);
+ }
+
+}
diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614.xml b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614.xml
new file mode 100644
index 00000000000..7de8402eba8
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/Bug6879614.xml
@@ -0,0 +1,722 @@
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+